From b01cf28dccc662084ca9cbac08b2c44d1fb5f49a Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 10:03:00 -0600 Subject: [PATCH 01/63] a release note about release notes --- .../2023-12-31-new-release-notes-structure.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 source/release-notes/2023-12-31-new-release-notes-structure.md diff --git a/source/release-notes/2023-12-31-new-release-notes-structure.md b/source/release-notes/2023-12-31-new-release-notes-structure.md new file mode 100644 index 0000000000..b85a37bdfd --- /dev/null +++ b/source/release-notes/2023-12-31-new-release-notes-structure.md @@ -0,0 +1,20 @@ +--- +title: New Release Notes Structure +publish_dated: "2023-12-31" +--- + +# New Release Notes Structure + +For nearly a decade, we have published a monthly "changelog" here within our Documentation site that summarizes significant changes to the platform. +Going forward in 2024 we are changing some of the details of how we publish and organize this information. + +Rather than treating the monthly retrospective as the base unit of information, we will instead publish a new "Release Note" for each significant change to the platform as needed, rather than waiting for the monthly summary. + +This switch will support more proactive communication and ensure that any noteworthy change is marked here in addition to the blog posts, emails, and other channels we use to communicate with our customers. + +Here you will find: +* A listing of all Release Notes at docs.pantheon.io/release-notes +* A listing of Release Notes by category like docs.pantheon.io/release-notes/infrastructure +# todo or should it be docs.pantheon.io/release-notes/all/2023/12 ? +* A month-by-month breakdown of all Release Notes like docs.pantheon.io/release-notes/all/2023-12 +* A month-by-month breakdown of Release Notes by catetory and month like docs.pantheon.io/release-notes/infrastructure/2023-12 From b9139943e2b2c0b61050c9e901c968384aea3176 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 10:03:21 -0600 Subject: [PATCH 02/63] a release note about release notes --- source/release-notes/2023-12-31-new-release-notes-structure.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/release-notes/2023-12-31-new-release-notes-structure.md b/source/release-notes/2023-12-31-new-release-notes-structure.md index b85a37bdfd..08db16388e 100644 --- a/source/release-notes/2023-12-31-new-release-notes-structure.md +++ b/source/release-notes/2023-12-31-new-release-notes-structure.md @@ -15,6 +15,5 @@ This switch will support more proactive communication and ensure that any notewo Here you will find: * A listing of all Release Notes at docs.pantheon.io/release-notes * A listing of Release Notes by category like docs.pantheon.io/release-notes/infrastructure -# todo or should it be docs.pantheon.io/release-notes/all/2023/12 ? -* A month-by-month breakdown of all Release Notes like docs.pantheon.io/release-notes/all/2023-12 +* A month-by-month breakdown of all Release Notes like docs.pantheon.io/release-notes/all/2023-12 (todo or should it be docs.pantheon.io/release-notes/all/2023/12) * A month-by-month breakdown of Release Notes by catetory and month like docs.pantheon.io/release-notes/infrastructure/2023-12 From 441a713097b043f6b8b5d220990933f507932711 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 12:40:54 -0600 Subject: [PATCH 03/63] adding another sample --- .../2023-11-02-terminus-composer-logs-plugin.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 source/release-notes/2023-11-02-terminus-composer-logs-plugin.md diff --git a/source/release-notes/2023-11-02-terminus-composer-logs-plugin.md b/source/release-notes/2023-11-02-terminus-composer-logs-plugin.md new file mode 100644 index 0000000000..1597751f59 --- /dev/null +++ b/source/release-notes/2023-11-02-terminus-composer-logs-plugin.md @@ -0,0 +1,8 @@ +--- +title: Terminus Composer Logs Plugin 1.0.0 Released +publish_dated: "2023-11-02" +--- + +# New Release Notes Structure + +Visibility into composer logs has been a top customer request. Now, if you need to debug a composer build failure due to an error, install the Terminus Composer Logs plugin on your machine to view more details. Upstream Update logs are also available. Installation instructions and command usage can be found here in the [plugin's GitHub repository](https://github.com/pantheon-systems/terminus-composer-logs-plugin). From aecdfff1b0ba7bd0efa73a9d17649fe302c48956 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 12:56:49 -0600 Subject: [PATCH 04/63] rename dir --- .../2023-11-02-terminus-composer-logs-plugin.md | 0 .../2023-12-31-new-release-notes-structure.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename source/{release-notes => releasenotes}/2023-11-02-terminus-composer-logs-plugin.md (100%) rename source/{release-notes => releasenotes}/2023-12-31-new-release-notes-structure.md (100%) diff --git a/source/release-notes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md similarity index 100% rename from source/release-notes/2023-11-02-terminus-composer-logs-plugin.md rename to source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md diff --git a/source/release-notes/2023-12-31-new-release-notes-structure.md b/source/releasenotes/2023-12-31-new-release-notes-structure.md similarity index 100% rename from source/release-notes/2023-12-31-new-release-notes-structure.md rename to source/releasenotes/2023-12-31-new-release-notes-structure.md From 9744350594239e61bfdff2d5056b9fc6d0e29121 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 13:05:57 -0600 Subject: [PATCH 05/63] trying to get release notes pages generating --- gatsby-node.js | 79 ++++++++++++ src/templates/releaseNote.js | 160 ++++++++++++++++++++++++ src/templates/releaseNotesListing.js | 180 +++++++++++++++++++++++++++ 3 files changed, 419 insertions(+) create mode 100644 src/templates/releaseNote.js create mode 100644 src/templates/releaseNotesListing.js diff --git a/gatsby-node.js b/gatsby-node.js index 288a567556..ef18c9857d 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -184,6 +184,40 @@ exports.createPages = ({ graphql, actions }) => { } } + allReleaseNotes: allMdx( + filter: { + fileAbsolutePath: { regex: "/releasenotes/"} + }, + sort: { fields: [fileAbsolutePath], order: DESC } + ) { + edges { + + previous { + fields { + slug + } + } + + node { + id + frontmatter { + title + } + fields { + slug + } + } + + next { + fields { + slug + } + } + + } + } + + allChangelogs: allMdx( filter: { fileAbsolutePath: { regex: "/changelogs/"} @@ -309,6 +343,23 @@ exports.createPages = ({ graphql, actions }) => { }) }) + + + // Create each release note page. + const releaseNotes = result.data.allReleaseNotes.edges; + releaseNotes.forEach(releaseNote => { + const template = calculateTemplate(releaseNote.node, "releaseNote"); + createPage({ + path: releaseNote.node.fields.slug, + component: path.resolve(`./src/templates/${template}.js`), + context: { + slug: releaseNote.node.fields.slug, + }, + }) + console.log('hello'); + }) + + // Create Terminus Command pages const terminusCommands = result.data.dataJson.commands terminusCommands.forEach(command => { @@ -345,6 +396,34 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // Create changelog pagination. + const ReleaseNotesPerPage = 6 + const numberOfReleaseNotePages = Math.ceil(changelogs.length / ReleaseNotesPerPage) + Array.from({ length: numberOfReleaseNotePages }).forEach((_, i) => { + const currentPage = i + 1; + const next = currentPage === 1 ? null : (currentPage === 2 ? `/release-notes/` : `/release-notes/page/${currentPage - 1}`); + const previous = currentPage < numberOfReleaseNotePages ? `/changelog/page/${currentPage + 1}` : null; + createPage({ + path: i === 0 ? `/release-notes/` : `/release-notes/page/${i + 1}`, + component: path.resolve("./src/templates/release-notes.js"), + context: { + limit: ReleaseNotesPerPage, + skip: i * ReleaseNotesPerPage, + numberOfReleaseNotePages, + currentPage, + previous, + next + }, + }) + }) + + + + + + + + // Create contributor pages. const contributors = result.data.allContributorYaml.edges contributors.forEach(contributor => { diff --git a/src/templates/releaseNote.js b/src/templates/releaseNote.js new file mode 100644 index 0000000000..86394e0e92 --- /dev/null +++ b/src/templates/releaseNote.js @@ -0,0 +1,160 @@ +import React from "react" +import { graphql } from "gatsby" +import { MDXRenderer } from "gatsby-plugin-mdx" +import { MDXProvider } from "@mdx-js/react" + +import Layout from "../layout/layout" +import NavButtons from "../components/navButtons" +import Alert from "../components/alert" +import Accordion from "../components/accordion" +import ExternalLink from "../components/externalLink" +import Popover from "../components/popover" +import TabList from "../components/tabList" +import Tab from "../components/tab" +import TOC from "../components/toc" +import Card from "../components/card" +import CardGroup from "../components/cardGroup" +import SEO from "../layout/seo" +import Enablement from "../components/enablement" +import Color from "../components/color.js" +import Download from "../components/download" + + +import { + Container, + Icon, + Pager, + SidebarLayout, +} from "@pantheon-systems/pds-toolkit-react" + +const shortcodes = { + Alert, + Accordion, + ExternalLink, + Popover, + TabList, + Tab, + Card, + CardGroup, + Enablement, + Color, + Download, +} + +// Set container width for search and main content. +const containerWidth = "standard" + +class ChangelogTemplate extends React.Component { + componentDidMount() { + $("[data-toggle=popover]").popover({ + trigger: "click", + }) + + $("body").on("click", function (e) { + $('[data-toggle="popover"]').each(function () { + if ( + !$(this).is(e.target) && + $(this).has(e.target).length === 0 && + $(".popover").has(e.target).length === 0 + ) { + $(this).popover("hide") + } + }) + }) + + $("body").keyup(function (e) { + $('[data-toggle="popover"]').each(function () { + if (event.which === 27) { + $(this).popover("hide") + } + }) + }) + } + + render() { + const node = this.props.data.mdx + + return ( + + +
+ +
+ Pantheon Changelog +
+

{node.frontmatter.title}

+
+

+ Sign up for the Pantheon Changelog Newsletter to receive a + monthly email on what's new and improved across the platform. +

+ + Subscribe Now + + +
+
+ + +
+
+
+
+ + {node.body} + +
+
+
+
+ +
+ +
+
+
+ ) + } +} + +export default ChangelogTemplate + +export const pageQuery = graphql` + query ChangelogBySlug($slug: String!) { + mdx(fields: { slug: { eq: $slug } }) { + id + body + fields { + slug + } + frontmatter { + title + } + } + } +` diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js new file mode 100644 index 0000000000..18f5e7c433 --- /dev/null +++ b/src/templates/releaseNotesListing.js @@ -0,0 +1,180 @@ +import React from "react" +import { graphql, Link } from "gatsby" +import { MDXRenderer } from "gatsby-plugin-mdx" +import { MDXProvider } from "@mdx-js/react" + +import Layout from "../layout/layout" +import NavButtons from "../components/navButtons" +import Callout from "../components/callout" +import Alert from "../components/alert" +import Accordion from "../components/accordion" +import ExternalLink from "../components/externalLink" +import Popover from "../components/popover" +import TabList from "../components/tabList" +import Tab from "../components/tab" +import TOC from "../components/toc" +import Card from "../components/card" +import CardGroup from "../components/cardGroup" +import SEO from "../layout/seo" +import Enablement from "../components/enablement" +import Color from "../components/color.js" +import Download from "../components/download" + + +import { + headline1, + headline2, + headline3, + headline4, +} from "../components/releaseHeadlines" + +import { + Container, + Icon, + Pager, + SidebarLayout, +} from "@pantheon-systems/pds-toolkit-react" + +const shortcodes = { + Callout, + Alert, + Accordion, + ExternalLink, + Popover, + TabList, + Tab, + Card, + CardGroup, + Enablement, + Color, + Download, + h1: headline2, + h2: headline3, + h3: headline4, +} + +// Set container width for search and main content. +const containerWidth = "standard" + +// Combined changelog template. +class ChangelogsTemplate extends React.Component { + componentDidMount() { + $("[data-toggle=popover]").popover({ + trigger: "click", + }) + + $("body").on("click", function (e) { + $('[data-toggle="popover"]').each(function () { + if ( + !$(this).is(e.target) && + $(this).has(e.target).length === 0 && + $(".popover").has(e.target).length === 0 + ) { + $(this).popover("hide") + } + }) + }) + + $("body").keyup(function (e) { + $('[data-toggle="popover"]').each(function () { + if (event.which === 27) { + $(this).popover("hide") + } + }) + }) + } + + render() { + const changelogs = this.props.data.allMdx.edges + return ( + + +
+ +

Pantheon Changelog

+
+

+ Sign up for the Pantheon Changelog Newsletter to receive a + monthly email on what's new and improved across the platform. +

+ + Subscribe Now + + +
+
+ +
+
+
+
+ {changelogs.map((changelog) => ( + + +

+ {changelog.node.frontmatter.title} +

+ + + {changelog.node.body} + +
+ ))} +
+
+
+
+ +
+ +
+
+
+ ) + } +} + +export default ChangelogsTemplate + +export const pageQuery = graphql` + query Changelogs($skip: Int!, $limit: Int!) { + allMdx( + filter: { + fileAbsolutePath: { regex: "/changelogs/" } + frontmatter: { draft: { ne: true } } + } + sort: { fields: [fileAbsolutePath], order: DESC } + skip: $skip + limit: $limit + ) { + edges { + node { + id + body + frontmatter { + title + } + fields { + slug + } + } + } + } + } +` From bb2f193f9604c43da8a8206bd7dff443db22495a Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 13:51:24 -0600 Subject: [PATCH 06/63] starting to get release notes loading --- gatsby-config.js | 13 +++ gatsby-node.js | 102 ++++++------------ ...023-11-02-terminus-composer-logs-plugin.md | 3 + src/templates/releaseNotesListing.js | 5 +- 4 files changed, 51 insertions(+), 72 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 8e6af57400..ee16d4e5ce 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -97,6 +97,19 @@ module.exports = { name: `changelogs`, }, }, + + { + resolve: `gatsby-source-filesystem`, + options: { + path: `${__dirname}/source/releasenotes`, + name: `releasenotes`, + }, + }, + + + + + { resolve: `gatsby-source-filesystem`, options: { diff --git a/gatsby-node.js b/gatsby-node.js index ef18c9857d..cb29cf7e21 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -31,6 +31,12 @@ const calculateSlug = (node, getNode) => { const split = fileName.split('-'); // split the file name where hyphenated... return `changelog/${split[0]}/${split[1]}` // and return a slug of changelog/YYYY/MM } + // This section creates the releasenotes slug based on the YYYY-MM-DD-slug.md template + if (getNode(node.parent).absolutePath.includes("releasenotes")) { // If the file is in the releasenotes directory... + const split = fileName.split('-'); // split the file name where hyphenated... + // #todo, wait this should the slug should include all the words after the date, not just the first one. + return `releasenotes/${split[0]}/${split[1]}/${split[3]}${split[4]}` // and return a slug of releasenotes/YYYY/MM/slug + } return `${fileName}` // Otherwise, as long as there is a filename in GraphQL, use it as the slug. } @@ -127,7 +133,7 @@ exports.createPages = ({ graphql, actions }) => { { allDocs: allMdx( filter: { - fileAbsolutePath: { regex: "/content(?!/(partials|changelog|guides)/)/"} + fileAbsolutePath: { regex: "/content(?!/(partials|changelog|guides|releasenotes)/)/"} frontmatter: { draft: {ne: true} } @@ -297,35 +303,6 @@ exports.createPages = ({ graphql, actions }) => { }) }) - // Create guide pages. - const guides = result.data.allGuides.edges - guides.forEach(guide => { - if (guide.node.fields.guide_directory !== null) { - const previous = calculatePrevious(guide); - const next = calculateNext(guide); - const template = calculateTemplate(guide.node, "guide") - createPage({ - path: guide.node.fields.slug, - component: path.resolve(`./src/templates/${template}.js`), - context: { - slug: guide.node.fields.slug, - guide_directory: guide.node.fields.guide_directory, - previous, - next - }, - }) - } else { - const template = calculateTemplate(guide.node, "doc") - createPage({ - path: guide.node.fields.slug, - component: path.resolve(`./src/templates/${template}.js`), - context: { - slug: guide.node.fields.slug, - }, - }) - } - }) - // Create changelog pages. const changelogs = result.data.allChangelogs.edges changelogs.forEach(changelog => { @@ -360,21 +337,6 @@ exports.createPages = ({ graphql, actions }) => { }) - // Create Terminus Command pages - const terminusCommands = result.data.dataJson.commands - terminusCommands.forEach(command => { - const slugRegExp = /:/g - const slug = command.name.replace(slugRegExp, "-") - createPage({ - path: `terminus/commands/${slug}`, - component: path.resolve(`./src/templates/terminusCommand.js`), - context: { - slug: slug, - name: command.name - } - }) - }) - // Create changelog pagination. const postsPerPage = 6 const numPages = Math.ceil(changelogs.length / postsPerPage) @@ -398,14 +360,14 @@ exports.createPages = ({ graphql, actions }) => { // Create changelog pagination. const ReleaseNotesPerPage = 6 - const numberOfReleaseNotePages = Math.ceil(changelogs.length / ReleaseNotesPerPage) + const numberOfReleaseNotePages = Math.ceil(releaseNotes.length / ReleaseNotesPerPage) Array.from({ length: numberOfReleaseNotePages }).forEach((_, i) => { const currentPage = i + 1; const next = currentPage === 1 ? null : (currentPage === 2 ? `/release-notes/` : `/release-notes/page/${currentPage - 1}`); - const previous = currentPage < numberOfReleaseNotePages ? `/changelog/page/${currentPage + 1}` : null; + const previous = currentPage < numberOfReleaseNotePages ? `/release-notes/page/${currentPage + 1}` : null; createPage({ path: i === 0 ? `/release-notes/` : `/release-notes/page/${i + 1}`, - component: path.resolve("./src/templates/release-notes.js"), + component: path.resolve("./src/templates/releaseNotesListing.js"), context: { limit: ReleaseNotesPerPage, skip: i * ReleaseNotesPerPage, @@ -417,6 +379,26 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // Create releasenotes pagination. + Array.from({ length: numPages }).forEach((_, i) => { + const currentPage = i + 1; + const next = currentPage === 1 ? null : (currentPage === 2 ? `/releasenotes/` : `/releasenotes/page/${currentPage - 1}`); + const previous = currentPage < numPages ? `/releasenotes/page/${currentPage + 1}` : null; + createPage({ + path: i === 0 ? `/releasenotes/` : `/releasenotes/page/${i + 1}`, + component: path.resolve("./src/templates/releaseNotesListing.js"), + context: { + limit: postsPerPage, + skip: i * postsPerPage, + numPages, + currentPage, + previous, + next + }, + }) + }) + + @@ -424,29 +406,7 @@ exports.createPages = ({ graphql, actions }) => { - // Create contributor pages. - const contributors = result.data.allContributorYaml.edges - contributors.forEach(contributor => { - createPage({ - path: `contributors/${contributor.node.yamlId}`, - component: path.resolve(`./src/templates/contributor.js`), - context: { - id: contributor.node.yamlId, - }, - }) - }) - // Create topics pages. - const topics = result.data.allLandingsYaml.edges - topics.forEach(topic => { - createPage({ - path: topic.node.path, - component: path.resolve(`./src/templates/landing.js`), - context: { - id: topic.node.id, - }, - }) - }) return null }) @@ -512,7 +472,7 @@ exports.onCreateNode = ({ node, getNode, actions }) => { } } - if (sourceInstanceName === 'changelogs') { + if (sourceInstanceName === 'changelogs' || sourceInstanceName === 'releasenotes') { const content = matter(node.internal.content, { excerpt: true, excerpt_separator: '' } ); const excerpt = content.excerpt || ""; diff --git a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md index 1597751f59..fb141c826e 100644 --- a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md +++ b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md @@ -6,3 +6,6 @@ publish_dated: "2023-11-02" # New Release Notes Structure Visibility into composer logs has been a top customer request. Now, if you need to debug a composer build failure due to an error, install the Terminus Composer Logs plugin on your machine to view more details. Upstream Update logs are also available. Installation instructions and command usage can be found here in the [plugin's GitHub repository](https://github.com/pantheon-systems/terminus-composer-logs-plugin). + + + diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 18f5e7c433..a34f2b2899 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -86,6 +86,7 @@ class ChangelogsTemplate extends React.Component { render() { const changelogs = this.props.data.allMdx.edges + console.log(changelogs) return (
-

Pantheon Changelog

+

Pantheon Release Notes

Sign up for the Pantheon Changelog Newsletter to receive a @@ -117,7 +118,9 @@ class ChangelogsTemplate extends React.Component {

{changelogs.map((changelog) => ( + +
WHAT
Date: Thu, 14 Dec 2023 13:53:32 -0600 Subject: [PATCH 07/63] releaseNotesListing --- gatsby-node.js | 29 ---------------------------- src/templates/releaseNotesListing.js | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index cb29cf7e21..8cc3c543ae 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -379,35 +379,6 @@ exports.createPages = ({ graphql, actions }) => { }) }) - // Create releasenotes pagination. - Array.from({ length: numPages }).forEach((_, i) => { - const currentPage = i + 1; - const next = currentPage === 1 ? null : (currentPage === 2 ? `/releasenotes/` : `/releasenotes/page/${currentPage - 1}`); - const previous = currentPage < numPages ? `/releasenotes/page/${currentPage + 1}` : null; - createPage({ - path: i === 0 ? `/releasenotes/` : `/releasenotes/page/${i + 1}`, - component: path.resolve("./src/templates/releaseNotesListing.js"), - context: { - limit: postsPerPage, - skip: i * postsPerPage, - numPages, - currentPage, - previous, - next - }, - }) - }) - - - - - - - - - - - return null }) } diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index a34f2b2899..8e396a794e 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -159,7 +159,7 @@ export const pageQuery = graphql` query Changelogs($skip: Int!, $limit: Int!) { allMdx( filter: { - fileAbsolutePath: { regex: "/changelogs/" } + fileAbsolutePath: { regex: "/releasenotes/" } frontmatter: { draft: { ne: true } } } sort: { fields: [fileAbsolutePath], order: DESC } From 1f7f50df981f1914d8c9d48f6ccd688b77ab62d2 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 14:00:54 -0600 Subject: [PATCH 08/63] bring back deleted stuff --- gatsby-node.js | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/gatsby-node.js b/gatsby-node.js index 8cc3c543ae..7b2c3bd0cc 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -303,6 +303,50 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // Create guide pages. + const guides = result.data.allGuides.edges + guides.forEach(guide => { + if (guide.node.fields.guide_directory !== null) { + const previous = calculatePrevious(guide); + const next = calculateNext(guide); + const template = calculateTemplate(guide.node, "guide") + createPage({ + path: guide.node.fields.slug, + component: path.resolve(`./src/templates/${template}.js`), + context: { + slug: guide.node.fields.slug, + guide_directory: guide.node.fields.guide_directory, + previous, + next + }, + }) + } else { + const template = calculateTemplate(guide.node, "doc") + createPage({ + path: guide.node.fields.slug, + component: path.resolve(`./src/templates/${template}.js`), + context: { + slug: guide.node.fields.slug, + }, + }) + } + }) + + // Create Terminus Command pages + const terminusCommands = result.data.dataJson.commands + terminusCommands.forEach(command => { + const slugRegExp = /:/g + const slug = command.name.replace(slugRegExp, "-") + createPage({ + path: `terminus/commands/${slug}`, + component: path.resolve(`./src/templates/terminusCommand.js`), + context: { + slug: slug, + name: command.name + } + }) + }) + // Create changelog pages. const changelogs = result.data.allChangelogs.edges changelogs.forEach(changelog => { @@ -379,6 +423,31 @@ exports.createPages = ({ graphql, actions }) => { }) }) + + // Create contributor pages. + const contributors = result.data.allContributorYaml.edges + contributors.forEach(contributor => { + createPage({ + path: `contributors/${contributor.node.yamlId}`, + component: path.resolve(`./src/templates/contributor.js`), + context: { + id: contributor.node.yamlId, + }, + }) + }) + + // Create topics pages. + const topics = result.data.allLandingsYaml.edges + topics.forEach(topic => { + createPage({ + path: topic.node.path, + component: path.resolve(`./src/templates/landing.js`), + context: { + id: topic.node.id, + }, + }) + }) + return null }) } From ef9e33b8856a8e7e4d7f2ebc5a0cf0cbee97c2e5 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 14:12:50 -0600 Subject: [PATCH 09/63] more progress on release notes --- gatsby-node.js | 10 +++++++--- .../2023-11-02-terminus-composer-logs-plugin.md | 3 --- .../2023-12-31-new-release-notes-structure.md | 2 -- src/templates/releaseNote.js | 17 ++--------------- src/templates/releaseNotesListing.js | 5 ++++- 5 files changed, 13 insertions(+), 24 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 7b2c3bd0cc..41d0d2f86b 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -35,7 +35,9 @@ const calculateSlug = (node, getNode) => { if (getNode(node.parent).absolutePath.includes("releasenotes")) { // If the file is in the releasenotes directory... const split = fileName.split('-'); // split the file name where hyphenated... // #todo, wait this should the slug should include all the words after the date, not just the first one. - return `releasenotes/${split[0]}/${split[1]}/${split[3]}${split[4]}` // and return a slug of releasenotes/YYYY/MM/slug + // set a const to remaining slug based on the keys from split that are not the date. + const remainingSlug = split.slice(3).join('-'); + return `releasenotes/${split[0]}/${split[1]}/${remainingSlug}` // and return a slug of releasenotes/YYYY/MM/slug } return `${fileName}` // Otherwise, as long as there is a filename in GraphQL, use it as the slug. @@ -402,7 +404,7 @@ exports.createPages = ({ graphql, actions }) => { }) }) - // Create changelog pagination. + // Create Release Note pagination. const ReleaseNotesPerPage = 6 const numberOfReleaseNotePages = Math.ceil(releaseNotes.length / ReleaseNotesPerPage) Array.from({ length: numberOfReleaseNotePages }).forEach((_, i) => { @@ -423,7 +425,6 @@ exports.createPages = ({ graphql, actions }) => { }) }) - // Create contributor pages. const contributors = result.data.allContributorYaml.edges contributors.forEach(contributor => { @@ -586,3 +587,6 @@ exports.onPreBootstrap = () => { fs.copySync(scriptsCopyFrom, scriptsCopyTo) } + + +/* todo should there be an error thrown if a release note category is set that is not allowed */ diff --git a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md index fb141c826e..3e6f02f80b 100644 --- a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md +++ b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md @@ -3,9 +3,6 @@ title: Terminus Composer Logs Plugin 1.0.0 Released publish_dated: "2023-11-02" --- -# New Release Notes Structure Visibility into composer logs has been a top customer request. Now, if you need to debug a composer build failure due to an error, install the Terminus Composer Logs plugin on your machine to view more details. Upstream Update logs are also available. Installation instructions and command usage can be found here in the [plugin's GitHub repository](https://github.com/pantheon-systems/terminus-composer-logs-plugin). - - diff --git a/source/releasenotes/2023-12-31-new-release-notes-structure.md b/source/releasenotes/2023-12-31-new-release-notes-structure.md index 08db16388e..5aea1aa516 100644 --- a/source/releasenotes/2023-12-31-new-release-notes-structure.md +++ b/source/releasenotes/2023-12-31-new-release-notes-structure.md @@ -3,8 +3,6 @@ title: New Release Notes Structure publish_dated: "2023-12-31" --- -# New Release Notes Structure - For nearly a decade, we have published a monthly "changelog" here within our Documentation site that summarizes significant changes to the platform. Going forward in 2024 we are changing some of the details of how we publish and organize this information. diff --git a/src/templates/releaseNote.js b/src/templates/releaseNote.js index 86394e0e92..9e3334dee6 100644 --- a/src/templates/releaseNote.js +++ b/src/templates/releaseNote.js @@ -85,23 +85,10 @@ class ChangelogTemplate extends React.Component {
- Pantheon Changelog + Pantheon Release Notes

{node.frontmatter.title}

-
-

- Sign up for the Pantheon Changelog Newsletter to receive a - monthly email on what's new and improved across the platform. -

- - Subscribe Now - - -
+
diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 8e396a794e..80f6ad1443 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -102,6 +102,7 @@ class ChangelogsTemplate extends React.Component { Sign up for the Pantheon Changelog Newsletter to receive a monthly email on what's new and improved across the platform.

+ todo link to somewhere other than Pantheon learning.

( -
WHAT
+
HELLO
{changelog.node.frontmatter.title} + test {changelog.node.body} @@ -155,6 +157,7 @@ class ChangelogsTemplate extends React.Component { export default ChangelogsTemplate +/* todo remove draft filter from query */ export const pageQuery = graphql` query Changelogs($skip: Int!, $limit: Int!) { allMdx( From b382559c351439fa67a466bf5c197630f65f4a35 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 14:15:08 -0600 Subject: [PATCH 10/63] adding a note --- .../releasenotes/2023-11-02-terminus-composer-logs-plugin.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md index 3e6f02f80b..364708b784 100644 --- a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md +++ b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md @@ -6,3 +6,6 @@ publish_dated: "2023-11-02" Visibility into composer logs has been a top customer request. Now, if you need to debug a composer build failure due to an error, install the Terminus Composer Logs plugin on your machine to view more details. Upstream Update logs are also available. Installation instructions and command usage can be found here in the [plugin's GitHub repository](https://github.com/pantheon-systems/terminus-composer-logs-plugin). + + +TODO: Does this note belong in "action required?" Not every customer needs to do something. Only those who want to use the plugin. From 8a4d7e002d8e315e5d23c9cae79ce0fef06a7a8e Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 14:31:57 -0600 Subject: [PATCH 11/63] updates --- source/releasenotes/2023-08-18-php-security-updates.md | 9 +++++++++ .../releasenotes/2023-09-20-drupal-sa-core-2023-006.md | 9 +++++++++ source/releasenotes/2023-09-30-docs-design-system.md | 9 +++++++++ .../2023-10-31-front-end-sites-build-caching.md | 9 +++++++++ 4 files changed, 36 insertions(+) create mode 100644 source/releasenotes/2023-08-18-php-security-updates.md create mode 100644 source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md create mode 100644 source/releasenotes/2023-09-30-docs-design-system.md create mode 100644 source/releasenotes/2023-10-31-front-end-sites-build-caching.md diff --git a/source/releasenotes/2023-08-18-php-security-updates.md b/source/releasenotes/2023-08-18-php-security-updates.md new file mode 100644 index 0000000000..c68aed056a --- /dev/null +++ b/source/releasenotes/2023-08-18-php-security-updates.md @@ -0,0 +1,9 @@ +--- +title: "PHP Security Updates" +publish_dated: "2023-08-18" +--- + + +Pantheon has deployed PHP versions [8.2.9](https://www.php.net/ChangeLog-8.php#8.2.9), [8.1.22](https://www.php.net/ChangeLog-8.php#8.1.22), and [8.0.30](https://www.php.net/ChangeLog-8.php#8.0.30) to customer sites running on the platform. These releases address vulnerabilities disclosed in [CVE-2023-3823](https://nvd.nist.gov/vuln/detail/CVE-2023-3823) and [CVE-2023-3824](https://nvd.nist.gov/vuln/detail/CVE-2023-3824). + +If you are using PHP 8.2, 8.1 or 8.0, there is nothing further that you need to do. If you are still on PHP 7.4 or earlier, though, you should schedule some time to upgrade to a supported version.While the vulnerabilities patched in these latest releases are not reported to affect PHP 7.4, the fact remains that there could be (and probably are) unpatched vulnerabilities in the end-of-life versions. Read more about it in Greg Anderson’s [blog post](https://pantheon.io/blog/php-829-security-release-demonstrates-pantheons-commitment-protecting-your-sites). diff --git a/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md new file mode 100644 index 0000000000..fa8be8f92e --- /dev/null +++ b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md @@ -0,0 +1,9 @@ +--- +title: "Drupal Security Update: SA Core 2023-006" +publish_dated: "2023-09-20" +--- + + +On September 20th, [Drupal core updates were released to address a critical vulnerability in the JSON:API module](https://status.pantheon.io/incidents/vj842n7k7w40). Those updates became immediately available within the Pantheon dashboard for one-click code updates. Additionally, [our engineers updated our CDN to mitigate potential attacks](https://status.pantheon.io/incidents/598zxv2v8l7p). + +If you have a Drupal site using JSON:API we suggest you update as soon as possible if you haven't done so already. And even if you aren't using JSON:API, it'll still feel good to apply an update, right? To better understand the nature of security updates, [come watch the Pantheon YouTube Livestream on October 25th](https://www.youtube.com/watch?v=WV2ZSeBOziU). diff --git a/source/releasenotes/2023-09-30-docs-design-system.md b/source/releasenotes/2023-09-30-docs-design-system.md new file mode 100644 index 0000000000..4cb3fffb13 --- /dev/null +++ b/source/releasenotes/2023-09-30-docs-design-system.md @@ -0,0 +1,9 @@ +--- +title: Documentation Site Updated with the Design System +publish_dated: "2023-09-30" +--- + + +We're excited to announce that our documentation site has been seamlessly integrated with our brand-new design system. This enhancement brings a fresh and cohesive look to our documentation, providing a unified and visually appealing experience for our users. Explore the updated, improved, and more accessible [Docs site](/) today. + +![Docs Design System](../images/DocsDesignSystem.png) diff --git a/source/releasenotes/2023-10-31-front-end-sites-build-caching.md b/source/releasenotes/2023-10-31-front-end-sites-build-caching.md new file mode 100644 index 0000000000..c57850e874 --- /dev/null +++ b/source/releasenotes/2023-10-31-front-end-sites-build-caching.md @@ -0,0 +1,9 @@ +--- +title: Front-End Build Site Caching +publish_dated: "2023-10-31" +--- + +Pantheon introduced a new build pipeline for Front End Sites to significantly improve build times. Beginning on November 13th, 2023, newly created sites are automatically using the new pipeline and cannot opt back to the old pipeline. Sites made prior to that date can opt-in to the new pipeline to take advantage of the new features. All pre-existing sites that do not opt-in will be switched over for new builds on or around January 15th. + +Additionally, we are adding support for Node 18 (for dynamic sites) and 20 (for both static and dynamic sites). To select a specific version, Pantheon is [moving away from using .nvmrc](/guides/decoupled/overview/manage-settings#nodejs-version) and will instead look to the [“engines” field](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#engines) in your project’s `package.json` file. + From 1c64f89d351ccccb4a83feee781a9239a7f12af4 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 14:34:29 -0600 Subject: [PATCH 12/63] release notes --- .../2023-08-08-pantheon-advanced-page-cache-1-4-1.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md diff --git a/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md b/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md new file mode 100644 index 0000000000..632c05cc4f --- /dev/null +++ b/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md @@ -0,0 +1,9 @@ +--- +title: "Pantheon Advanced Page Cache WordPress Plugin Updates" +publish_dated: "2023-08-08" +--- + + +We released an update for the [Pantheon Advanced Page Cache](https://wordpress.org/plugins/pantheon-advanced-page-cache/) WordPress plugin which adds a filter to allow disabling surrogate keys for posts' taxonomy terms. This can be especially helpful for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes). + +For more information, see [Pantheon documentation](/guides/wordpress-configurations/plugins#disable-surrogate-keys-for-taxonomy-terms). From a86b85e1c47da770357e5985762b5e32b725b18b Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 16:33:34 -0600 Subject: [PATCH 13/63] getting categories partially working --- gatsby-node.js | 3 ++- .../2023-11-02-terminus-composer-logs-plugin.md | 1 + .../releasenotes/2023-12-31-new-release-notes-structure.md | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 41d0d2f86b..64c11cb4b7 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -209,7 +209,8 @@ exports.createPages = ({ graphql, actions }) => { node { id frontmatter { - title + title, + categories } fields { slug diff --git a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md index 364708b784..e64946de44 100644 --- a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md +++ b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md @@ -9,3 +9,4 @@ Visibility into composer logs has been a top customer request. Now, if you need TODO: Does this note belong in "action required?" Not every customer needs to do something. Only those who want to use the plugin. +After discussion with Ingrid, no this would not get "Action required". because that should only be used for things that would disrupt. diff --git a/source/releasenotes/2023-12-31-new-release-notes-structure.md b/source/releasenotes/2023-12-31-new-release-notes-structure.md index 5aea1aa516..540328730f 100644 --- a/source/releasenotes/2023-12-31-new-release-notes-structure.md +++ b/source/releasenotes/2023-12-31-new-release-notes-structure.md @@ -1,6 +1,7 @@ --- title: New Release Notes Structure publish_dated: "2023-12-31" +categories: [security, anothercat] --- For nearly a decade, we have published a monthly "changelog" here within our Documentation site that summarizes significant changes to the platform. @@ -12,6 +13,6 @@ This switch will support more proactive communication and ensure that any notewo Here you will find: * A listing of all Release Notes at docs.pantheon.io/release-notes -* A listing of Release Notes by category like docs.pantheon.io/release-notes/infrastructure -* A month-by-month breakdown of all Release Notes like docs.pantheon.io/release-notes/all/2023-12 (todo or should it be docs.pantheon.io/release-notes/all/2023/12) -* A month-by-month breakdown of Release Notes by catetory and month like docs.pantheon.io/release-notes/infrastructure/2023-12 +* A listing of Release Notes by category (WordPress, Drupal, etc) like docs.pantheon.io/release-notes/infrastructure + + From 192086452f8cd20e742f376ab0ecdd75b50f60de Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 17:23:32 -0600 Subject: [PATCH 14/63] starting on a separate category component --- gatsby-node.js | 6 +- ...8-08-pantheon-advanced-page-cache-1-4-1.md | 2 +- .../2023-08-18-php-security-updates.md | 2 +- .../2023-09-20-drupal-sa-core-2023-006.md | 2 +- .../2023-09-30-docs-design-system.md | 2 +- ...023-10-31-front-end-sites-build-caching.md | 2 +- ...023-11-02-terminus-composer-logs-plugin.md | 2 +- .../2023-12-31-new-release-notes-structure.md | 2 +- src/components/releaseNoteCategories.js | 24 +++++++ src/templates/releaseNotesListing.js | 65 ++++++++++--------- 10 files changed, 72 insertions(+), 37 deletions(-) create mode 100644 src/components/releaseNoteCategories.js diff --git a/gatsby-node.js b/gatsby-node.js index 64c11cb4b7..d74e541f3b 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -210,7 +210,8 @@ exports.createPages = ({ graphql, actions }) => { id frontmatter { title, - categories + categories, + published_date } fields { slug @@ -524,6 +525,7 @@ exports.onCreateNode = ({ node, getNode, actions }) => { value: excerpt, }) + const textNode = { id: `${node.id}-MarkdownBody`, parent: node.id, @@ -591,3 +593,5 @@ exports.onPreBootstrap = () => { /* todo should there be an error thrown if a release note category is set that is not allowed */ +/* todo, infer published date from file name. And throw an error if there are files that don't follow the pattern. */ +/* todo, make a json file of allowed categories, description of the category, color name */ diff --git a/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md b/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md index 632c05cc4f..e9c4ad53f0 100644 --- a/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md +++ b/source/releasenotes/2023-08-08-pantheon-advanced-page-cache-1-4-1.md @@ -1,6 +1,6 @@ --- title: "Pantheon Advanced Page Cache WordPress Plugin Updates" -publish_dated: "2023-08-08" +published_date: "2023-08-08" --- diff --git a/source/releasenotes/2023-08-18-php-security-updates.md b/source/releasenotes/2023-08-18-php-security-updates.md index c68aed056a..eff44cf27d 100644 --- a/source/releasenotes/2023-08-18-php-security-updates.md +++ b/source/releasenotes/2023-08-18-php-security-updates.md @@ -1,6 +1,6 @@ --- title: "PHP Security Updates" -publish_dated: "2023-08-18" +published_date: "2023-08-18" --- diff --git a/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md index fa8be8f92e..c6e6cb29a7 100644 --- a/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md +++ b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md @@ -1,6 +1,6 @@ --- title: "Drupal Security Update: SA Core 2023-006" -publish_dated: "2023-09-20" +published_date: "2023-09-20" --- diff --git a/source/releasenotes/2023-09-30-docs-design-system.md b/source/releasenotes/2023-09-30-docs-design-system.md index 4cb3fffb13..77b9335c2d 100644 --- a/source/releasenotes/2023-09-30-docs-design-system.md +++ b/source/releasenotes/2023-09-30-docs-design-system.md @@ -1,6 +1,6 @@ --- title: Documentation Site Updated with the Design System -publish_dated: "2023-09-30" +published_date: "2023-09-30" --- diff --git a/source/releasenotes/2023-10-31-front-end-sites-build-caching.md b/source/releasenotes/2023-10-31-front-end-sites-build-caching.md index c57850e874..4dc7f828b7 100644 --- a/source/releasenotes/2023-10-31-front-end-sites-build-caching.md +++ b/source/releasenotes/2023-10-31-front-end-sites-build-caching.md @@ -1,6 +1,6 @@ --- title: Front-End Build Site Caching -publish_dated: "2023-10-31" +published_date: "2023-10-31" --- Pantheon introduced a new build pipeline for Front End Sites to significantly improve build times. Beginning on November 13th, 2023, newly created sites are automatically using the new pipeline and cannot opt back to the old pipeline. Sites made prior to that date can opt-in to the new pipeline to take advantage of the new features. All pre-existing sites that do not opt-in will be switched over for new builds on or around January 15th. diff --git a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md index e64946de44..2ce0d8b346 100644 --- a/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md +++ b/source/releasenotes/2023-11-02-terminus-composer-logs-plugin.md @@ -1,6 +1,6 @@ --- title: Terminus Composer Logs Plugin 1.0.0 Released -publish_dated: "2023-11-02" +published_date: "2023-11-02" --- diff --git a/source/releasenotes/2023-12-31-new-release-notes-structure.md b/source/releasenotes/2023-12-31-new-release-notes-structure.md index 540328730f..441ba884eb 100644 --- a/source/releasenotes/2023-12-31-new-release-notes-structure.md +++ b/source/releasenotes/2023-12-31-new-release-notes-structure.md @@ -1,6 +1,6 @@ --- title: New Release Notes Structure -publish_dated: "2023-12-31" +published_date: "2023-12-31" categories: [security, anothercat] --- diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js new file mode 100644 index 0000000000..959e9aa0ba --- /dev/null +++ b/src/components/releaseNoteCategories.js @@ -0,0 +1,24 @@ +import React from "react" + +const ReleaseNoteCategories = ({categories}) => { + +console.log(categories); + +if (!categories) { + return null +} + + return ( +
+ {categories.map((category, index) => ( +
+

{category}

+
+ )) + } +
+ + ) +} + +export default ReleaseNoteCategories diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 80f6ad1443..221a963227 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -19,6 +19,7 @@ import SEO from "../layout/seo" import Enablement from "../components/enablement" import Color from "../components/color.js" import Download from "../components/download" +import ReleaseNoteCategories from "../components/releaseNoteCategories" import { @@ -32,7 +33,6 @@ import { Container, Icon, Pager, - SidebarLayout, } from "@pantheon-systems/pds-toolkit-react" const shortcodes = { @@ -87,6 +87,7 @@ class ChangelogsTemplate extends React.Component { render() { const changelogs = this.props.data.allMdx.edges console.log(changelogs) + console.log(changelogs[0].node.frontmatter.categories) return (

- -
-
-
-
- {changelogs.map((changelog) => ( - - -
HELLO
- -

- {changelog.node.frontmatter.title} -

- test - - - {changelog.node.body} - -
- ))} -
-
+
+
+
+ {changelogs.map((changelog) => ( + + + +
HELLO
+ +

+ {changelog.node.frontmatter.title} +

+ + + Todo, transform to date format

+ {changelog.node.frontmatter.published_date} + + Maybe + + + + + {changelog.node.body} + +
+ ))}
- - +
+ Date: Thu, 14 Dec 2023 17:38:38 -0600 Subject: [PATCH 15/63] more release notes cleanup --- .../2023-09-20-drupal-sa-core-2023-006.md | 1 + src/components/releaseNoteCategories.js | 8 +++++- src/templates/releaseNote.js | 26 ++++++------------- src/templates/releaseNotesListing.js | 1 - 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md index c6e6cb29a7..a82127adcf 100644 --- a/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md +++ b/source/releasenotes/2023-09-20-drupal-sa-core-2023-006.md @@ -1,6 +1,7 @@ --- title: "Drupal Security Update: SA Core 2023-006" published_date: "2023-09-20" +categories: [security] --- diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index 959e9aa0ba..e3135e517e 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -10,9 +10,15 @@ if (!categories) { return (
+{/* If there is one category display the singular form. */ + categories.length === 1 + ?

Category:

+ :

Categories:

+} + {categories.map((category, index) => (
-

{category}

+

{category}

)) } diff --git a/src/templates/releaseNote.js b/src/templates/releaseNote.js index 9e3334dee6..ed531080af 100644 --- a/src/templates/releaseNote.js +++ b/src/templates/releaseNote.js @@ -18,6 +18,7 @@ import SEO from "../layout/seo" import Enablement from "../components/enablement" import Color from "../components/color.js" import Download from "../components/download" +import ReleaseNoteCategories from "../components/releaseNoteCategories" import { @@ -44,7 +45,7 @@ const shortcodes = { // Set container width for search and main content. const containerWidth = "standard" -class ChangelogTemplate extends React.Component { +class ReleaseNoteTemplate extends React.Component { componentDidMount() { $("[data-toggle=popover]").popover({ trigger: "click", @@ -88,6 +89,7 @@ class ChangelogTemplate extends React.Component { Pantheon Release Notes

{node.frontmatter.title}

+
@@ -99,6 +101,7 @@ class ChangelogTemplate extends React.Component {
+ {node.body} @@ -106,22 +109,7 @@ class ChangelogTemplate extends React.Component {
- -
@@ -129,7 +117,7 @@ class ChangelogTemplate extends React.Component { } } -export default ChangelogTemplate +export default ReleaseNoteTemplate export const pageQuery = graphql` query ChangelogBySlug($slug: String!) { @@ -140,7 +128,9 @@ export const pageQuery = graphql` slug } frontmatter { - title + title, + published_date, + categories } } } diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 221a963227..0493e38619 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -121,7 +121,6 @@ class ChangelogsTemplate extends React.Component { -
HELLO
Date: Thu, 14 Dec 2023 17:42:37 -0600 Subject: [PATCH 16/63] listing all --- src/templates/releaseNotesListing.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 0493e38619..f4351c3ffb 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -57,7 +57,7 @@ const shortcodes = { const containerWidth = "standard" // Combined changelog template. -class ChangelogsTemplate extends React.Component { +class ReleaseNotesListingTemplate extends React.Component { componentDidMount() { $("[data-toggle=popover]").popover({ trigger: "click", @@ -159,19 +159,16 @@ class ChangelogsTemplate extends React.Component { } } -export default ChangelogsTemplate +export default ReleaseNotesListingTemplate /* todo remove draft filter from query */ export const pageQuery = graphql` - query Changelogs($skip: Int!, $limit: Int!) { + query Changelogs { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } - frontmatter: { draft: { ne: true } } } sort: { fields: [fileAbsolutePath], order: DESC } - skip: $skip - limit: $limit ) { edges { node { From b2319aaebf0f7d86aa5736218c7cae98663caff2 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 18:09:14 -0600 Subject: [PATCH 17/63] category listing --- gatsby-node.js | 37 ++-- .../2023-12-31-new-release-notes-structure.md | 2 +- src/components/releaseNoteCategories.js | 11 +- src/templates/releaseNotesListing.js | 3 +- .../releaseNotesListingByCategory.js | 190 ++++++++++++++++++ 5 files changed, 226 insertions(+), 17 deletions(-) create mode 100644 src/templates/releaseNotesListingByCategory.js diff --git a/gatsby-node.js b/gatsby-node.js index d74e541f3b..fca7cc8428 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -406,27 +406,36 @@ exports.createPages = ({ graphql, actions }) => { }) }) - // Create Release Note pagination. - const ReleaseNotesPerPage = 6 - const numberOfReleaseNotePages = Math.ceil(releaseNotes.length / ReleaseNotesPerPage) - Array.from({ length: numberOfReleaseNotePages }).forEach((_, i) => { - const currentPage = i + 1; - const next = currentPage === 1 ? null : (currentPage === 2 ? `/release-notes/` : `/release-notes/page/${currentPage - 1}`); - const previous = currentPage < numberOfReleaseNotePages ? `/release-notes/page/${currentPage + 1}` : null; + // Create release notes without pagination. At a later date, we may want to add pagination. + // And can reused the code above. createPage({ - path: i === 0 ? `/release-notes/` : `/release-notes/page/${i + 1}`, + path: `/release-notes/`, component: path.resolve("./src/templates/releaseNotesListing.js"), + }) + + const allowedReleaseNoteCategories = { + "security": { + "Display Name": "Security", + "color": "red" + }, + "documentation": { + "Display Name": "Documentation", + "color": "purple" + }, + }; + + // Loop through all allowed categories and create a page for each one. + Object.keys(allowedReleaseNoteCategories).forEach((category) => { + createPage({ + path: `/release-notes/${category}`, + component: path.resolve("./src/templates/releaseNotesListingByCategory.js"), context: { - limit: ReleaseNotesPerPage, - skip: i * ReleaseNotesPerPage, - numberOfReleaseNotePages, - currentPage, - previous, - next + category: category, }, }) }) + // Create contributor pages. const contributors = result.data.allContributorYaml.edges contributors.forEach(contributor => { diff --git a/source/releasenotes/2023-12-31-new-release-notes-structure.md b/source/releasenotes/2023-12-31-new-release-notes-structure.md index 441ba884eb..4dc4cb5381 100644 --- a/source/releasenotes/2023-12-31-new-release-notes-structure.md +++ b/source/releasenotes/2023-12-31-new-release-notes-structure.md @@ -1,7 +1,7 @@ --- title: New Release Notes Structure published_date: "2023-12-31" -categories: [security, anothercat] +categories: [security, documentation] --- For nearly a decade, we have published a monthly "changelog" here within our Documentation site that summarizes significant changes to the platform. diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index e3135e517e..d9315937eb 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -1,4 +1,5 @@ import React from "react" +import { Link } from "gatsby" const ReleaseNoteCategories = ({categories}) => { @@ -18,7 +19,15 @@ if (!categories) { {categories.map((category, index) => (
-

{category}

+ + +

{category}

+ + + +
)) } diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index f4351c3ffb..ec5927e288 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -163,10 +163,11 @@ export default ReleaseNotesListingTemplate /* todo remove draft filter from query */ export const pageQuery = graphql` - query Changelogs { + query Changelogs($category: String!) { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } + frontmatter: { categories: {eq: $category}} } sort: { fields: [fileAbsolutePath], order: DESC } ) { diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js new file mode 100644 index 0000000000..e7436942b4 --- /dev/null +++ b/src/templates/releaseNotesListingByCategory.js @@ -0,0 +1,190 @@ +import React from "react" +import { graphql, Link } from "gatsby" +import { MDXRenderer } from "gatsby-plugin-mdx" +import { MDXProvider } from "@mdx-js/react" + +import Layout from "../layout/layout" +import NavButtons from "../components/navButtons" +import Callout from "../components/callout" +import Alert from "../components/alert" +import Accordion from "../components/accordion" +import ExternalLink from "../components/externalLink" +import Popover from "../components/popover" +import TabList from "../components/tabList" +import Tab from "../components/tab" +import TOC from "../components/toc" +import Card from "../components/card" +import CardGroup from "../components/cardGroup" +import SEO from "../layout/seo" +import Enablement from "../components/enablement" +import Color from "../components/color.js" +import Download from "../components/download" +import ReleaseNoteCategories from "../components/releaseNoteCategories" + + +import { + headline1, + headline2, + headline3, + headline4, +} from "../components/releaseHeadlines" + +import { + Container, + Icon, + Pager, +} from "@pantheon-systems/pds-toolkit-react" + +const shortcodes = { + Callout, + Alert, + Accordion, + ExternalLink, + Popover, + TabList, + Tab, + Card, + CardGroup, + Enablement, + Color, + Download, + h1: headline2, + h2: headline3, + h3: headline4, +} + +// Set container width for search and main content. +const containerWidth = "standard" + +// Combined changelog template. +class ReleaseNotesListingByCategoryTemplate extends React.Component { + componentDidMount() { + $("[data-toggle=popover]").popover({ + trigger: "click", + }) + + $("body").on("click", function (e) { + $('[data-toggle="popover"]').each(function () { + if ( + !$(this).is(e.target) && + $(this).has(e.target).length === 0 && + $(".popover").has(e.target).length === 0 + ) { + $(this).popover("hide") + } + }) + }) + + $("body").keyup(function (e) { + $('[data-toggle="popover"]').each(function () { + if (event.which === 27) { + $(this).popover("hide") + } + }) + }) + } + + render() { + const changelogs = this.props.data.allMdx.edges + console.log(changelogs) + console.log(changelogs[0].node.frontmatter.categories) + return ( + + +
+ +

Pantheon Release Notes

+
+
+
+
+
+ {changelogs.map((changelog) => ( + + + + +

+ {changelog.node.frontmatter.title} +

+ + + Todo, transform to date format

+ {changelog.node.frontmatter.published_date} + + Maybe + + + + + {changelog.node.body} + +
+ ))} +
+
+
+ + + +
+ + ) + } +} + +export default ReleaseNotesListingByCategoryTemplate + +/* todo remove draft filter from query */ +export const pageQuery = graphql` + query Changelogs($category: String!) { + allMdx( + filter: { + fileAbsolutePath: { regex: "/releasenotes/" } + frontmatter: { categories: {eq: $category}} + } + sort: { fields: [fileAbsolutePath], order: DESC } + ) { + edges { + node { + id + body + frontmatter { + title, + published_date, + categories, + } + fields { + slug + } + } + } + } + } +` From 3e0d46c137390aba12bd765212d9600f9e9c2ba8 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 14 Dec 2023 18:15:32 -0600 Subject: [PATCH 18/63] moar templating --- src/templates/releaseNotesListing.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index ec5927e288..f4351c3ffb 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -163,11 +163,10 @@ export default ReleaseNotesListingTemplate /* todo remove draft filter from query */ export const pageQuery = graphql` - query Changelogs($category: String!) { + query Changelogs { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } - frontmatter: { categories: {eq: $category}} } sort: { fields: [fileAbsolutePath], order: DESC } ) { From 016065f585761f3baa9c6f7522a80ccdde38601e Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Mon, 18 Dec 2023 13:04:20 -0600 Subject: [PATCH 19/63] getting tests passing --- src/templates/releaseNotesListing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index f4351c3ffb..11d6526236 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -91,8 +91,8 @@ class ReleaseNotesListingTemplate extends React.Component { return (
From 7e7e457750af69e64053716e8942b68fd5d76118 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Mon, 18 Dec 2023 13:04:43 -0600 Subject: [PATCH 20/63] adding playwright examples --- tests/.github/workflows/playwright.yml | 27 ++ tests/.gitignore | 5 + tests/package-lock.json | 91 +++++ tests/package.json | 14 + tests/playwright.config.ts | 77 ++++ tests/tests-examples/demo-todo-app.spec.ts | 437 +++++++++++++++++++++ tests/tests/example.spec.ts | 19 + 7 files changed, 670 insertions(+) create mode 100644 tests/.github/workflows/playwright.yml create mode 100644 tests/.gitignore create mode 100644 tests/package-lock.json create mode 100644 tests/package.json create mode 100644 tests/playwright.config.ts create mode 100644 tests/tests-examples/demo-todo-app.spec.ts create mode 100644 tests/tests/example.spec.ts diff --git a/tests/.github/workflows/playwright.yml b/tests/.github/workflows/playwright.yml new file mode 100644 index 0000000000..90b6b700d4 --- /dev/null +++ b/tests/.github/workflows/playwright.yml @@ -0,0 +1,27 @@ +name: Playwright Tests +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: npm ci + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000000..68c5d18f00 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/tests/package-lock.json b/tests/package-lock.json new file mode 100644 index 0000000000..36ee107cd4 --- /dev/null +++ b/tests/package-lock.json @@ -0,0 +1,91 @@ +{ + "name": "tests", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tests", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@playwright/test": "^1.40.1", + "@types/node": "^20.10.5" + } + }, + "node_modules/@playwright/test": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "dev": true, + "dependencies": { + "playwright": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@types/node": { + "version": "20.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", + "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "dev": true, + "dependencies": { + "playwright-core": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + } + } +} diff --git a/tests/package.json b/tests/package.json new file mode 100644 index 0000000000..9d001443e4 --- /dev/null +++ b/tests/package.json @@ -0,0 +1,14 @@ +{ + "name": "tests", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": {}, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@playwright/test": "^1.40.1", + "@types/node": "^20.10.5" + } +} diff --git a/tests/playwright.config.ts b/tests/playwright.config.ts new file mode 100644 index 0000000000..301801ee1d --- /dev/null +++ b/tests/playwright.config.ts @@ -0,0 +1,77 @@ +import { defineConfig, devices } from '@playwright/test'; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './tests', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + // baseURL: 'http://127.0.0.1:3000', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://127.0.0.1:3000', + // reuseExistingServer: !process.env.CI, + // }, +}); diff --git a/tests/tests-examples/demo-todo-app.spec.ts b/tests/tests-examples/demo-todo-app.spec.ts new file mode 100644 index 0000000000..2fd6016fe8 --- /dev/null +++ b/tests/tests-examples/demo-todo-app.spec.ts @@ -0,0 +1,437 @@ +import { test, expect, type Page } from '@playwright/test'; + +test.beforeEach(async ({ page }) => { + await page.goto('https://demo.playwright.dev/todomvc'); +}); + +const TODO_ITEMS = [ + 'buy some cheese', + 'feed the cat', + 'book a doctors appointment' +]; + +test.describe('New Todo', () => { + test('should allow me to add todo items', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + // Create 1st todo. + await newTodo.fill(TODO_ITEMS[0]); + await newTodo.press('Enter'); + + // Make sure the list only has one todo item. + await expect(page.getByTestId('todo-title')).toHaveText([ + TODO_ITEMS[0] + ]); + + // Create 2nd todo. + await newTodo.fill(TODO_ITEMS[1]); + await newTodo.press('Enter'); + + // Make sure the list now has two todo items. + await expect(page.getByTestId('todo-title')).toHaveText([ + TODO_ITEMS[0], + TODO_ITEMS[1] + ]); + + await checkNumberOfTodosInLocalStorage(page, 2); + }); + + test('should clear text input field when an item is added', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + // Create one todo item. + await newTodo.fill(TODO_ITEMS[0]); + await newTodo.press('Enter'); + + // Check that input is empty. + await expect(newTodo).toBeEmpty(); + await checkNumberOfTodosInLocalStorage(page, 1); + }); + + test('should append new items to the bottom of the list', async ({ page }) => { + // Create 3 items. + await createDefaultTodos(page); + + // create a todo count locator + const todoCount = page.getByTestId('todo-count') + + // Check test using different methods. + await expect(page.getByText('3 items left')).toBeVisible(); + await expect(todoCount).toHaveText('3 items left'); + await expect(todoCount).toContainText('3'); + await expect(todoCount).toHaveText(/3/); + + // Check all items in one call. + await expect(page.getByTestId('todo-title')).toHaveText(TODO_ITEMS); + await checkNumberOfTodosInLocalStorage(page, 3); + }); +}); + +test.describe('Mark all as completed', () => { + test.beforeEach(async ({ page }) => { + await createDefaultTodos(page); + await checkNumberOfTodosInLocalStorage(page, 3); + }); + + test.afterEach(async ({ page }) => { + await checkNumberOfTodosInLocalStorage(page, 3); + }); + + test('should allow me to mark all items as completed', async ({ page }) => { + // Complete all todos. + await page.getByLabel('Mark all as complete').check(); + + // Ensure all todos have 'completed' class. + await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); + await checkNumberOfCompletedTodosInLocalStorage(page, 3); + }); + + test('should allow me to clear the complete state of all items', async ({ page }) => { + const toggleAll = page.getByLabel('Mark all as complete'); + // Check and then immediately uncheck. + await toggleAll.check(); + await toggleAll.uncheck(); + + // Should be no completed classes. + await expect(page.getByTestId('todo-item')).toHaveClass(['', '', '']); + }); + + test('complete all checkbox should update state when items are completed / cleared', async ({ page }) => { + const toggleAll = page.getByLabel('Mark all as complete'); + await toggleAll.check(); + await expect(toggleAll).toBeChecked(); + await checkNumberOfCompletedTodosInLocalStorage(page, 3); + + // Uncheck first todo. + const firstTodo = page.getByTestId('todo-item').nth(0); + await firstTodo.getByRole('checkbox').uncheck(); + + // Reuse toggleAll locator and make sure its not checked. + await expect(toggleAll).not.toBeChecked(); + + await firstTodo.getByRole('checkbox').check(); + await checkNumberOfCompletedTodosInLocalStorage(page, 3); + + // Assert the toggle all is checked again. + await expect(toggleAll).toBeChecked(); + }); +}); + +test.describe('Item', () => { + + test('should allow me to mark items as complete', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + // Create two items. + for (const item of TODO_ITEMS.slice(0, 2)) { + await newTodo.fill(item); + await newTodo.press('Enter'); + } + + // Check first item. + const firstTodo = page.getByTestId('todo-item').nth(0); + await firstTodo.getByRole('checkbox').check(); + await expect(firstTodo).toHaveClass('completed'); + + // Check second item. + const secondTodo = page.getByTestId('todo-item').nth(1); + await expect(secondTodo).not.toHaveClass('completed'); + await secondTodo.getByRole('checkbox').check(); + + // Assert completed class. + await expect(firstTodo).toHaveClass('completed'); + await expect(secondTodo).toHaveClass('completed'); + }); + + test('should allow me to un-mark items as complete', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + // Create two items. + for (const item of TODO_ITEMS.slice(0, 2)) { + await newTodo.fill(item); + await newTodo.press('Enter'); + } + + const firstTodo = page.getByTestId('todo-item').nth(0); + const secondTodo = page.getByTestId('todo-item').nth(1); + const firstTodoCheckbox = firstTodo.getByRole('checkbox'); + + await firstTodoCheckbox.check(); + await expect(firstTodo).toHaveClass('completed'); + await expect(secondTodo).not.toHaveClass('completed'); + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + + await firstTodoCheckbox.uncheck(); + await expect(firstTodo).not.toHaveClass('completed'); + await expect(secondTodo).not.toHaveClass('completed'); + await checkNumberOfCompletedTodosInLocalStorage(page, 0); + }); + + test('should allow me to edit an item', async ({ page }) => { + await createDefaultTodos(page); + + const todoItems = page.getByTestId('todo-item'); + const secondTodo = todoItems.nth(1); + await secondTodo.dblclick(); + await expect(secondTodo.getByRole('textbox', { name: 'Edit' })).toHaveValue(TODO_ITEMS[1]); + await secondTodo.getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); + await secondTodo.getByRole('textbox', { name: 'Edit' }).press('Enter'); + + // Explicitly assert the new text value. + await expect(todoItems).toHaveText([ + TODO_ITEMS[0], + 'buy some sausages', + TODO_ITEMS[2] + ]); + await checkTodosInLocalStorage(page, 'buy some sausages'); + }); +}); + +test.describe('Editing', () => { + test.beforeEach(async ({ page }) => { + await createDefaultTodos(page); + await checkNumberOfTodosInLocalStorage(page, 3); + }); + + test('should hide other controls when editing', async ({ page }) => { + const todoItem = page.getByTestId('todo-item').nth(1); + await todoItem.dblclick(); + await expect(todoItem.getByRole('checkbox')).not.toBeVisible(); + await expect(todoItem.locator('label', { + hasText: TODO_ITEMS[1], + })).not.toBeVisible(); + await checkNumberOfTodosInLocalStorage(page, 3); + }); + + test('should save edits on blur', async ({ page }) => { + const todoItems = page.getByTestId('todo-item'); + await todoItems.nth(1).dblclick(); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).dispatchEvent('blur'); + + await expect(todoItems).toHaveText([ + TODO_ITEMS[0], + 'buy some sausages', + TODO_ITEMS[2], + ]); + await checkTodosInLocalStorage(page, 'buy some sausages'); + }); + + test('should trim entered text', async ({ page }) => { + const todoItems = page.getByTestId('todo-item'); + await todoItems.nth(1).dblclick(); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(' buy some sausages '); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); + + await expect(todoItems).toHaveText([ + TODO_ITEMS[0], + 'buy some sausages', + TODO_ITEMS[2], + ]); + await checkTodosInLocalStorage(page, 'buy some sausages'); + }); + + test('should remove the item if an empty text string was entered', async ({ page }) => { + const todoItems = page.getByTestId('todo-item'); + await todoItems.nth(1).dblclick(); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(''); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); + + await expect(todoItems).toHaveText([ + TODO_ITEMS[0], + TODO_ITEMS[2], + ]); + }); + + test('should cancel edits on escape', async ({ page }) => { + const todoItems = page.getByTestId('todo-item'); + await todoItems.nth(1).dblclick(); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); + await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Escape'); + await expect(todoItems).toHaveText(TODO_ITEMS); + }); +}); + +test.describe('Counter', () => { + test('should display the current number of todo items', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + // create a todo count locator + const todoCount = page.getByTestId('todo-count') + + await newTodo.fill(TODO_ITEMS[0]); + await newTodo.press('Enter'); + + await expect(todoCount).toContainText('1'); + + await newTodo.fill(TODO_ITEMS[1]); + await newTodo.press('Enter'); + await expect(todoCount).toContainText('2'); + + await checkNumberOfTodosInLocalStorage(page, 2); + }); +}); + +test.describe('Clear completed button', () => { + test.beforeEach(async ({ page }) => { + await createDefaultTodos(page); + }); + + test('should display the correct text', async ({ page }) => { + await page.locator('.todo-list li .toggle').first().check(); + await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); + }); + + test('should remove completed items when clicked', async ({ page }) => { + const todoItems = page.getByTestId('todo-item'); + await todoItems.nth(1).getByRole('checkbox').check(); + await page.getByRole('button', { name: 'Clear completed' }).click(); + await expect(todoItems).toHaveCount(2); + await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); + }); + + test('should be hidden when there are no items that are completed', async ({ page }) => { + await page.locator('.todo-list li .toggle').first().check(); + await page.getByRole('button', { name: 'Clear completed' }).click(); + await expect(page.getByRole('button', { name: 'Clear completed' })).toBeHidden(); + }); +}); + +test.describe('Persistence', () => { + test('should persist its data', async ({ page }) => { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + for (const item of TODO_ITEMS.slice(0, 2)) { + await newTodo.fill(item); + await newTodo.press('Enter'); + } + + const todoItems = page.getByTestId('todo-item'); + const firstTodoCheck = todoItems.nth(0).getByRole('checkbox'); + await firstTodoCheck.check(); + await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); + await expect(firstTodoCheck).toBeChecked(); + await expect(todoItems).toHaveClass(['completed', '']); + + // Ensure there is 1 completed item. + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + + // Now reload. + await page.reload(); + await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); + await expect(firstTodoCheck).toBeChecked(); + await expect(todoItems).toHaveClass(['completed', '']); + }); +}); + +test.describe('Routing', () => { + test.beforeEach(async ({ page }) => { + await createDefaultTodos(page); + // make sure the app had a chance to save updated todos in storage + // before navigating to a new view, otherwise the items can get lost :( + // in some frameworks like Durandal + await checkTodosInLocalStorage(page, TODO_ITEMS[0]); + }); + + test('should allow me to display active items', async ({ page }) => { + const todoItem = page.getByTestId('todo-item'); + await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); + + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + await page.getByRole('link', { name: 'Active' }).click(); + await expect(todoItem).toHaveCount(2); + await expect(todoItem).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); + }); + + test('should respect the back button', async ({ page }) => { + const todoItem = page.getByTestId('todo-item'); + await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); + + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + + await test.step('Showing all items', async () => { + await page.getByRole('link', { name: 'All' }).click(); + await expect(todoItem).toHaveCount(3); + }); + + await test.step('Showing active items', async () => { + await page.getByRole('link', { name: 'Active' }).click(); + }); + + await test.step('Showing completed items', async () => { + await page.getByRole('link', { name: 'Completed' }).click(); + }); + + await expect(todoItem).toHaveCount(1); + await page.goBack(); + await expect(todoItem).toHaveCount(2); + await page.goBack(); + await expect(todoItem).toHaveCount(3); + }); + + test('should allow me to display completed items', async ({ page }) => { + await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + await page.getByRole('link', { name: 'Completed' }).click(); + await expect(page.getByTestId('todo-item')).toHaveCount(1); + }); + + test('should allow me to display all items', async ({ page }) => { + await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); + await checkNumberOfCompletedTodosInLocalStorage(page, 1); + await page.getByRole('link', { name: 'Active' }).click(); + await page.getByRole('link', { name: 'Completed' }).click(); + await page.getByRole('link', { name: 'All' }).click(); + await expect(page.getByTestId('todo-item')).toHaveCount(3); + }); + + test('should highlight the currently applied filter', async ({ page }) => { + await expect(page.getByRole('link', { name: 'All' })).toHaveClass('selected'); + + //create locators for active and completed links + const activeLink = page.getByRole('link', { name: 'Active' }); + const completedLink = page.getByRole('link', { name: 'Completed' }); + await activeLink.click(); + + // Page change - active items. + await expect(activeLink).toHaveClass('selected'); + await completedLink.click(); + + // Page change - completed items. + await expect(completedLink).toHaveClass('selected'); + }); +}); + +async function createDefaultTodos(page: Page) { + // create a new todo locator + const newTodo = page.getByPlaceholder('What needs to be done?'); + + for (const item of TODO_ITEMS) { + await newTodo.fill(item); + await newTodo.press('Enter'); + } +} + +async function checkNumberOfTodosInLocalStorage(page: Page, expected: number) { + return await page.waitForFunction(e => { + return JSON.parse(localStorage['react-todos']).length === e; + }, expected); +} + +async function checkNumberOfCompletedTodosInLocalStorage(page: Page, expected: number) { + return await page.waitForFunction(e => { + return JSON.parse(localStorage['react-todos']).filter((todo: any) => todo.completed).length === e; + }, expected); +} + +async function checkTodosInLocalStorage(page: Page, title: string) { + return await page.waitForFunction(t => { + return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); + }, title); +} diff --git a/tests/tests/example.spec.ts b/tests/tests/example.spec.ts new file mode 100644 index 0000000000..590f33f96c --- /dev/null +++ b/tests/tests/example.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from '@playwright/test'; + +test('has title', async ({ page }) => { + await page.goto('http://localhost:8000/release-notes'); + + // Expect a title "to contain" a substring. + await expect(page).toHaveTitle(/Pantheon Release Notes/); +}); +/* +test('get started link', async ({ page }) => { + await page.goto('https://playwright.dev/'); + + // Click the get started link. + await page.getByRole('link', { name: 'Get started' }).click(); + + // Expects page to have a heading with the name of Installation. + await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); +}); +*/ From 3c1ea9e2c5f83020a56433e0c0f8f0dae65c6f46 Mon Sep 17 00:00:00 2001 From: Rachel Whitton Date: Thu, 21 Dec 2023 15:19:36 -0600 Subject: [PATCH 21/63] Add first pass at script to auto create releasenotes based on past changelog files --- .../create-release-notes-from-changelog-file.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 source/releasenotes/create-release-notes-from-changelog-file.sh diff --git a/source/releasenotes/create-release-notes-from-changelog-file.sh b/source/releasenotes/create-release-notes-from-changelog-file.sh new file mode 100644 index 0000000000..1b1417f7a4 --- /dev/null +++ b/source/releasenotes/create-release-notes-from-changelog-file.sh @@ -0,0 +1,14 @@ +#!/bin/bash +FILENAME=2023-11-01-November.md +DATE_PREFIX+=("${FILENAME:0:10}") +while IFS= read -r line; do + if [[ $line =~ "###" ]]; then + RELEASE_NOTE_FILENAME=("${line:4}") + RELEASE_NOTE_FILENAME="$(echo $DATE_PREFIX $RELEASE_NOTE_FILENAME| tr ' ' '-'| tr '.' '-'| tr '[:upper:]' '[:lower:]').md" + echo "---" >> ./releasenotes/$RELEASE_NOTE_FILENAME + echo "title: "${line:4} >> ./releasenotes/$RELEASE_NOTE_FILENAME + echo "published_date: "'"'$DATE_PREFIX'"' >> ./releasenotes/$RELEASE_NOTE_FILENAME + echo "categories: []" >> ./releasenotes/$RELEASE_NOTE_FILENAME + echo "---" >> ./releasenotes/$RELEASE_NOTE_FILENAME + fi +done <$FILENAME From 08ad2405a82433aa33eee0226ce52b248fb614fd Mon Sep 17 00:00:00 2001 From: Rachel Whitton Date: Thu, 21 Dec 2023 21:55:34 -0600 Subject: [PATCH 22/63] Backfill changelog entries as release notes Sep - Dec 2023 --- ...9-01-early-access-customer-scheduled-jobs.md | 8 ++++++++ ...early-access-streamlined-user-offboarding.md | 8 ++++++++ .../2023-09-01-front-end-sites-enhancements.md | 17 +++++++++++++++++ .../releasenotes/2023-09-01-new-php-defaults.md | 8 ++++++++ .../releasenotes/2023-09-01-object-cache-pro.md | 8 ++++++++ ...anced-page-cache-wordpress-plugin-updates.md | 8 ++++++++ .../2023-09-01-php-security-updates.md | 8 ++++++++ ...01-solr-search-for-wordpress-2-5-0-update.md | 10 ++++++++++ ...01-wordpress-multisite-search-and-replace.md | 10 ++++++++++ ...2023-10-01-design-system-integration-docs.md | 8 ++++++++ .../2023-10-01-drupal-security-update.md | 8 ++++++++ .../2023-10-01-front-end-sites-settings.md | 7 +++++++ ...-2-updated-to-their-latest-patch-releases.md | 6 ++++++ .../2023-10-01-php-memory-limits-updates.md | 8 ++++++++ ...lity-cache-hit-ratio-increased-24-percent.md | 6 ++++++ .../2023-11-01-composer-logs-visibility.md | 6 ++++++ .../releasenotes/2023-11-01-faster-backups.md | 6 ++++++ ...-sites-build-caching-and-node-js-versions.md | 10 ++++++++++ .../2023-11-01-streamlined-user-offboarding.md | 10 ++++++++++ ...-01-vpat-issued-for-product-accessibility.md | 8 ++++++++ ...-wordpress-native-php-sessions-1-4-update.md | 8 ++++++++ ...from-dashboard-for-streamlined-management.md | 8 ++++++++ ...e-with-front-end-sites-drupal-starter-kit.md | 13 +++++++++++++ ...ed-monitoring-for-high-volume-directories.md | 6 ++++++ ...sures-for-uninterrupted-webops-experience.md | 12 ++++++++++++ ...6-4-2-now-available-for-enhanced-security.md | 6 ++++++ 26 files changed, 221 insertions(+) create mode 100644 source/releasenotes/2023-09-01-early-access-customer-scheduled-jobs.md create mode 100644 source/releasenotes/2023-09-01-early-access-streamlined-user-offboarding.md create mode 100644 source/releasenotes/2023-09-01-front-end-sites-enhancements.md create mode 100644 source/releasenotes/2023-09-01-new-php-defaults.md create mode 100644 source/releasenotes/2023-09-01-object-cache-pro.md create mode 100644 source/releasenotes/2023-09-01-pantheon-advanced-page-cache-wordpress-plugin-updates.md create mode 100644 source/releasenotes/2023-09-01-php-security-updates.md create mode 100644 source/releasenotes/2023-09-01-solr-search-for-wordpress-2-5-0-update.md create mode 100644 source/releasenotes/2023-09-01-wordpress-multisite-search-and-replace.md create mode 100644 source/releasenotes/2023-10-01-design-system-integration-docs.md create mode 100644 source/releasenotes/2023-10-01-drupal-security-update.md create mode 100644 source/releasenotes/2023-10-01-front-end-sites-settings.md create mode 100644 source/releasenotes/2023-10-01-php-8-1-and-8-2-updated-to-their-latest-patch-releases.md create mode 100644 source/releasenotes/2023-10-01-php-memory-limits-updates.md create mode 100644 source/releasenotes/2023-10-01-wpml-improved-edge-caching-compatibility-cache-hit-ratio-increased-24-percent.md create mode 100644 source/releasenotes/2023-11-01-composer-logs-visibility.md create mode 100644 source/releasenotes/2023-11-01-faster-backups.md create mode 100644 source/releasenotes/2023-11-01-front-end-sites-build-caching-and-node-js-versions.md create mode 100644 source/releasenotes/2023-11-01-streamlined-user-offboarding.md create mode 100644 source/releasenotes/2023-11-01-vpat-issued-for-product-accessibility.md create mode 100644 source/releasenotes/2023-11-01-wordpress-native-php-sessions-1-4-update.md create mode 100644 source/releasenotes/2023-12-01-delete-front-end-sites-multidevs-directly-from-dashboard-for-streamlined-management.md create mode 100644 source/releasenotes/2023-12-01-elevated-experience-with-front-end-sites-drupal-starter-kit.md create mode 100644 source/releasenotes/2023-12-01-optimized-monitoring-for-high-volume-directories.md create mode 100644 source/releasenotes/2023-12-01-upgraded-security-measures-for-uninterrupted-webops-experience.md create mode 100644 source/releasenotes/2023-12-01-wordpress-6-4-2-now-available-for-enhanced-security.md diff --git a/source/releasenotes/2023-09-01-early-access-customer-scheduled-jobs.md b/source/releasenotes/2023-09-01-early-access-customer-scheduled-jobs.md new file mode 100644 index 0000000000..f1b6e3f088 --- /dev/null +++ b/source/releasenotes/2023-09-01-early-access-customer-scheduled-jobs.md @@ -0,0 +1,8 @@ +--- +title: "Early Access: Customer Scheduled Jobs" +published_date: "2023-09-01" +categories: [new-feature, tools-apis] +--- +[The Terminus Scheduled Jobs Plugin](/customer-scheduled-cron-jobs) allows you to schedule and automate specific cron jobs according to site requirements without affecting performance. + +You can specify the desired frequency (e.g., daily, weekly, monthly, hourly), and the actions to be performed. The system then executes the scheduled jobs automatically based on the provided instructions. Helps with long running jobs by granting a total budget of 300 mins (in a 24 hr period) to run jobs. diff --git a/source/releasenotes/2023-09-01-early-access-streamlined-user-offboarding.md b/source/releasenotes/2023-09-01-early-access-streamlined-user-offboarding.md new file mode 100644 index 0000000000..35393f27de --- /dev/null +++ b/source/releasenotes/2023-09-01-early-access-streamlined-user-offboarding.md @@ -0,0 +1,8 @@ +--- +title: "Early Access: Streamlined User Offboarding" +published_date: "2023-09-01" +categories: [account-management, user-interface] +--- +Helps Workspace Admins more effectively manage user access by providing the ability to offboard users from multiple sites in a single click. + +For more information, see Pantheon’s documentation on [Workspace Offboarding](/workspace-offboarding). Or join the [#WordPress Slack Channel](http://slackin.pantheon.io) to connect with other Pantheon customers & super-users. diff --git a/source/releasenotes/2023-09-01-front-end-sites-enhancements.md b/source/releasenotes/2023-09-01-front-end-sites-enhancements.md new file mode 100644 index 0000000000..aa3dbaff01 --- /dev/null +++ b/source/releasenotes/2023-09-01-front-end-sites-enhancements.md @@ -0,0 +1,17 @@ +--- +title: "Front-End Sites Enhancements" +published_date: "2023-09-01" +categories: [front-end-sites, user-interface] +--- +We released version 1.0.5 of the [WP Decoupled Preview plugin](https://wordpress.org/plugins/decoupled-preview/) which contains a bug fix specific to WordPress 6.3. WP Decoupled Preview enables content editors to see their changes in the context of a front-end framework (served through [Pantheon's Front-End Sites](/guides/decoupled/overview)) like Next.js. To try this functionality, request access to Front-End Sites and [follow our tutorial for spinning up our WordPress + Next.js starter](/guides/decoupled/wp-nextjs-frontend-starters). + +Can you tell we want more teams to sign up for Front-End Sites? If you don't yet have access, as of the last month you'll now see callouts in the site creation flow that lead to Front-End Sites Access: + +![Sign up page in the Pantheon dashboard for decoupled Early Access](../images/decoupled/ea-decoupled-signup.png) + +Thanks to efforts in the last month, once you spin up new codebases in Front-End Sites, you will also find: +- Newly improved readme files in your fresh projects. +- Health checks that fire early in the build process if your Front-End Site may be likely to fail due to missing variables for a back-end CMS +- A better navigation and search functionality for [the Decoupled Kit project documentation](https://decoupledkit.pantheon.io/docs). + +Want to chat more about these kinds of sites? Join the [#front-end-frameworks](https://pantheon-community.slack.com/archives/C01DXGMFZFB) Slack Channel. diff --git a/source/releasenotes/2023-09-01-new-php-defaults.md b/source/releasenotes/2023-09-01-new-php-defaults.md new file mode 100644 index 0000000000..83a3e63906 --- /dev/null +++ b/source/releasenotes/2023-09-01-new-php-defaults.md @@ -0,0 +1,8 @@ +--- +title: New PHP Defaults +published_date: "2023-09-01" +categories: [infrastructure, wordpress, drupal, action-required] +--- +Pantheon has pushed an update to WordPress and Drupal 7 core upstreams which sets PHP 8.1 as the new default PHP version, rather than 7.4. + +Please test this core update thoroughly before deploying to the Live environment. If your site requires an older version of PHP, or if you'd like to upgrade to PHP 8.2, see [Pantheon’s documentation on how to manage PHP versions via the pantheon.yml configuration file](/guides/php/php-versions). diff --git a/source/releasenotes/2023-09-01-object-cache-pro.md b/source/releasenotes/2023-09-01-object-cache-pro.md new file mode 100644 index 0000000000..6fe9fb5932 --- /dev/null +++ b/source/releasenotes/2023-09-01-object-cache-pro.md @@ -0,0 +1,8 @@ +--- +title: Object Cache Pro +published_date: "2023-09-01" +categories: [wordpress, action-required, performance, new-feature] +--- +WordPress sites can now leverage an upgraded object caching solution on Pantheon! Object Cache Pro is a highly optimized premium WordPress plugin that integrates with Redis for business class performance. [Find out more about our perspective Object Caching from Steve Persch, Director of Developer Experience](https://pantheon.io/blog/pantheon-includes-object-cache-pro-painless-improved-performance). + +See Pantheon’s documentation for instructions on [how to enable Object Cache Pro](/object-cache/wordpress). Or join the [#WordPress Slack Channel](http://slackin.pantheon.io) to connect with other customers using Object Cache Pro. diff --git a/source/releasenotes/2023-09-01-pantheon-advanced-page-cache-wordpress-plugin-updates.md b/source/releasenotes/2023-09-01-pantheon-advanced-page-cache-wordpress-plugin-updates.md new file mode 100644 index 0000000000..a4c6261767 --- /dev/null +++ b/source/releasenotes/2023-09-01-pantheon-advanced-page-cache-wordpress-plugin-updates.md @@ -0,0 +1,8 @@ +--- +title: Pantheon Advanced Page Cache WordPress Plugin Updates +published_date: "2023-09-01" +categories: [wordpress, action-required, performance] +--- +We released an update for the [Pantheon Advanced Page Cache](https://wordpress.org/plugins/pantheon-advanced-page-cache/) WordPress plugin which adds a filter to allow disabling surrogate keys for posts' taxonomy terms. This can be especially helpful for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes). + +For more information, see [Pantheon documentation](/guides/wordpress-configurations/plugins#disable-surrogate-keys-for-taxonomy-terms). diff --git a/source/releasenotes/2023-09-01-php-security-updates.md b/source/releasenotes/2023-09-01-php-security-updates.md new file mode 100644 index 0000000000..9533b9e382 --- /dev/null +++ b/source/releasenotes/2023-09-01-php-security-updates.md @@ -0,0 +1,8 @@ +--- +title: PHP Security Updates +published_date: "2023-09-01" +categories: [infrastructure, security, action-required] +--- +Pantheon has deployed PHP versions [8.2.9](https://www.php.net/ChangeLog-8.php#8.2.9), [8.1.22](https://www.php.net/ChangeLog-8.php#8.1.22), and [8.0.30](https://www.php.net/ChangeLog-8.php#8.0.30) to customer sites running on the platform. These releases address vulnerabilities disclosed in [CVE-2023-3823](https://nvd.nist.gov/vuln/detail/CVE-2023-3823) and [CVE-2023-3824](https://nvd.nist.gov/vuln/detail/CVE-2023-3824). + +If you are using PHP 8.2, 8.1 or 8.0, there is nothing further that you need to do. If you are still on PHP 7.4 or earlier, though, you should schedule some time to upgrade to a supported version.While the vulnerabilities patched in these latest releases are not reported to affect PHP 7.4, the fact remains that there could be (and probably are) unpatched vulnerabilities in the end-of-life versions. Read more about it in Greg Anderson’s [blog post](https://pantheon.io/blog/php-829-security-release-demonstrates-pantheons-commitment-protecting-your-sites). diff --git a/source/releasenotes/2023-09-01-solr-search-for-wordpress-2-5-0-update.md b/source/releasenotes/2023-09-01-solr-search-for-wordpress-2-5-0-update.md new file mode 100644 index 0000000000..7f187e2bee --- /dev/null +++ b/source/releasenotes/2023-09-01-solr-search-for-wordpress-2-5-0-update.md @@ -0,0 +1,10 @@ +--- +title: "Solr Search for WordPress 2.5.0 Update" +published_date: "2023-09-01" +categories: [wordpress, action-required, performance] +--- +We released an update for the [Solr Search for WordPress plugin](https://wordpress.org/plugins/solr-power/) which disables auto-commit by default and allows cron to push solr commits regularly instead. + +This drastically improves the performance of large sites and avoids 503 errors related to hard committing on every update. This update is recommended for all WordPress sites currently running the plugin. + +You can still enable auto-commit by explicitly setting `SOLRPOWER_DISABLE_AUTOCOMMIT` to `false`. diff --git a/source/releasenotes/2023-09-01-wordpress-multisite-search-and-replace.md b/source/releasenotes/2023-09-01-wordpress-multisite-search-and-replace.md new file mode 100644 index 0000000000..bb525e6e07 --- /dev/null +++ b/source/releasenotes/2023-09-01-wordpress-multisite-search-and-replace.md @@ -0,0 +1,10 @@ +--- +title: WordPress Multisite Search and Replace +published_date: "2023-09-01" +categories: [wordpress, new-feature] +--- +WordPress Multisites can now run automated Search and Replace when cloning the database between environments or spinning up new environments. + +Subdomain Multisites can use a domain map to define the URLs between environments, or auto-convert to a subdirectory Multisite in non-live environments. + +For more information, see Pantheon’s documentation on [Search and Replace](/guides/multisite/search-replace/). Or join the [#WordPress Slack Channel](http://slackin.pantheon.io) to connect with other Pantheon customers & super-users. diff --git a/source/releasenotes/2023-10-01-design-system-integration-docs.md b/source/releasenotes/2023-10-01-design-system-integration-docs.md new file mode 100644 index 0000000000..b5f59313c0 --- /dev/null +++ b/source/releasenotes/2023-10-01-design-system-integration-docs.md @@ -0,0 +1,8 @@ +--- +title: "Design System Integration: Docs" +published_date: "2023-10-01" +categories: [user-interface] +--- +We're excited to announce that our documentation site has been seamlessly integrated with our brand-new design system. This enhancement brings a fresh and cohesive look to our documentation, providing a unified and visually appealing experience for our users. Explore the updated, improved, and more accessible [Docs site](/) today. + +![Docs Design System](../images/DocsDesignSystem.png) diff --git a/source/releasenotes/2023-10-01-drupal-security-update.md b/source/releasenotes/2023-10-01-drupal-security-update.md new file mode 100644 index 0000000000..c0bd845192 --- /dev/null +++ b/source/releasenotes/2023-10-01-drupal-security-update.md @@ -0,0 +1,8 @@ +--- +title: Drupal Security Update +published_date: "2023-10-01" +categories: [drupal, security, action-required] +--- +On September 20th, [Drupal core updates were released to address a critical vulnerability in the JSON:API module](https://status.pantheon.io/incidents/vj842n7k7w40). Those updates became immediately available within the Pantheon dashboard for one-click code updates. Additionally, [our engineers updated our CDN to mitigate potential attacks](https://status.pantheon.io/incidents/598zxv2v8l7p). + +If you have a Drupal site using JSON:API we suggest you update as soon as possible if you haven't done so already. And even if you aren't using JSON:API, it'll still feel good to apply an update, right? To better understand the nature of security updates, [come watch the Pantheon YouTube Livestream on October 25th](https://www.youtube.com/watch?v=WV2ZSeBOziU). diff --git a/source/releasenotes/2023-10-01-front-end-sites-settings.md b/source/releasenotes/2023-10-01-front-end-sites-settings.md new file mode 100644 index 0000000000..64372d2b34 --- /dev/null +++ b/source/releasenotes/2023-10-01-front-end-sites-settings.md @@ -0,0 +1,7 @@ +--- +title: "Front-End Sites Settings" +published_date: "2023-10-01" +categories: [front-end-sites, user-interface] +--- +The Pantheon Front-End Sites Settings page is now available for users of the WordPress for Front-End project. It provides a simplified post install experience where users can copy environment variables for use in the Front-End Sites dashboard, and also test their preview endpoint. Instructions for creating a new WordPress project [can be found here](https://decoupledkit.pantheon.io/docs/backend-starters/decoupled-wordpress/creating-a-new-project). +Want to chat more about these kinds of sites? Join the [#front-end-frameworks](https://pantheon-community.slack.com/archives/C01DXGMFZFB) Slack Channel. diff --git a/source/releasenotes/2023-10-01-php-8-1-and-8-2-updated-to-their-latest-patch-releases.md b/source/releasenotes/2023-10-01-php-8-1-and-8-2-updated-to-their-latest-patch-releases.md new file mode 100644 index 0000000000..ef5e30b54b --- /dev/null +++ b/source/releasenotes/2023-10-01-php-8-1-and-8-2-updated-to-their-latest-patch-releases.md @@ -0,0 +1,6 @@ +--- +title: "PHP 8.1 and 8.2 updated to their latest patch releases" +published_date: "2023-10-01" +categories: [infrastructure, security] +--- +PHP 8.2.11 and 8.1.24 were released on the platform. They contain the latest bug fixes and security releases for PHP. As a reminder, PHP 8.0 will reach End-of-Life on 26 November 2023. For the best performance and security, Pantheon recommends running PHP 8.1 and above. diff --git a/source/releasenotes/2023-10-01-php-memory-limits-updates.md b/source/releasenotes/2023-10-01-php-memory-limits-updates.md new file mode 100644 index 0000000000..659a5dab50 --- /dev/null +++ b/source/releasenotes/2023-10-01-php-memory-limits-updates.md @@ -0,0 +1,8 @@ +--- +title: PHP Memory Limits Updates +published_date: "2023-10-01" +categories: [infrastructure, performance] +--- +Sometimes you just need more memory to serve your site reliably. To learn more about why we doubled the memory for most site plans, [check out this blog](https://pantheon.io/blog/pantheon-increases-php-memory-limits-performance-and-elite-plans) by Rachel Whitton, Lead Technical Writer here at Pantheon. + +To take advantage of the increased memory limit, [contact our customer support team](/guides/support/contact-support/). Or drop by our [regular Zoom-based office hours](http://pantheon.io/developer-community/office-hours). diff --git a/source/releasenotes/2023-10-01-wpml-improved-edge-caching-compatibility-cache-hit-ratio-increased-24-percent.md b/source/releasenotes/2023-10-01-wpml-improved-edge-caching-compatibility-cache-hit-ratio-increased-24-percent.md new file mode 100644 index 0000000000..70f2640dc4 --- /dev/null +++ b/source/releasenotes/2023-10-01-wpml-improved-edge-caching-compatibility-cache-hit-ratio-increased-24-percent.md @@ -0,0 +1,6 @@ +--- +title: "WPML Improved Edge Caching Compatibility - Cache Hit Ratio Increased 24%" +published_date: "2023-10-01" +categories: [wordpress, performance, infrastructure] +--- +Global CDN now has improved compatibility with the WPML multilingual WordPress plugin. Page variations for each language can be cached at the edge. This update was rolled out automatically for all sites that use the WPML plugin and increased site cache hit ratio by 24% on average. diff --git a/source/releasenotes/2023-11-01-composer-logs-visibility.md b/source/releasenotes/2023-11-01-composer-logs-visibility.md new file mode 100644 index 0000000000..973c93073b --- /dev/null +++ b/source/releasenotes/2023-11-01-composer-logs-visibility.md @@ -0,0 +1,6 @@ +--- +title: Composer Logs Visibility +published_date: "2023-11-01" +categories: [new-feature, tools-apis] +--- +Visibility into composer logs has been a top customer request. Now, if you need to debug a composer build failure due to an error, install the Terminus Composer Logs plugin on your machine to view more details. Upstream Update logs are also available. Installation instructions and command usage can be found [here in the plugin's GitHub repository](https://github.com/pantheon-systems/terminus-composer-logs-plugin). diff --git a/source/releasenotes/2023-11-01-faster-backups.md b/source/releasenotes/2023-11-01-faster-backups.md new file mode 100644 index 0000000000..322a7fdc46 --- /dev/null +++ b/source/releasenotes/2023-11-01-faster-backups.md @@ -0,0 +1,6 @@ +--- +title: Faster Backups +published_date: "2023-11-01" +categories: [infrastructure, performance] +--- +The File System team at Pantheon achieved significant speed improvements in backup processes. The Valhalla export process was overhauled, allowing backups to be constructed from new objects, cutting down export times by 25-83%. This was accomplished by initiating object retrieval immediately after receiving MANIFEST metadata, omitting empty files, and promptly archiving received files. diff --git a/source/releasenotes/2023-11-01-front-end-sites-build-caching-and-node-js-versions.md b/source/releasenotes/2023-11-01-front-end-sites-build-caching-and-node-js-versions.md new file mode 100644 index 0000000000..2ba96b55fe --- /dev/null +++ b/source/releasenotes/2023-11-01-front-end-sites-build-caching-and-node-js-versions.md @@ -0,0 +1,10 @@ +--- +title: "Front-End Sites Build Caching and Node.js Versions" +published_date: "2023-11-01" +categories: [front-end-sites, action-required, performance] +--- +Pantheon introduced a new build pipeline for Front End Sites to significantly improve build times. Beginning on November 13th, 2023, newly created sites are automatically using the new pipeline and cannot opt back to the old pipeline. Sites made prior to that date can opt-in to the new pipeline to take advantage of the new features. All pre-existing sites that do not opt-in will be switched over for new builds on or around January 15th. + +Additionally, we are adding support for Node 18 (for dynamic sites) and 20 (for both static and dynamic sites). To select a specific version, Pantheon is [moving away from using .nvmrc](/guides/decoupled/overview/manage-settings#nodejs-version) and will instead look to the [“engines” field](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#engines) in your project’s `package.json` file. + +To find out more about adopting the new pipeline, [check out our documentation](/guides/decoupled/overview/v1-pipeline), and read our [blog post](https://pantheon.io/blog/opt-now-faster-build-pipeline-front-end-sites?utm_medium=email&utm_source=newsletter&utm_content=front_end_sites_blog&utm_campaign=2023_11_PSU_ALL_US_Novemeber_Changelog_Newsletter) about how we’re already experiencing the benefits of this internally at Pantheon. diff --git a/source/releasenotes/2023-11-01-streamlined-user-offboarding.md b/source/releasenotes/2023-11-01-streamlined-user-offboarding.md new file mode 100644 index 0000000000..24cbc3ec79 --- /dev/null +++ b/source/releasenotes/2023-11-01-streamlined-user-offboarding.md @@ -0,0 +1,10 @@ +--- +title: Streamlined User Offboarding +published_date: "2023-11-01" +categories: [account-management, user-interface, new-feature] +--- +Administrators of large workspaces will now be able to easily remove access for offboarded users at scale. When a member of your team changes jobs, or for whatever reason you need to remove a person from your sites, you can now do so faster + +As you remove users from your workspace or site team, you will be prompted to remove access across all sites that a given user may be connected to, which can save multiple clicks and manual labor to ensure the right access levels are maintained. + +To learn more about how this new offboarding process works, take a look at our [documentation](/guides/account-mgmt/workspace-sites-teams/teams#remove-a-user). diff --git a/source/releasenotes/2023-11-01-vpat-issued-for-product-accessibility.md b/source/releasenotes/2023-11-01-vpat-issued-for-product-accessibility.md new file mode 100644 index 0000000000..78c158b62f --- /dev/null +++ b/source/releasenotes/2023-11-01-vpat-issued-for-product-accessibility.md @@ -0,0 +1,8 @@ +--- +title: VPAT issued for product accessibility +published_date: "2023-11-01" +categories: [infrastructure, user-interface] +--- +* As part of Pantheon’s commitment to accessibility, diversity, and inclusion, we are proud to announce that we have completed an external audit of our platform’s accessibility features and the results are available in our [WCAG 2.1 AA VPAT](https://drive.google.com/file/d/1SYnzTsVNOyK4-5eLRYnNQJArdVsM8JUD/view). +* Our teams have ongoing efforts to improve accessibility further and have outlined goals to improve our support of WCAG 2.1 AA criteria for the next two quarters. +* Our partners and customers who depend on WCAG compliant products can confidently continue to use the platform knowing that we hold accessibility to be an important function of the services we provide. diff --git a/source/releasenotes/2023-11-01-wordpress-native-php-sessions-1-4-update.md b/source/releasenotes/2023-11-01-wordpress-native-php-sessions-1-4-update.md new file mode 100644 index 0000000000..eba22d7482 --- /dev/null +++ b/source/releasenotes/2023-11-01-wordpress-native-php-sessions-1-4-update.md @@ -0,0 +1,8 @@ +--- +title: "WordPress Native PHP Sessions 1.4 Update" +published_date: "2023-11-01" +categories: [wordpress, action-required, performance] +--- +The WordPress Native PHP Sessions plugin added primary keys to its custom tables in 1.2.2 for greater performance and redundancy, but did not upgrade existing sites. Now, version 1.4 includes an optional upgrade command for sites that installed the plugin prior to the 1.2.2 release. + +Our open source [WordPress Native PHP Sessions](https://wordpress.org/plugins/wp-native-php-sessions/) is available in the WordPress.org plugins repo. diff --git a/source/releasenotes/2023-12-01-delete-front-end-sites-multidevs-directly-from-dashboard-for-streamlined-management.md b/source/releasenotes/2023-12-01-delete-front-end-sites-multidevs-directly-from-dashboard-for-streamlined-management.md new file mode 100644 index 0000000000..2e3e86a491 --- /dev/null +++ b/source/releasenotes/2023-12-01-delete-front-end-sites-multidevs-directly-from-dashboard-for-streamlined-management.md @@ -0,0 +1,8 @@ +--- +title: "Delete Front-End Sites Multidevs Directly From Dashboard for Streamlined Management" +published_date: "2023-12-01" +categories: [front-end-sites, user-interface] +--- +We've enhanced your site management experience by enabling the ability to delete Multidevs directly from your Front-End Sites dashboard. This upgrade simplifies project organization, providing you with a seamless process to remove unnecessary Multidevs. + +This intuitive addition streamlines site management, offering a hassle-free solution to keep your projects organized and optimized. Find detailed instructions [here](/guides/decoupled/overview/fes-multidev#delete-a-multidev-environment). diff --git a/source/releasenotes/2023-12-01-elevated-experience-with-front-end-sites-drupal-starter-kit.md b/source/releasenotes/2023-12-01-elevated-experience-with-front-end-sites-drupal-starter-kit.md new file mode 100644 index 0000000000..4bc9c73276 --- /dev/null +++ b/source/releasenotes/2023-12-01-elevated-experience-with-front-end-sites-drupal-starter-kit.md @@ -0,0 +1,13 @@ +--- +title: "Elevated Experience With Front-End Sites Drupal Starter Kit" +published_date: "2023-12-01" +categories: [front-end-sites, user-interface] +--- +The Pantheon Drupal Starter Kit for Front-End Sites has undergone significant improvements. +* **Setup experience**: The setup process is now more user-friendly and guided for a seamless experience. +* **Health check script**: The newly introduced health check script alerts you to known configuration issues before a build fails. +* **Front-End Sites settings**: Effortlessly navigate through the Settings page, simplifying the testing of your preview endpoint, and allowing convenient copying of environment variables for use in the Front-End Sites Dashboard. + +Curious about creating a new Drupal project with these enhancements? Find detailed instructions [here](https://decoupledkit.pantheon.io/docs/backend-starters/decoupled-drupal/creating-a-new-project). + +For further insights and discussions on similar sites, join the [#front-end-frameworks](https://pantheon-community.slack.com/archives/C01DXGMFZFB) Slack channel. diff --git a/source/releasenotes/2023-12-01-optimized-monitoring-for-high-volume-directories.md b/source/releasenotes/2023-12-01-optimized-monitoring-for-high-volume-directories.md new file mode 100644 index 0000000000..8613c07cc8 --- /dev/null +++ b/source/releasenotes/2023-12-01-optimized-monitoring-for-high-volume-directories.md @@ -0,0 +1,6 @@ +--- +title: Optimized Monitoring for High-Volume Directories +published_date: "2023-12-01" +categories: [new-feature, user-interface, performance] +--- +Introducing proactive alerts tailored for directories with substantial file counts, which could impact performance or accessibility. Stay informed with timely notifications delivered [directly to your dashboard](/guides/filesystem/large-files/#alerts) and via email when file counts reach 50,000 and 100,000. This feature empowers you to efficiently manage your file system and address potential issues promptly. diff --git a/source/releasenotes/2023-12-01-upgraded-security-measures-for-uninterrupted-webops-experience.md b/source/releasenotes/2023-12-01-upgraded-security-measures-for-uninterrupted-webops-experience.md new file mode 100644 index 0000000000..337de3a79e --- /dev/null +++ b/source/releasenotes/2023-12-01-upgraded-security-measures-for-uninterrupted-webops-experience.md @@ -0,0 +1,12 @@ +--- +title: Upgraded Security Measures for Uninterrupted WebOps Experience +published_date: "2023-12-01" +categories: [infrastructure, security, performance] +--- +We're thrilled to announce an impactful upgrade to Pantheon's security infrastructure, reinforcing our commitment to safeguarding your websites. In response to the escalating sophistication of distributed denial-of-service (DDoS) attacks, we've implemented innovative solutions to fortify our defenses. Particularly, we've addressed a surge in Layer 7 attacks targeting content management systems, ensuring resilience even without our Advanced Global CDN's Web Application Firewall (WAF). + +**Key benefits:** +* **Advanced DDoS protection**: Our engineers have proactively countered Layer 7 attacks, mitigating risks posed by inauthentic traffic targeting web content management systems. +* **Rate limiting capabilities**: We've introduced rate limiting capabilities within our Global CDN, curbing abusive traffic effectively. This ensures a stable online presence, even during large-scale attacks, preventing wider stability issues. + +For more in-depth insights into the measures we've taken and the value they bring to your Pantheon experience, delve into the [full blog post](https://pantheon.io/blog/pantheon-improves-protection-malicious-traffic). Your website's security and stability are our top priorities, and this enhancement is another step in our ongoing commitment to delivering a robust WebOps platform. diff --git a/source/releasenotes/2023-12-01-wordpress-6-4-2-now-available-for-enhanced-security.md b/source/releasenotes/2023-12-01-wordpress-6-4-2-now-available-for-enhanced-security.md new file mode 100644 index 0000000000..1744d7d693 --- /dev/null +++ b/source/releasenotes/2023-12-01-wordpress-6-4-2-now-available-for-enhanced-security.md @@ -0,0 +1,6 @@ +--- +title: "WordPress 6.4.2 Now Available for Enhanced Security" +published_date: "2023-12-01" +categories: [wordpress, security, action-required] +--- +In response to a critical security vulnerability, [WordPress 6.4.2](https://wordpress.org/news/2023/12/wordpress-6-4-2-maintenance-security-release/) was released on December 6, 2023. To ensure the safety of your site, Pantheon strongly advises an immediate upgrade. Prioritize your site's security – upgrade now! From 73ba9b3b941528d58193c078367d1cae47304a5f Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 13:15:59 -0600 Subject: [PATCH 23/63] Revert "adding playwright examples" This reverts commit 7e7e457750af69e64053716e8942b68fd5d76118. --- tests/.github/workflows/playwright.yml | 27 -- tests/.gitignore | 5 - tests/package-lock.json | 91 ----- tests/package.json | 14 - tests/playwright.config.ts | 77 ---- tests/tests-examples/demo-todo-app.spec.ts | 437 --------------------- tests/tests/example.spec.ts | 19 - 7 files changed, 670 deletions(-) delete mode 100644 tests/.github/workflows/playwright.yml delete mode 100644 tests/.gitignore delete mode 100644 tests/package-lock.json delete mode 100644 tests/package.json delete mode 100644 tests/playwright.config.ts delete mode 100644 tests/tests-examples/demo-todo-app.spec.ts delete mode 100644 tests/tests/example.spec.ts diff --git a/tests/.github/workflows/playwright.yml b/tests/.github/workflows/playwright.yml deleted file mode 100644 index 90b6b700d4..0000000000 --- a/tests/.github/workflows/playwright.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/tests/.gitignore b/tests/.gitignore deleted file mode 100644 index 68c5d18f00..0000000000 --- a/tests/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules/ -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ diff --git a/tests/package-lock.json b/tests/package-lock.json deleted file mode 100644 index 36ee107cd4..0000000000 --- a/tests/package-lock.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "tests", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "tests", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.40.1", - "@types/node": "^20.10.5" - } - }, - "node_modules/@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", - "dev": true, - "dependencies": { - "playwright": "1.40.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/@types/node": { - "version": "20.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", - "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", - "dev": true, - "dependencies": { - "playwright-core": "1.40.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", - "dev": true, - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - } - } -} diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 9d001443e4..0000000000 --- a/tests/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "tests", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": {}, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.40.1", - "@types/node": "^20.10.5" - } -} diff --git a/tests/playwright.config.ts b/tests/playwright.config.ts deleted file mode 100644 index 301801ee1d..0000000000 --- a/tests/playwright.config.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// require('dotenv').config(); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -export default defineConfig({ - testDir: './tests', - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://127.0.0.1:3000', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, - // }, - ], - - /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // url: 'http://127.0.0.1:3000', - // reuseExistingServer: !process.env.CI, - // }, -}); diff --git a/tests/tests-examples/demo-todo-app.spec.ts b/tests/tests-examples/demo-todo-app.spec.ts deleted file mode 100644 index 2fd6016fe8..0000000000 --- a/tests/tests-examples/demo-todo-app.spec.ts +++ /dev/null @@ -1,437 +0,0 @@ -import { test, expect, type Page } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('https://demo.playwright.dev/todomvc'); -}); - -const TODO_ITEMS = [ - 'buy some cheese', - 'feed the cat', - 'book a doctors appointment' -]; - -test.describe('New Todo', () => { - test('should allow me to add todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create 1st todo. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Make sure the list only has one todo item. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0] - ]); - - // Create 2nd todo. - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - - // Make sure the list now has two todo items. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[1] - ]); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); - - test('should clear text input field when an item is added', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create one todo item. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Check that input is empty. - await expect(newTodo).toBeEmpty(); - await checkNumberOfTodosInLocalStorage(page, 1); - }); - - test('should append new items to the bottom of the list', async ({ page }) => { - // Create 3 items. - await createDefaultTodos(page); - - // create a todo count locator - const todoCount = page.getByTestId('todo-count') - - // Check test using different methods. - await expect(page.getByText('3 items left')).toBeVisible(); - await expect(todoCount).toHaveText('3 items left'); - await expect(todoCount).toContainText('3'); - await expect(todoCount).toHaveText(/3/); - - // Check all items in one call. - await expect(page.getByTestId('todo-title')).toHaveText(TODO_ITEMS); - await checkNumberOfTodosInLocalStorage(page, 3); - }); -}); - -test.describe('Mark all as completed', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test.afterEach(async ({ page }) => { - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should allow me to mark all items as completed', async ({ page }) => { - // Complete all todos. - await page.getByLabel('Mark all as complete').check(); - - // Ensure all todos have 'completed' class. - await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - }); - - test('should allow me to clear the complete state of all items', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - // Check and then immediately uncheck. - await toggleAll.check(); - await toggleAll.uncheck(); - - // Should be no completed classes. - await expect(page.getByTestId('todo-item')).toHaveClass(['', '', '']); - }); - - test('complete all checkbox should update state when items are completed / cleared', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - await toggleAll.check(); - await expect(toggleAll).toBeChecked(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Uncheck first todo. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').uncheck(); - - // Reuse toggleAll locator and make sure its not checked. - await expect(toggleAll).not.toBeChecked(); - - await firstTodo.getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Assert the toggle all is checked again. - await expect(toggleAll).toBeChecked(); - }); -}); - -test.describe('Item', () => { - - test('should allow me to mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - // Check first item. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').check(); - await expect(firstTodo).toHaveClass('completed'); - - // Check second item. - const secondTodo = page.getByTestId('todo-item').nth(1); - await expect(secondTodo).not.toHaveClass('completed'); - await secondTodo.getByRole('checkbox').check(); - - // Assert completed class. - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).toHaveClass('completed'); - }); - - test('should allow me to un-mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const firstTodo = page.getByTestId('todo-item').nth(0); - const secondTodo = page.getByTestId('todo-item').nth(1); - const firstTodoCheckbox = firstTodo.getByRole('checkbox'); - - await firstTodoCheckbox.check(); - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await firstTodoCheckbox.uncheck(); - await expect(firstTodo).not.toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 0); - }); - - test('should allow me to edit an item', async ({ page }) => { - await createDefaultTodos(page); - - const todoItems = page.getByTestId('todo-item'); - const secondTodo = todoItems.nth(1); - await secondTodo.dblclick(); - await expect(secondTodo.getByRole('textbox', { name: 'Edit' })).toHaveValue(TODO_ITEMS[1]); - await secondTodo.getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await secondTodo.getByRole('textbox', { name: 'Edit' }).press('Enter'); - - // Explicitly assert the new text value. - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2] - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); -}); - -test.describe('Editing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should hide other controls when editing', async ({ page }) => { - const todoItem = page.getByTestId('todo-item').nth(1); - await todoItem.dblclick(); - await expect(todoItem.getByRole('checkbox')).not.toBeVisible(); - await expect(todoItem.locator('label', { - hasText: TODO_ITEMS[1], - })).not.toBeVisible(); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should save edits on blur', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).dispatchEvent('blur'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should trim entered text', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(' buy some sausages '); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should remove the item if an empty text string was entered', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(''); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[2], - ]); - }); - - test('should cancel edits on escape', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Escape'); - await expect(todoItems).toHaveText(TODO_ITEMS); - }); -}); - -test.describe('Counter', () => { - test('should display the current number of todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // create a todo count locator - const todoCount = page.getByTestId('todo-count') - - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - await expect(todoCount).toContainText('1'); - - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - await expect(todoCount).toContainText('2'); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); -}); - -test.describe('Clear completed button', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - }); - - test('should display the correct text', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - }); - - test('should remove completed items when clicked', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).getByRole('checkbox').check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(todoItems).toHaveCount(2); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should be hidden when there are no items that are completed', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeHidden(); - }); -}); - -test.describe('Persistence', () => { - test('should persist its data', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const todoItems = page.getByTestId('todo-item'); - const firstTodoCheck = todoItems.nth(0).getByRole('checkbox'); - await firstTodoCheck.check(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(firstTodoCheck).toBeChecked(); - await expect(todoItems).toHaveClass(['completed', '']); - - // Ensure there is 1 completed item. - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - // Now reload. - await page.reload(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(firstTodoCheck).toBeChecked(); - await expect(todoItems).toHaveClass(['completed', '']); - }); -}); - -test.describe('Routing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - // make sure the app had a chance to save updated todos in storage - // before navigating to a new view, otherwise the items can get lost :( - // in some frameworks like Durandal - await checkTodosInLocalStorage(page, TODO_ITEMS[0]); - }); - - test('should allow me to display active items', async ({ page }) => { - const todoItem = page.getByTestId('todo-item'); - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await expect(todoItem).toHaveCount(2); - await expect(todoItem).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should respect the back button', async ({ page }) => { - const todoItem = page.getByTestId('todo-item'); - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await test.step('Showing all items', async () => { - await page.getByRole('link', { name: 'All' }).click(); - await expect(todoItem).toHaveCount(3); - }); - - await test.step('Showing active items', async () => { - await page.getByRole('link', { name: 'Active' }).click(); - }); - - await test.step('Showing completed items', async () => { - await page.getByRole('link', { name: 'Completed' }).click(); - }); - - await expect(todoItem).toHaveCount(1); - await page.goBack(); - await expect(todoItem).toHaveCount(2); - await page.goBack(); - await expect(todoItem).toHaveCount(3); - }); - - test('should allow me to display completed items', async ({ page }) => { - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Completed' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(1); - }); - - test('should allow me to display all items', async ({ page }) => { - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await page.getByRole('link', { name: 'Completed' }).click(); - await page.getByRole('link', { name: 'All' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(3); - }); - - test('should highlight the currently applied filter', async ({ page }) => { - await expect(page.getByRole('link', { name: 'All' })).toHaveClass('selected'); - - //create locators for active and completed links - const activeLink = page.getByRole('link', { name: 'Active' }); - const completedLink = page.getByRole('link', { name: 'Completed' }); - await activeLink.click(); - - // Page change - active items. - await expect(activeLink).toHaveClass('selected'); - await completedLink.click(); - - // Page change - completed items. - await expect(completedLink).toHaveClass('selected'); - }); -}); - -async function createDefaultTodos(page: Page) { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } -} - -async function checkNumberOfTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).length === e; - }, expected); -} - -async function checkNumberOfCompletedTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).filter((todo: any) => todo.completed).length === e; - }, expected); -} - -async function checkTodosInLocalStorage(page: Page, title: string) { - return await page.waitForFunction(t => { - return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); - }, title); -} diff --git a/tests/tests/example.spec.ts b/tests/tests/example.spec.ts deleted file mode 100644 index 590f33f96c..0000000000 --- a/tests/tests/example.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('has title', async ({ page }) => { - await page.goto('http://localhost:8000/release-notes'); - - // Expect a title "to contain" a substring. - await expect(page).toHaveTitle(/Pantheon Release Notes/); -}); -/* -test('get started link', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Click the get started link. - await page.getByRole('link', { name: 'Get started' }).click(); - - // Expects page to have a heading with the name of Installation. - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -}); -*/ From 189d54d1e9d273ab5e70c0c94dfbcb6775291bb1 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 14:06:05 -0600 Subject: [PATCH 24/63] some cleanup --- gatsby-config.js | 5 ---- gatsby-node.js | 36 +++++++++++-------------- src/components/releaseNoteCategories.js | 2 -- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index ee16d4e5ce..45e5310c82 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -105,11 +105,6 @@ module.exports = { name: `releasenotes`, }, }, - - - - - { resolve: `gatsby-source-filesystem`, options: { diff --git a/gatsby-node.js b/gatsby-node.js index fca7cc8428..c1fed0bba0 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -33,11 +33,11 @@ const calculateSlug = (node, getNode) => { } // This section creates the releasenotes slug based on the YYYY-MM-DD-slug.md template if (getNode(node.parent).absolutePath.includes("releasenotes")) { // If the file is in the releasenotes directory... - const split = fileName.split('-'); // split the file name where hyphenated... - // #todo, wait this should the slug should include all the words after the date, not just the first one. + // split the file name where hyphenated. + const split = fileName.split('-'); // set a const to remaining slug based on the keys from split that are not the date. const remainingSlug = split.slice(3).join('-'); - return `releasenotes/${split[0]}/${split[1]}/${remainingSlug}` // and return a slug of releasenotes/YYYY/MM/slug + return `release-notes/${split[0]}/${split[1]}/${remainingSlug}` // and return a slug of releasenotes/YYYY/MM/slug } return `${fileName}` // Otherwise, as long as there is a filename in GraphQL, use it as the slug. @@ -368,23 +368,6 @@ exports.createPages = ({ graphql, actions }) => { }) }) - - - // Create each release note page. - const releaseNotes = result.data.allReleaseNotes.edges; - releaseNotes.forEach(releaseNote => { - const template = calculateTemplate(releaseNote.node, "releaseNote"); - createPage({ - path: releaseNote.node.fields.slug, - component: path.resolve(`./src/templates/${template}.js`), - context: { - slug: releaseNote.node.fields.slug, - }, - }) - console.log('hello'); - }) - - // Create changelog pagination. const postsPerPage = 6 const numPages = Math.ceil(changelogs.length / postsPerPage) @@ -435,6 +418,18 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // Create each release note page. + const releaseNotes = result.data.allReleaseNotes.edges; + releaseNotes.forEach(releaseNote => { + const template = calculateTemplate(releaseNote.node, "releaseNote"); + createPage({ + path: releaseNote.node.fields.slug, + component: path.resolve(`./src/templates/${template}.js`), + context: { + slug: releaseNote.node.fields.slug, + }, + }) + }) // Create contributor pages. const contributors = result.data.allContributorYaml.edges @@ -603,4 +598,3 @@ exports.onPreBootstrap = () => { /* todo should there be an error thrown if a release note category is set that is not allowed */ /* todo, infer published date from file name. And throw an error if there are files that don't follow the pattern. */ -/* todo, make a json file of allowed categories, description of the category, color name */ diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index d9315937eb..ce5934441c 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -3,8 +3,6 @@ import { Link } from "gatsby" const ReleaseNoteCategories = ({categories}) => { -console.log(categories); - if (!categories) { return null } From 87fe8f08ebf5072207d449406563d5e7f82e2a5a Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 16:13:10 -0600 Subject: [PATCH 25/63] react refactoring --- gatsby-node.js | 2 +- src/components/mdxWrapper.js | 66 +++++++++++++++++++ src/components/releaseNoteTeaser.js | 44 +++++++++++++ .../{releaseNote.js => releaseNotePage.js} | 2 +- src/templates/releaseNotesListing.js | 29 ++------ 5 files changed, 119 insertions(+), 24 deletions(-) create mode 100644 src/components/mdxWrapper.js create mode 100644 src/components/releaseNoteTeaser.js rename src/templates/{releaseNote.js => releaseNotePage.js} (98%) diff --git a/gatsby-node.js b/gatsby-node.js index c1fed0bba0..b7742cd4ed 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -421,7 +421,7 @@ exports.createPages = ({ graphql, actions }) => { // Create each release note page. const releaseNotes = result.data.allReleaseNotes.edges; releaseNotes.forEach(releaseNote => { - const template = calculateTemplate(releaseNote.node, "releaseNote"); + const template = calculateTemplate(releaseNote.node, "releaseNotePage"); createPage({ path: releaseNote.node.fields.slug, component: path.resolve(`./src/templates/${template}.js`), diff --git a/src/components/mdxWrapper.js b/src/components/mdxWrapper.js new file mode 100644 index 0000000000..0b83ffdc68 --- /dev/null +++ b/src/components/mdxWrapper.js @@ -0,0 +1,66 @@ +import React from "react" +import { graphql, Link } from "gatsby" +import { MDXRenderer } from "gatsby-plugin-mdx" +import { MDXProvider } from "@mdx-js/react" + +import Layout from "../layout/layout" +import NavButtons from "../components/navButtons" +import Callout from "../components/callout" +import Alert from "../components/alert" +import Accordion from "../components/accordion" +import ExternalLink from "../components/externalLink" +import Popover from "../components/popover" +import TabList from "../components/tabList" +import Tab from "../components/tab" +import TOC from "../components/toc" +import Card from "../components/card" +import CardGroup from "../components/cardGroup" +import SEO from "../layout/seo" +import Enablement from "../components/enablement" +import Color from "../components/color.js" +import Download from "../components/download" +import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" +// import { releaseNotePseudoQueryFields } from "../data/fragments.js" + + +import { + headline1, + headline2, + headline3, + headline4, +} from "../components/releaseHeadlines" + +import { + Container, + Icon, + Pager, +} from "@pantheon-systems/pds-toolkit-react" + +const shortcodes = { + Callout, + Alert, + Accordion, + ExternalLink, + Popover, + TabList, + Tab, + Card, + CardGroup, + Enablement, + Color, + Download, + h1: headline2, + h2: headline3, + h3: headline4, +} + + + +const MdxWrapper = ({ mdx }) => { + return ( + + {mdx} + + ) +} +export default MdxWrapper diff --git a/src/components/releaseNoteTeaser.js b/src/components/releaseNoteTeaser.js new file mode 100644 index 0000000000..2662d87695 --- /dev/null +++ b/src/components/releaseNoteTeaser.js @@ -0,0 +1,44 @@ +import React from "react" +import { graphql, Link } from "gatsby" +import ReleaseNoteCategories from "../components/releaseNoteCategories" +import MdxWrapper from "../components/mdxWrapper.js" + + + + + + + + +const ReleaseNoteTeaser = ({ key, ReleaseNoteData }) => { + + + console.log("ReleaseNoteData", ReleaseNoteData); + if (!ReleaseNoteData) { + return null + } + + return ( + +
+ +

+ {ReleaseNoteData.frontmatter.title} +

+ + + + + Todo, transform to date format

+ {ReleaseNoteData.frontmatter.published_date} + + + +
+ ) +} + +export default ReleaseNoteTeaser diff --git a/src/templates/releaseNote.js b/src/templates/releaseNotePage.js similarity index 98% rename from src/templates/releaseNote.js rename to src/templates/releaseNotePage.js index ed531080af..3ba62219d4 100644 --- a/src/templates/releaseNote.js +++ b/src/templates/releaseNotePage.js @@ -120,7 +120,7 @@ class ReleaseNoteTemplate extends React.Component { export default ReleaseNoteTemplate export const pageQuery = graphql` - query ChangelogBySlug($slug: String!) { + query ReleaseNoteBySlug($slug: String!) { mdx(fields: { slug: { eq: $slug } }) { id body diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 11d6526236..5b9e447091 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -19,7 +19,9 @@ import SEO from "../layout/seo" import Enablement from "../components/enablement" import Color from "../components/color.js" import Download from "../components/download" -import ReleaseNoteCategories from "../components/releaseNoteCategories" +import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" +import MdxWrapper from "../components/mdxWrapper.js" +// import { releaseNotePseudoQueryFields } from "../data/fragments.js" import { @@ -86,8 +88,6 @@ class ReleaseNotesListingTemplate extends React.Component { render() { const changelogs = this.props.data.allMdx.edges - console.log(changelogs) - console.log(changelogs[0].node.frontmatter.categories) return ( - -

- {changelog.node.frontmatter.title} -

- - Todo, transform to date format

- {changelog.node.frontmatter.published_date} + - Maybe - - - - - {changelog.node.body} - ))} @@ -161,9 +145,10 @@ class ReleaseNotesListingTemplate extends React.Component { export default ReleaseNotesListingTemplate -/* todo remove draft filter from query */ export const pageQuery = graphql` - query Changelogs { + + +query Changelogs { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } From ec6291d41e817b68a84b160d9dfdc7b7ff8f1614 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 16:17:26 -0600 Subject: [PATCH 26/63] more cleanup --- src/templates/releaseNotesListing.js | 81 ++-------------------------- 1 file changed, 5 insertions(+), 76 deletions(-) diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 5b9e447091..9dac75f6f5 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -1,64 +1,19 @@ import React from "react" import { graphql, Link } from "gatsby" -import { MDXRenderer } from "gatsby-plugin-mdx" -import { MDXProvider } from "@mdx-js/react" - import Layout from "../layout/layout" -import NavButtons from "../components/navButtons" -import Callout from "../components/callout" -import Alert from "../components/alert" -import Accordion from "../components/accordion" -import ExternalLink from "../components/externalLink" -import Popover from "../components/popover" -import TabList from "../components/tabList" -import Tab from "../components/tab" -import TOC from "../components/toc" -import Card from "../components/card" -import CardGroup from "../components/cardGroup" import SEO from "../layout/seo" -import Enablement from "../components/enablement" -import Color from "../components/color.js" -import Download from "../components/download" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" -import MdxWrapper from "../components/mdxWrapper.js" // import { releaseNotePseudoQueryFields } from "../data/fragments.js" -import { - headline1, - headline2, - headline3, - headline4, -} from "../components/releaseHeadlines" - import { Container, Icon, - Pager, } from "@pantheon-systems/pds-toolkit-react" -const shortcodes = { - Callout, - Alert, - Accordion, - ExternalLink, - Popover, - TabList, - Tab, - Card, - CardGroup, - Enablement, - Color, - Download, - h1: headline2, - h2: headline3, - h3: headline4, -} - // Set container width for search and main content. const containerWidth = "standard" -// Combined changelog template. class ReleaseNotesListingTemplate extends React.Component { componentDidMount() { $("[data-toggle=popover]").popover({ @@ -87,7 +42,7 @@ class ReleaseNotesListingTemplate extends React.Component { } render() { - const changelogs = this.props.data.allMdx.edges + const releasenotes = this.props.data.allMdx.edges return (

Pantheon Release Notes

-
-

- Sign up for the Pantheon Changelog Newsletter to receive a - monthly email on what's new and improved across the platform. -

- todo link to somewhere other than Pantheon learning.

- - Subscribe Now - - -

- {changelogs.map((changelog) => ( - - - - - - + {releasenotes.map((releasenote) => ( + + ))}
- -
@@ -148,7 +77,7 @@ export default ReleaseNotesListingTemplate export const pageQuery = graphql` -query Changelogs { +query releasenotes { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } From 923eaf8a81a367db1361a3f5be1cd9debb346a24 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 16:57:14 -0600 Subject: [PATCH 27/63] react cleanup --- src/components/mdxWrapper.js | 16 ------------ src/components/releaseNoteTeaser.js | 16 +++--------- src/templates/releaseNotesListing.js | 37 ++-------------------------- 3 files changed, 6 insertions(+), 63 deletions(-) diff --git a/src/components/mdxWrapper.js b/src/components/mdxWrapper.js index 0b83ffdc68..fdef6ab4d5 100644 --- a/src/components/mdxWrapper.js +++ b/src/components/mdxWrapper.js @@ -1,10 +1,6 @@ import React from "react" -import { graphql, Link } from "gatsby" import { MDXRenderer } from "gatsby-plugin-mdx" import { MDXProvider } from "@mdx-js/react" - -import Layout from "../layout/layout" -import NavButtons from "../components/navButtons" import Callout from "../components/callout" import Alert from "../components/alert" import Accordion from "../components/accordion" @@ -12,30 +8,18 @@ import ExternalLink from "../components/externalLink" import Popover from "../components/popover" import TabList from "../components/tabList" import Tab from "../components/tab" -import TOC from "../components/toc" import Card from "../components/card" import CardGroup from "../components/cardGroup" -import SEO from "../layout/seo" import Enablement from "../components/enablement" import Color from "../components/color.js" import Download from "../components/download" -import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" -// import { releaseNotePseudoQueryFields } from "../data/fragments.js" - import { - headline1, headline2, headline3, headline4, } from "../components/releaseHeadlines" -import { - Container, - Icon, - Pager, -} from "@pantheon-systems/pds-toolkit-react" - const shortcodes = { Callout, Alert, diff --git a/src/components/releaseNoteTeaser.js b/src/components/releaseNoteTeaser.js index 2662d87695..b7d50265dc 100644 --- a/src/components/releaseNoteTeaser.js +++ b/src/components/releaseNoteTeaser.js @@ -1,25 +1,16 @@ import React from "react" -import { graphql, Link } from "gatsby" +import { Link } from "gatsby" import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" +const ReleaseNoteTeaser = ({ ReleaseNoteData }) => { - - - - - - -const ReleaseNoteTeaser = ({ key, ReleaseNoteData }) => { - - - console.log("ReleaseNoteData", ReleaseNoteData); if (!ReleaseNoteData) { return null } return ( - +
{
+
) } diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 9dac75f6f5..e6603509a8 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -1,45 +1,18 @@ import React from "react" -import { graphql, Link } from "gatsby" +import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" // import { releaseNotePseudoQueryFields } from "../data/fragments.js" - import { Container, - Icon, } from "@pantheon-systems/pds-toolkit-react" // Set container width for search and main content. const containerWidth = "standard" class ReleaseNotesListingTemplate extends React.Component { - componentDidMount() { - $("[data-toggle=popover]").popover({ - trigger: "click", - }) - - $("body").on("click", function (e) { - $('[data-toggle="popover"]').each(function () { - if ( - !$(this).is(e.target) && - $(this).has(e.target).length === 0 && - $(".popover").has(e.target).length === 0 - ) { - $(this).popover("hide") - } - }) - }) - - $("body").keyup(function (e) { - $('[data-toggle="popover"]').each(function () { - if (event.which === 27) { - $(this).popover("hide") - } - }) - }) - } render() { const releasenotes = this.props.data.allMdx.edges @@ -55,15 +28,11 @@ class ReleaseNotesListingTemplate extends React.Component {

Pantheon Release Notes


-
{releasenotes.map((releasenote) => ( - - - + ))}
-
@@ -75,8 +44,6 @@ class ReleaseNotesListingTemplate extends React.Component { export default ReleaseNotesListingTemplate export const pageQuery = graphql` - - query releasenotes { allMdx( filter: { From 1b7016381c27c83643bb55a68444c03cfa3d8776 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 17:12:30 -0600 Subject: [PATCH 28/63] refactor --- .../releaseNotesListingByCategory.js | 142 ++---------------- 1 file changed, 10 insertions(+), 132 deletions(-) diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index e7436942b4..ae7f5262ab 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -1,157 +1,36 @@ import React from "react" -import { graphql, Link } from "gatsby" -import { MDXRenderer } from "gatsby-plugin-mdx" -import { MDXProvider } from "@mdx-js/react" - +import { graphql } from "gatsby" import Layout from "../layout/layout" -import NavButtons from "../components/navButtons" -import Callout from "../components/callout" -import Alert from "../components/alert" -import Accordion from "../components/accordion" -import ExternalLink from "../components/externalLink" -import Popover from "../components/popover" -import TabList from "../components/tabList" -import Tab from "../components/tab" -import TOC from "../components/toc" -import Card from "../components/card" -import CardGroup from "../components/cardGroup" import SEO from "../layout/seo" -import Enablement from "../components/enablement" -import Color from "../components/color.js" -import Download from "../components/download" -import ReleaseNoteCategories from "../components/releaseNoteCategories" - - -import { - headline1, - headline2, - headline3, - headline4, -} from "../components/releaseHeadlines" +import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" +import { Container } from "@pantheon-systems/pds-toolkit-react" -import { - Container, - Icon, - Pager, -} from "@pantheon-systems/pds-toolkit-react" - -const shortcodes = { - Callout, - Alert, - Accordion, - ExternalLink, - Popover, - TabList, - Tab, - Card, - CardGroup, - Enablement, - Color, - Download, - h1: headline2, - h2: headline3, - h3: headline4, -} // Set container width for search and main content. const containerWidth = "standard" -// Combined changelog template. class ReleaseNotesListingByCategoryTemplate extends React.Component { - componentDidMount() { - $("[data-toggle=popover]").popover({ - trigger: "click", - }) - - $("body").on("click", function (e) { - $('[data-toggle="popover"]').each(function () { - if ( - !$(this).is(e.target) && - $(this).has(e.target).length === 0 && - $(".popover").has(e.target).length === 0 - ) { - $(this).popover("hide") - } - }) - }) - - $("body").keyup(function (e) { - $('[data-toggle="popover"]').each(function () { - if (event.which === 27) { - $(this).popover("hide") - } - }) - }) - } render() { - const changelogs = this.props.data.allMdx.edges - console.log(changelogs) - console.log(changelogs[0].node.frontmatter.categories) + const releasenotes = this.props.data.allMdx.edges return (
-

Pantheon Release Notes

-
-

- Sign up for the Pantheon Changelog Newsletter to receive a - monthly email on what's new and improved across the platform. -

- todo link to somewhere other than Pantheon learning.

- - Subscribe Now - - -
+

Pantheon Release Notes: TODO get variable in headline


-
- {changelogs.map((changelog) => ( - - - - -

- {changelog.node.frontmatter.title} -

- - - Todo, transform to date format

- {changelog.node.frontmatter.published_date} - - Maybe - - - - - {changelog.node.body} - -
+ {releasenotes.map((releasenote) => ( + ))} -
- -
@@ -161,9 +40,8 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component { export default ReleaseNotesListingByCategoryTemplate -/* todo remove draft filter from query */ export const pageQuery = graphql` - query Changelogs($category: String!) { + query releasenotes($category: String!) { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } From f4460a0f245693358f734154d188c26324df689e Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 17:44:26 -0600 Subject: [PATCH 29/63] release notes cat handling --- src/data/releaseNoteCategories.js | 10 ++++++++++ src/templates/releaseNotesListingByCategory.js | 12 ++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/data/releaseNoteCategories.js diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js new file mode 100644 index 0000000000..fe03110d4c --- /dev/null +++ b/src/data/releaseNoteCategories.js @@ -0,0 +1,10 @@ +export const releaseNoteCategories = { + "security": { + "displayName": "Security", + "color": "red" + }, + "documentation": { + "displayName": "Documentation", + "color": "purple" + }, +}; diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index ae7f5262ab..967a91e50d 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -4,25 +4,29 @@ import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" import { Container } from "@pantheon-systems/pds-toolkit-react" - +import {releaseNoteCategories} from "../data/releaseNoteCategories.js" // Set container width for search and main content. const containerWidth = "standard" + class ReleaseNotesListingByCategoryTemplate extends React.Component { render() { const releasenotes = this.props.data.allMdx.edges + const categorySlug = this.props.pageContext.category; + const categoryDisplayName = releaseNoteCategories[categorySlug]["displayName"]; + return (
-

Pantheon Release Notes: TODO get variable in headline

+

Pantheon Release Notes: {categoryDisplayName}


From b77039e3ab2f61af463cea54baefa7d34a8c1d67 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 17:54:14 -0600 Subject: [PATCH 30/63] using color --- gatsby-node.js | 2 +- src/components/releaseNoteCategories.js | 12 +++++++++--- src/templates/releaseNotesListingByCategory.js | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index b7742cd4ed..87a89b8578 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -395,7 +395,7 @@ exports.createPages = ({ graphql, actions }) => { path: `/release-notes/`, component: path.resolve("./src/templates/releaseNotesListing.js"), }) - + // @todo, switch to "../data/releaseNoteCategories.js" const allowedReleaseNoteCategories = { "security": { "Display Name": "Security", diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index ce5934441c..642eed89ac 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -1,5 +1,8 @@ import React from "react" import { Link } from "gatsby" +import { releaseNoteCategories } from "../data/releaseNoteCategories.js" + + const ReleaseNoteCategories = ({categories}) => { @@ -15,13 +18,16 @@ if (!categories) { :

Categories:

} - {categories.map((category, index) => ( + + {categories.map((categorySlug, index) => ( + +
-

{category}

+

{releaseNoteCategories[categorySlug].displayName}

diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index 967a91e50d..9cfabf0399 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -3,8 +3,9 @@ import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" +import { releaseNoteCategories } from "../data/releaseNoteCategories.js" import { Container } from "@pantheon-systems/pds-toolkit-react" -import {releaseNoteCategories} from "../data/releaseNoteCategories.js" + // Set container width for search and main content. const containerWidth = "standard" From 324f6e683ed85f46e371f197b28183f3a82c01ca Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 17:56:59 -0600 Subject: [PATCH 31/63] moving around code block --- gatsby-node.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 87a89b8578..013d3a2cbd 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -336,21 +336,6 @@ exports.createPages = ({ graphql, actions }) => { } }) - // Create Terminus Command pages - const terminusCommands = result.data.dataJson.commands - terminusCommands.forEach(command => { - const slugRegExp = /:/g - const slug = command.name.replace(slugRegExp, "-") - createPage({ - path: `terminus/commands/${slug}`, - component: path.resolve(`./src/templates/terminusCommand.js`), - context: { - slug: slug, - name: command.name - } - }) - }) - // Create changelog pages. const changelogs = result.data.allChangelogs.edges changelogs.forEach(changelog => { @@ -389,6 +374,21 @@ exports.createPages = ({ graphql, actions }) => { }) }) + // Create Terminus Command pages + const terminusCommands = result.data.dataJson.commands + terminusCommands.forEach(command => { + const slugRegExp = /:/g + const slug = command.name.replace(slugRegExp, "-") + createPage({ + path: `terminus/commands/${slug}`, + component: path.resolve(`./src/templates/terminusCommand.js`), + context: { + slug: slug, + name: command.name + } + }) + }) + // Create release notes without pagination. At a later date, we may want to add pagination. // And can reused the code above. createPage({ From eef17418d5ba019c7ef3e99a8ee81aca00d7df74 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 17:58:48 -0600 Subject: [PATCH 32/63] whitespace --- gatsby-node.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 013d3a2cbd..5d499a3a8f 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -227,7 +227,6 @@ exports.createPages = ({ graphql, actions }) => { } } - allChangelogs: allMdx( filter: { fileAbsolutePath: { regex: "/changelogs/"} @@ -529,7 +528,6 @@ exports.onCreateNode = ({ node, getNode, actions }) => { value: excerpt, }) - const textNode = { id: `${node.id}-MarkdownBody`, parent: node.id, From c825dae9fdd19869388dffc8180ba02b78844d44 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 18:03:27 -0600 Subject: [PATCH 33/63] more clean up --- src/templates/releaseNotePage.js | 66 +------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 3ba62219d4..110d5dcc18 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -1,76 +1,18 @@ import React from "react" import { graphql } from "gatsby" -import { MDXRenderer } from "gatsby-plugin-mdx" -import { MDXProvider } from "@mdx-js/react" - import Layout from "../layout/layout" -import NavButtons from "../components/navButtons" -import Alert from "../components/alert" -import Accordion from "../components/accordion" -import ExternalLink from "../components/externalLink" -import Popover from "../components/popover" -import TabList from "../components/tabList" -import Tab from "../components/tab" -import TOC from "../components/toc" -import Card from "../components/card" -import CardGroup from "../components/cardGroup" import SEO from "../layout/seo" -import Enablement from "../components/enablement" -import Color from "../components/color.js" -import Download from "../components/download" import ReleaseNoteCategories from "../components/releaseNoteCategories" - - +import MdxWrapper from "../components/mdxWrapper.js" import { Container, - Icon, - Pager, SidebarLayout, } from "@pantheon-systems/pds-toolkit-react" -const shortcodes = { - Alert, - Accordion, - ExternalLink, - Popover, - TabList, - Tab, - Card, - CardGroup, - Enablement, - Color, - Download, -} - // Set container width for search and main content. const containerWidth = "standard" class ReleaseNoteTemplate extends React.Component { - componentDidMount() { - $("[data-toggle=popover]").popover({ - trigger: "click", - }) - - $("body").on("click", function (e) { - $('[data-toggle="popover"]').each(function () { - if ( - !$(this).is(e.target) && - $(this).has(e.target).length === 0 && - $(".popover").has(e.target).length === 0 - ) { - $(this).popover("hide") - } - }) - }) - - $("body").keyup(function (e) { - $('[data-toggle="popover"]').each(function () { - if (event.which === 27) { - $(this).popover("hide") - } - }) - }) - } render() { const node = this.props.data.mdx @@ -90,9 +32,7 @@ class ReleaseNoteTemplate extends React.Component {

{node.frontmatter.title}

-
-
- - {node.body} - +
From 031bfd2c0fecc688253561bb4b7c7f9ea9ad485b Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 18:14:01 -0600 Subject: [PATCH 34/63] date component --- src/components/formattedPublishedDate.js | 31 ++++++++++++++++++++++++ src/components/releaseNoteTeaser.js | 8 ++---- src/templates/releaseNotePage.js | 6 ++--- 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 src/components/formattedPublishedDate.js diff --git a/src/components/formattedPublishedDate.js b/src/components/formattedPublishedDate.js new file mode 100644 index 0000000000..a01245d2df --- /dev/null +++ b/src/components/formattedPublishedDate.js @@ -0,0 +1,31 @@ +import React from "react" + + + +const FormattedPublishedDate = ({ dateString }) => { + + // Todo, more type checking. + if (!dateString) { + return null + } + + // Turn ReleaseNoteData.frontmatter.published_date into a date object. + // And then format it as Month Day, Year. + // https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date + const date = new Date(dateString); + const options = { year: 'numeric', month: 'long', day: 'numeric' }; + const formattedDate = date.toLocaleDateString(undefined, options); + + + return ( +
+ + {formattedDate} + + +
+ + ) +} + +export default FormattedPublishedDate diff --git a/src/components/releaseNoteTeaser.js b/src/components/releaseNoteTeaser.js index b7d50265dc..5aa97f34e3 100644 --- a/src/components/releaseNoteTeaser.js +++ b/src/components/releaseNoteTeaser.js @@ -2,6 +2,7 @@ import React from "react" import { Link } from "gatsby" import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" +import FormattedPublishedDate from "./formattedPublishedDate.js" const ReleaseNoteTeaser = ({ ReleaseNoteData }) => { @@ -21,13 +22,8 @@ const ReleaseNoteTeaser = ({ ReleaseNoteData }) => { - - - Todo, transform to date format

- {ReleaseNoteData.frontmatter.published_date} - + - ) diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 110d5dcc18..41b72328f8 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -4,6 +4,8 @@ import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" +import FormattedPublishedDate from "../components/formattedPublishedDate.js" + import { Container, SidebarLayout, @@ -39,12 +41,10 @@ class ReleaseNoteTemplate extends React.Component { className="changelog changelog--individual" >
-
- +
-
From 37248a8a2d697740f391350d4a8faa6db1e35309 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 20:27:45 -0600 Subject: [PATCH 35/63] release notes are kind of working --- src/templates/releaseNotePage.js | 40 +++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 41b72328f8..63333603b3 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -57,7 +57,15 @@ class ReleaseNoteTemplate extends React.Component { export default ReleaseNoteTemplate -export const pageQuery = graphql` +const frontMatterFields = ` + frontmatter { + title + published_date + categories + } +`; +/* +const theQuery = ` query ReleaseNoteBySlug($slug: String!) { mdx(fields: { slug: { eq: $slug } }) { id @@ -73,3 +81,33 @@ export const pageQuery = graphql` } } ` +export const pageQuery = graphql( + {query: theQuery} + ); + +*/ + +export const pageQuery = graphql` + + fragment releaseNotedFields on Mdx { + id + body + } + +query ReleaseNoteBySlug($slug: String!) { + + + + mdx(fields: { slug: { eq: $slug } }) { + ...releaseNotedFields + + fields { + slug + } + frontmatter { + title, + published_date, + categories + } + } + }` From 4bce369db990e075375377dd561d2abaad1b6bd9 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 21:57:56 -0600 Subject: [PATCH 36/63] a sort of working fragment --- src/templates/releaseNotePage.js | 35 ++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 63333603b3..1072258639 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -5,7 +5,7 @@ import SEO from "../layout/seo" import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" import FormattedPublishedDate from "../components/formattedPublishedDate.js" - +import { releaseNotedFraggy } from "../fragments/releaseNote.js" import { Container, SidebarLayout, @@ -87,20 +87,10 @@ export const pageQuery = graphql( */ -export const pageQuery = graphql` - - fragment releaseNotedFields on Mdx { +export const somefields = graphql` + fragment theReleaseNoteFields on Mdx { id body - } - -query ReleaseNoteBySlug($slug: String!) { - - - - mdx(fields: { slug: { eq: $slug } }) { - ...releaseNotedFields - fields { slug } @@ -109,5 +99,24 @@ query ReleaseNoteBySlug($slug: String!) { published_date, categories } + +} + + +` + + +export const pageQuery = graphql` + + + +query ReleaseNoteBySlug($slug: String!) { + + + + mdx(fields: { slug: { eq: $slug } }) { + ...theReleaseNoteFields + + } }` From ed01dc78b0e967d8b62d86e6e68214b6b2206309 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 21:58:56 -0600 Subject: [PATCH 37/63] fragment cleanup --- src/templates/releaseNotePage.js | 42 +------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 1072258639..275aec1835 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -57,35 +57,7 @@ class ReleaseNoteTemplate extends React.Component { export default ReleaseNoteTemplate -const frontMatterFields = ` - frontmatter { - title - published_date - categories - } -`; -/* -const theQuery = ` - query ReleaseNoteBySlug($slug: String!) { - mdx(fields: { slug: { eq: $slug } }) { - id - body - fields { - slug - } - frontmatter { - title, - published_date, - categories - } - } - } -` -export const pageQuery = graphql( - {query: theQuery} - ); -*/ export const somefields = graphql` fragment theReleaseNoteFields on Mdx { @@ -99,24 +71,12 @@ export const somefields = graphql` published_date, categories } - -} - - -` +}` export const pageQuery = graphql` - - - query ReleaseNoteBySlug($slug: String!) { - - - mdx(fields: { slug: { eq: $slug } }) { ...theReleaseNoteFields - - } }` From e3b73f1a71547b63165899ed5a760865eb516c9b Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 21:59:41 -0600 Subject: [PATCH 38/63] trying to make fragment a fragment in a different file --- src/fragments/releaseNote.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/fragments/releaseNote.js diff --git a/src/fragments/releaseNote.js b/src/fragments/releaseNote.js new file mode 100644 index 0000000000..6574104e69 --- /dev/null +++ b/src/fragments/releaseNote.js @@ -0,0 +1,7 @@ +import { graphql } from "gatsby" + +export const releaseNotedFraggy = graphql` + fragment releaseNotedFraggy on Mdx { + id + }` + From 983b619ce5f4d34981fb1fcb82973e50ad77ba8f Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 22:03:14 -0600 Subject: [PATCH 39/63] moving fragment to other file --- src/fragments/releaseNote.js | 15 +++++++++++++++ src/templates/releaseNotePage.js | 17 +---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/fragments/releaseNote.js b/src/fragments/releaseNote.js index 6574104e69..3d7e087ac5 100644 --- a/src/fragments/releaseNote.js +++ b/src/fragments/releaseNote.js @@ -1,5 +1,20 @@ import { graphql } from "gatsby" +export const somefields = graphql` + fragment theReleaseNoteFields on Mdx { + id + body + fields { + slug + } + frontmatter { + title, + published_date, + categories + } +}` + + export const releaseNotedFraggy = graphql` fragment releaseNotedFraggy on Mdx { id diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 275aec1835..93cb219865 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -5,6 +5,7 @@ import SEO from "../layout/seo" import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" import FormattedPublishedDate from "../components/formattedPublishedDate.js" +// This is used to get the fields from the MDX file. import { releaseNotedFraggy } from "../fragments/releaseNote.js" import { Container, @@ -58,22 +59,6 @@ class ReleaseNoteTemplate extends React.Component { export default ReleaseNoteTemplate - -export const somefields = graphql` - fragment theReleaseNoteFields on Mdx { - id - body - fields { - slug - } - frontmatter { - title, - published_date, - categories - } -}` - - export const pageQuery = graphql` query ReleaseNoteBySlug($slug: String!) { mdx(fields: { slug: { eq: $slug } }) { From 53152808e307bd0414fe7e502ed8b0382de24919 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 23:44:08 -0600 Subject: [PATCH 40/63] breakthrough --- gatsby-node.js | 22 ++++++++++++++++++++++ src/fragments/releaseNote.js | 7 ------- src/templates/releaseNotePage.js | 2 +- src/templates/releaseNotesListing.js | 21 ++++++++++----------- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 5d499a3a8f..5cd3deaeea 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -10,6 +10,28 @@ https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/ The contents of this file define how the source content is converted into web pages. It is prime for refactoring. */ +/* +exports.createResolvers = ({ createResolvers }) => { + createResolvers({ + Query: { + // Include the fragment in every query + releaseNotedFraggy: { + type: "Mdx", // Adjust the type based on your schema + resolve: () => ({}), + }, + releaseNotedFraggy: { + type: "Node", // Adjust the type based on your schema + resolve: () => ({}), + }, + body: { + type: "Node", // Adjust the type based on your schema + resolve: () => ({}), + }, + }, + }); +}; + +*/ /** This helper function determines what slug a piece of content will use */ diff --git a/src/fragments/releaseNote.js b/src/fragments/releaseNote.js index 3d7e087ac5..79e6cb5654 100644 --- a/src/fragments/releaseNote.js +++ b/src/fragments/releaseNote.js @@ -13,10 +13,3 @@ export const somefields = graphql` categories } }` - - -export const releaseNotedFraggy = graphql` - fragment releaseNotedFraggy on Mdx { - id - }` - diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index 93cb219865..d60515b0d9 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -6,7 +6,7 @@ import ReleaseNoteCategories from "../components/releaseNoteCategories" import MdxWrapper from "../components/mdxWrapper.js" import FormattedPublishedDate from "../components/formattedPublishedDate.js" // This is used to get the fields from the MDX file. -import { releaseNotedFraggy } from "../fragments/releaseNote.js" +import { releaseNoteFragment } from "../fragments/releaseNote.js" import { Container, SidebarLayout, diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index e6603509a8..12a3878876 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -3,12 +3,16 @@ import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" -// import { releaseNotePseudoQueryFields } from "../data/fragments.js" +import ReleaseNoteTeaserBySlug from "../components/releaseNoteTeaserBySlug.js" +import { releaseNoteFragment } from "../fragments/releaseNote.js" + import { Container, } from "@pantheon-systems/pds-toolkit-react" + + // Set container width for search and main content. const containerWidth = "standard" @@ -30,6 +34,7 @@ class ReleaseNotesListingTemplate extends React.Component {
{releasenotes.map((releasenote) => ( + ))}
@@ -44,7 +49,8 @@ class ReleaseNotesListingTemplate extends React.Component { export default ReleaseNotesListingTemplate export const pageQuery = graphql` -query releasenotes { + +query releasenotesListing { allMdx( filter: { fileAbsolutePath: { regex: "/releasenotes/" } @@ -53,15 +59,8 @@ query releasenotes { ) { edges { node { - id - body - frontmatter { - title, - published_date, - categories, - } - fields { - slug + ... on Mdx { + ...theReleaseNoteFields } } } From a3e91c6db862c1914210f43f5add695c370a4084 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Tue, 2 Jan 2024 23:48:08 -0600 Subject: [PATCH 41/63] fragment again --- src/fragments/releaseNote.js | 2 +- src/templates/releaseNotePage.js | 1 - src/templates/releaseNotesListing.js | 1 - src/templates/releaseNotesListingByCategory.js | 11 +---------- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/fragments/releaseNote.js b/src/fragments/releaseNote.js index 79e6cb5654..6aad884608 100644 --- a/src/fragments/releaseNote.js +++ b/src/fragments/releaseNote.js @@ -1,6 +1,6 @@ import { graphql } from "gatsby" -export const somefields = graphql` +export const releaseNoteFragment = graphql` fragment theReleaseNoteFields on Mdx { id body diff --git a/src/templates/releaseNotePage.js b/src/templates/releaseNotePage.js index d60515b0d9..2b92814e60 100644 --- a/src/templates/releaseNotePage.js +++ b/src/templates/releaseNotePage.js @@ -58,7 +58,6 @@ class ReleaseNoteTemplate extends React.Component { export default ReleaseNoteTemplate - export const pageQuery = graphql` query ReleaseNoteBySlug($slug: String!) { mdx(fields: { slug: { eq: $slug } }) { diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 12a3878876..5821622ba8 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -3,7 +3,6 @@ import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" -import ReleaseNoteTeaserBySlug from "../components/releaseNoteTeaserBySlug.js" import { releaseNoteFragment } from "../fragments/releaseNote.js" diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index 9cfabf0399..6a82b6542d 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -56,16 +56,7 @@ export const pageQuery = graphql` ) { edges { node { - id - body - frontmatter { - title, - published_date, - categories, - } - fields { - slug - } + ...theReleaseNoteFields } } } From 8a84152c563d743c97de3bba61315d403ee0886d Mon Sep 17 00:00:00 2001 From: Rachel Whitton Date: Thu, 4 Jan 2024 11:59:39 -0600 Subject: [PATCH 42/63] Define attributes for all 'Release Notes' categories in JSON --- src/data/releaseNoteCategories.js | 111 ++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/data/releaseNoteCategories.js diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js new file mode 100644 index 0000000000..e965b4fa6e --- /dev/null +++ b/src/data/releaseNoteCategories.js @@ -0,0 +1,111 @@ +export const releaseNoteCategories = { + "action-required": { + "displayName": "Action Required", + "color": "red", + "description": "Requires customer to act in order to avoid disruption" + }, + "drupal": { + "displayName": "Drupal", + "color": "black", + "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" + }, + "new-feature": { + "displayName": "New Feature", + "color": "green", + "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" + }, + "front-end-sites": { + "displayName": "Front-End Sites", + "color": "purple", + "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" + }, + "infrastructure": { + "displayName": "Infrastructure", + "color": "black", + "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" + }, + "security": { + "displayName": "Security", + "color": "red", + "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" + }, + "tools-apis": { + "displayName": "Tools & APIs", + "color": "black", + "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" + }, + "wordpress": { + "displayName": "WordPress", + "color": "black", + "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" + }, + "performance": { + "displayName": "Performance", + "color": "black", + "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" + }, + "user-interface": { + "displayName": "User interface", + "color": "black", + "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" + }, + "account-management": { + "displayName": "Account Management", + "color": "black", + "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" + }, + "policy": { + "displayName": "Policy", + "color": "gray", + "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" + }, + "content-management": { + "displayName": "Content Management", + "color": "gray", + "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" + }, + "deprecated": { + "displayName": "Deprecated", + "color": "red", + "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" + }, + "events": { + "displayName": "Events", + "color": "gray", + "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" + }, + "general": { + "displayName": "General", + "color": "gray", + "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" + }, + "issue-bug": { + "displayName": "Issue/Bug", + "color": "gray", + "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" + }, + "migration": { + "displayName": "Migration", + "color": "gray", + "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" + }, + "integration": { + "displayName": "", + "color": "gray", + "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" + }, + "platform": { + "displayName": "Platform", + "color": "gray", + "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" + }, + "documentation" : { + "displayName": "Documentation", + "color": "gray", + "description": "Communicates substantive changes to docs.pantheon.io", + "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", + "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." + } +}; From 95d9dd55f49b48f8b8d545a7f5f1b8a9f48aa4f7 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 13:28:13 -0600 Subject: [PATCH 43/63] adding todo about description --- src/templates/releaseNotesListingByCategory.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index 6a82b6542d..f5f2eb72d3 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -6,11 +6,9 @@ import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" import { releaseNoteCategories } from "../data/releaseNoteCategories.js" import { Container } from "@pantheon-systems/pds-toolkit-react" - // Set container width for search and main content. const containerWidth = "standard" - class ReleaseNotesListingByCategoryTemplate extends React.Component { render() { @@ -28,6 +26,7 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component {

Pantheon Release Notes: {categoryDisplayName}

+ TODO Render the category description here.
From 5f4a60dada8ce5960e62ce1cae16ffac9eb5afb7 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 13:37:02 -0600 Subject: [PATCH 44/63] fixing merge error --- src/data/releaseNoteCategories.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js index 20dfb98e08..3001757d2e 100644 --- a/src/data/releaseNoteCategories.js +++ b/src/data/releaseNoteCategories.js @@ -116,5 +116,4 @@ export const releaseNoteCategories = { "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." } ->>>>>>> origin/backfill-release-notes }; From 6c646d2957cf7406be5277da7bf565e4f149b949 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 14:05:47 -0600 Subject: [PATCH 45/63] starting category selector component --- gatsby-node.js | 23 ---------- src/components/releaseNoteCategorySelector.js | 45 +++++++++++++++++++ src/data/releaseNoteCategories.js | 11 +---- src/templates/releaseNotesListing.js | 2 + 4 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 src/components/releaseNoteCategorySelector.js diff --git a/gatsby-node.js b/gatsby-node.js index 5cd3deaeea..208cdb056d 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -10,29 +10,6 @@ https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/ The contents of this file define how the source content is converted into web pages. It is prime for refactoring. */ -/* -exports.createResolvers = ({ createResolvers }) => { - createResolvers({ - Query: { - // Include the fragment in every query - releaseNotedFraggy: { - type: "Mdx", // Adjust the type based on your schema - resolve: () => ({}), - }, - releaseNotedFraggy: { - type: "Node", // Adjust the type based on your schema - resolve: () => ({}), - }, - body: { - type: "Node", // Adjust the type based on your schema - resolve: () => ({}), - }, - }, - }); -}; - -*/ - /** This helper function determines what slug a piece of content will use */ const calculateSlug = (node, getNode) => { diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js new file mode 100644 index 0000000000..ba7810d1dc --- /dev/null +++ b/src/components/releaseNoteCategorySelector.js @@ -0,0 +1,45 @@ +import React from "react" +import { Link } from "gatsby" +import { releaseNoteCategories } from "../data/releaseNoteCategories.js" + + + + +const ReleaseNoteCategorySelector = (currentCategorySlug) => { + + + + return ( +
+ These are all the categories! + +
    +{ +// Loop through the categories and create a list of links to each category. +Object.keys(releaseNoteCategories).map((categorySlug, index) => ( +
  • + + { // If the current category is the same as the category we're looping through, add a checkmark. + currentCategorySlug === categorySlug && + + } + + {releaseNoteCategories[categorySlug].displayName} + + + +
  • +)) +} +
+ +
+ + ) +} + +export default ReleaseNoteCategorySelector diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js index 3001757d2e..2a67c45534 100644 --- a/src/data/releaseNoteCategories.js +++ b/src/data/releaseNoteCategories.js @@ -1,12 +1,5 @@ export const releaseNoteCategories = { - "security": { - "displayName": "Security", - "color": "red" - }, - "documentation": { - "displayName": "Documentation", - "color": "purple" - }, + "action-required": { "displayName": "Action Required", "color": "red", @@ -98,7 +91,7 @@ export const releaseNoteCategories = { "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" }, "integration": { - "displayName": "", + "displayName": "Integration", "color": "gray", "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" diff --git a/src/templates/releaseNotesListing.js b/src/templates/releaseNotesListing.js index 5821622ba8..b75c3142e2 100644 --- a/src/templates/releaseNotesListing.js +++ b/src/templates/releaseNotesListing.js @@ -3,6 +3,7 @@ import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" +import ReleaseNoteCategorySelector from "../components/releaseNoteCategorySelector.js" import { releaseNoteFragment } from "../fragments/releaseNote.js" @@ -29,6 +30,7 @@ class ReleaseNotesListingTemplate extends React.Component {

Pantheon Release Notes

+
From 48f6b301a1f704d46e01d0ee2e0406d5d5079b52 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 14:37:24 -0600 Subject: [PATCH 46/63] menu --- src/components/releaseNoteCategorySelector.js | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index ba7810d1dc..901977e867 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -2,9 +2,13 @@ import React from "react" import { Link } from "gatsby" import { releaseNoteCategories } from "../data/releaseNoteCategories.js" +import { +MenuButton +} from "@pantheon-systems/pds-toolkit-react" +const categoryLinks = []; const ReleaseNoteCategorySelector = (currentCategorySlug) => { @@ -14,7 +18,10 @@ const ReleaseNoteCategorySelector = (currentCategorySlug) => { These are all the categories!
    + + { + // Loop through the categories and create a list of links to each category. Object.keys(releaseNoteCategories).map((categorySlug, index) => (
  • @@ -37,8 +44,40 @@ Object.keys(releaseNoteCategories).map((categorySlug, index) => ( }
+
+ and another way + + { + + // Loop through the categories and create a list of links to each category. + Object.keys(releaseNoteCategories).map((categorySlug, index) => ( + + + {releaseNoteCategories[categorySlug].displayName} + + + )) + } + + + +
+ + + +
+ + + + + + ) } From 1cbc0d51d25de4e5423b1c406ca21ed330acd700 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 15:46:58 -0600 Subject: [PATCH 47/63] switching to NavMenu --- src/components/releaseNoteCategorySelector.js | 88 +++++++++++++++---- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 901977e867..d8d66def5c 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -3,12 +3,75 @@ import { Link } from "gatsby" import { releaseNoteCategories } from "../data/releaseNoteCategories.js" import { -MenuButton +MenuButton, + NavMenu, } from "@pantheon-systems/pds-toolkit-react" +const mainNavigationLinks = [ + { + label: { + linkContent: ( + + Docs Home + + ), + }, + links: [ + { + linkContent: ( + + Docs Home + + ), + }, + { + linkContent: ( + + Get Started + + ), + }, +]} + +] + + +const releaseNoteCategoryLinks = function () { + + const links = [ + + ]; + // loop over the categories and add the displayName to the links array + Object.keys(releaseNoteCategories).map((categorySlug, index) => ( + links.push( + + + { + linkContent: ( + + { + releaseNoteCategories[categorySlug].displayName + + } + + ), + }, + + + ) + )) + return links; + +} + + + + +// Loop through the categories and create a list of links to each category. + + -const categoryLinks = []; const ReleaseNoteCategorySelector = (currentCategorySlug) => { @@ -46,23 +109,10 @@ Object.keys(releaseNoteCategories).map((categorySlug, index) => (
and another way - - { - - // Loop through the categories and create a list of links to each category. - Object.keys(releaseNoteCategories).map((categorySlug, index) => ( - - - {releaseNoteCategories[categorySlug].displayName} - - - )) - } - +
From fe33cd4df51d363d590d3a274c6f99376a1bf0cc Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 16:05:54 -0600 Subject: [PATCH 48/63] two ways to do category selection --- src/components/releaseNoteCategorySelector.js | 95 +++++-------------- .../releaseNotesListingByCategory.js | 2 + 2 files changed, 28 insertions(+), 69 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index d8d66def5c..6f0ed401ca 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -8,36 +8,26 @@ MenuButton, } from "@pantheon-systems/pds-toolkit-react" -const mainNavigationLinks = [ - { - label: { - linkContent: ( - - Docs Home - - ), - }, - links: [ - { - linkContent: ( - - Docs Home - - ), - }, - { - linkContent: ( - - Get Started - - ), - }, -]} -] -const releaseNoteCategoryLinks = function () { +const releaseNoteCategoryMenuLinks = function (currentCategorySlug) { + const menuArray = [] + + // loop over the categories and add the displayName to the links array + Object.keys(releaseNoteCategories).map((categorySlug, index) => ( + menuArray.push( + { + "label": releaseNoteCategories[categorySlug].displayName, + "callback": () => { window.location.href = `/release-notes/${categorySlug}` }, + } + ) + )) + + return menuArray; +} + +const releaseNoteCategoryLinks = function (currentCategorySlug) { const links = [ @@ -49,7 +39,7 @@ const releaseNoteCategoryLinks = function () { { linkContent: ( - + { releaseNoteCategories[categorySlug].displayName @@ -62,61 +52,28 @@ const releaseNoteCategoryLinks = function () { ) )) return links; - } - - // Loop through the categories and create a list of links to each category. - - - const ReleaseNoteCategorySelector = (currentCategorySlug) => { - - - return (
- These are all the categories! - -
    - - -{ - -// Loop through the categories and create a list of links to each category. -Object.keys(releaseNoteCategories).map((categorySlug, index) => ( -
  • - - { // If the current category is the same as the category we're looping through, add a checkmark. - currentCategorySlug === categorySlug && - - } - - {releaseNoteCategories[categorySlug].displayName} - - - -
  • -)) -} -
-
and another way - -
+
+ and another way + +
diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index f5f2eb72d3..efd2fa8cb3 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -4,6 +4,7 @@ import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" import { releaseNoteCategories } from "../data/releaseNoteCategories.js" +import ReleaseNoteCategorySelector from "../components/releaseNoteCategorySelector.js" import { Container } from "@pantheon-systems/pds-toolkit-react" // Set container width for search and main content. @@ -27,6 +28,7 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component {

Pantheon Release Notes: {categoryDisplayName}

TODO Render the category description here. +
From 1d57addc95f60cacbb2b40be66d1cfc2e3411df2 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 16:09:37 -0600 Subject: [PATCH 49/63] some whitespace cleanup --- src/components/releaseNoteCategorySelector.js | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 6f0ed401ca..9168d278bb 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -8,9 +8,6 @@ MenuButton, } from "@pantheon-systems/pds-toolkit-react" - - - const releaseNoteCategoryMenuLinks = function (currentCategorySlug) { const menuArray = [] @@ -23,38 +20,28 @@ const releaseNoteCategoryMenuLinks = function (currentCategorySlug) { } ) )) - return menuArray; } const releaseNoteCategoryLinks = function (currentCategorySlug) { - - const links = [ - - ]; + const links = []; // loop over the categories and add the displayName to the links array Object.keys(releaseNoteCategories).map((categorySlug, index) => ( links.push( - - { linkContent: ( { releaseNoteCategories[categorySlug].displayName - } ), }, - - ) )) return links; } - // Loop through the categories and create a list of links to each category. const ReleaseNoteCategorySelector = (currentCategorySlug) => { return ( @@ -75,16 +62,7 @@ const ReleaseNoteCategorySelector = (currentCategorySlug) => { />
- -
- - - - - - - ) } From dbc0047f96a3fb99530a200c6039db9d6c43cca6 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 16:23:42 -0600 Subject: [PATCH 50/63] more category cleanup --- src/components/releaseNoteCategorySelector.js | 27 ++++++++----------- .../releaseNotesListingByCategory.js | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 9168d278bb..63af4fcb9d 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -1,7 +1,6 @@ import React from "react" import { Link } from "gatsby" import { releaseNoteCategories } from "../data/releaseNoteCategories.js" - import { MenuButton, NavMenu, @@ -45,24 +44,20 @@ const releaseNoteCategoryLinks = function (currentCategorySlug) { // Loop through the categories and create a list of links to each category. const ReleaseNoteCategorySelector = (currentCategorySlug) => { return ( -
-
- and another way - -
+ + ) +} -
- and another way - { + return ( + -
- -
) } diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index efd2fa8cb3..5775b62894 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -27,7 +27,7 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component {

Pantheon Release Notes: {categoryDisplayName}

- TODO Render the category description here. +

TODO Render the category description here.


From 2e3e2947eac724f4ebfa4b849f90a6d527aa4314 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 16:26:28 -0600 Subject: [PATCH 51/63] pure json --- source/data/releaseNoteCategories.json | 111 +++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 source/data/releaseNoteCategories.json diff --git a/source/data/releaseNoteCategories.json b/source/data/releaseNoteCategories.json new file mode 100644 index 0000000000..844f1cd6b3 --- /dev/null +++ b/source/data/releaseNoteCategories.json @@ -0,0 +1,111 @@ +{ + "action-required": { + "displayName": "Action Required", + "color": "red", + "description": "Requires customer to act in order to avoid disruption" + }, + "drupal": { + "displayName": "Drupal", + "color": "black", + "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" + }, + "new-feature": { + "displayName": "New Feature", + "color": "green", + "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" + }, + "front-end-sites": { + "displayName": "Front-End Sites", + "color": "purple", + "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" + }, + "infrastructure": { + "displayName": "Infrastructure", + "color": "black", + "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" + }, + "security": { + "displayName": "Security", + "color": "red", + "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" + }, + "tools-apis": { + "displayName": "Tools & APIs", + "color": "black", + "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" + }, + "wordpress": { + "displayName": "WordPress", + "color": "black", + "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" + }, + "performance": { + "displayName": "Performance", + "color": "black", + "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" + }, + "user-interface": { + "displayName": "User interface", + "color": "black", + "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" + }, + "account-management": { + "displayName": "Account Management", + "color": "black", + "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" + }, + "policy": { + "displayName": "Policy", + "color": "gray", + "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" + }, + "content-management": { + "displayName": "Content Management", + "color": "gray", + "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" + }, + "deprecated": { + "displayName": "Deprecated", + "color": "red", + "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" + }, + "events": { + "displayName": "Events", + "color": "gray", + "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" + }, + "general": { + "displayName": "General", + "color": "gray", + "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" + }, + "issue-bug": { + "displayName": "Issue/Bug", + "color": "gray", + "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" + }, + "migration": { + "displayName": "Migration", + "color": "gray", + "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" + }, + "integration": { + "displayName": "Integration", + "color": "gray", + "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" + }, + "platform": { + "displayName": "Platform", + "color": "gray", + "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" + }, + "documentation" : { + "displayName": "Documentation", + "color": "gray", + "description": "Communicates substantive changes to docs.pantheon.io", + "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", + "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." + } +} From c82e6b3a5a0e4b7798b6c2ff8849721b5eb4d08d Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 17:07:57 -0600 Subject: [PATCH 52/63] adding json --- .../releaseNoteCategories.json | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 source/releasenotescategories/releaseNoteCategories.json diff --git a/source/releasenotescategories/releaseNoteCategories.json b/source/releasenotescategories/releaseNoteCategories.json new file mode 100644 index 0000000000..976a5d9489 --- /dev/null +++ b/source/releasenotescategories/releaseNoteCategories.json @@ -0,0 +1,130 @@ +{ + +"categories": [ + +{ + "slug": "drupal", + "displayName": "Drupal", + "color": "black", + "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" + }, +{ + "slug": "new-feature", + "displayName": "New Feature", + "color": "green", + "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" + }, +{ + "slug": "front-end-sites", + "displayName": "Front-End Sites", + "color": "purple", + "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" + }, +{ + "slug": "infrastructure", + "displayName": "Infrastructure", + "color": "black", + "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" + }, +{ + "slug": "security", + "displayName": "Security", + "color": "red", + "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" + }, +{ + "slug": "tools-apis", + "displayName": "Tools & APIs", + "color": "black", + "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" + }, +{ + "slug": "wordpress", + "displayName": "WordPress", + "color": "black", + "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" + }, +{ + "slug": "performance", + "displayName": "Performance", + "color": "black", + "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" + }, +{ + "slug": "user-interface", + "displayName": "User interface", + "color": "black", + "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" + }, +{ + "slug": "account-management", + "displayName": "Account Management", + "color": "black", + "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" + }, +{ + "slug": "policy", + "displayName": "Policy", + "color": "gray", + "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" + }, +{ + "slug": "content-management", + "displayName": "Content Management", + "color": "gray", + "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" + }, +{ + "slug": "deprecated", + "displayName": "Deprecated", + "color": "red", + "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" + }, +{ + "slug": "events", + "displayName": "Events", + "color": "gray", + "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" + }, +{ + "slug": "general", + "displayName": "General", + "color": "gray", + "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" + }, +{ + "slug": "issue-bug", + "displayName": "Issue/Bug", + "color": "gray", + "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" + }, +{ + "slug": "migration", + "displayName": "Migration", + "color": "gray", + "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" + }, + { + "slug": "integration", + "displayName": "Integration", + "color": "gray", + "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" + }, + { + "slug": "platform", + "displayName": "Platform", + "color": "gray", + "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", + "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" + }, + { + "slug": "documentation", + "displayName": "Documentation", + "color": "gray", + "description": "Communicates substantive changes to docs.pantheon.io", + "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", + "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." + } +] +} From 64b65dbcf68ee6e083ced9ba3a690473523a5a17 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 17:08:33 -0600 Subject: [PATCH 53/63] sourcing json --- gatsby-config.js | 7 ++ gatsby-node.js | 24 +++++- source/data/releaseNoteCategories.json | 111 ------------------------- src/data/releaseNoteCategories.js | 22 +++++ 4 files changed, 51 insertions(+), 113 deletions(-) delete mode 100644 source/data/releaseNoteCategories.json diff --git a/gatsby-config.js b/gatsby-config.js index a2462af750..6ab261360b 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -64,6 +64,13 @@ module.exports = { name: `data`, }, }, + { + resolve: `gatsby-source-filesystem`, + options: { + path: `${__dirname}/source/releasenotescategories`, + name: `releasenotecategories`, + }, + }, { // Converts Markdown into HTML resolve: `gatsby-transformer-remark`, // https://www.gatsbyjs.com/plugins/gatsby-transformer-remark/ diff --git a/gatsby-node.js b/gatsby-node.js index 208cdb056d..b53e99db7c 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -276,7 +276,6 @@ exports.createPages = ({ graphql, actions }) => { } } } - dataJson { commands { description @@ -285,7 +284,11 @@ exports.createPages = ({ graphql, actions }) => { usage } } - + releasenotecategoriesJson { + categories { + slug + } + } } `).then(result => { if (result.errors) { @@ -416,6 +419,23 @@ exports.createPages = ({ graphql, actions }) => { }) }) + + // // Create Terminus Command pages + const allReleaseNoteCategories = result.data.dataJson.jokes + console.log(allReleaseNoteCategories) + // terminusCommands.forEach(command => { + // const slugRegExp = /:/g + // const slug = command.name.replace(slugRegExp, "-") + // createPage({ + // path: `terminus/commands/${slug}`, + // component: path.resolve(`./src/templates/terminusCommand.js`), + // context: { + // slug: slug, + // name: command.name + // } + // }) + // }) + // Create each release note page. const releaseNotes = result.data.allReleaseNotes.edges; releaseNotes.forEach(releaseNote => { diff --git a/source/data/releaseNoteCategories.json b/source/data/releaseNoteCategories.json deleted file mode 100644 index 844f1cd6b3..0000000000 --- a/source/data/releaseNoteCategories.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "action-required": { - "displayName": "Action Required", - "color": "red", - "description": "Requires customer to act in order to avoid disruption" - }, - "drupal": { - "displayName": "Drupal", - "color": "black", - "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" - }, - "new-feature": { - "displayName": "New Feature", - "color": "green", - "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" - }, - "front-end-sites": { - "displayName": "Front-End Sites", - "color": "purple", - "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" - }, - "infrastructure": { - "displayName": "Infrastructure", - "color": "black", - "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" - }, - "security": { - "displayName": "Security", - "color": "red", - "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" - }, - "tools-apis": { - "displayName": "Tools & APIs", - "color": "black", - "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" - }, - "wordpress": { - "displayName": "WordPress", - "color": "black", - "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" - }, - "performance": { - "displayName": "Performance", - "color": "black", - "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" - }, - "user-interface": { - "displayName": "User interface", - "color": "black", - "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" - }, - "account-management": { - "displayName": "Account Management", - "color": "black", - "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" - }, - "policy": { - "displayName": "Policy", - "color": "gray", - "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" - }, - "content-management": { - "displayName": "Content Management", - "color": "gray", - "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" - }, - "deprecated": { - "displayName": "Deprecated", - "color": "red", - "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" - }, - "events": { - "displayName": "Events", - "color": "gray", - "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" - }, - "general": { - "displayName": "General", - "color": "gray", - "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" - }, - "issue-bug": { - "displayName": "Issue/Bug", - "color": "gray", - "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" - }, - "migration": { - "displayName": "Migration", - "color": "gray", - "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" - }, - "integration": { - "displayName": "Integration", - "color": "gray", - "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", - "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" - }, - "platform": { - "displayName": "Platform", - "color": "gray", - "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", - "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" - }, - "documentation" : { - "displayName": "Documentation", - "color": "gray", - "description": "Communicates substantive changes to docs.pantheon.io", - "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", - "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." - } -} diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js index 2a67c45534..bf58cb7180 100644 --- a/src/data/releaseNoteCategories.js +++ b/src/data/releaseNoteCategories.js @@ -1,108 +1,130 @@ export const releaseNoteCategories = { + "action-required": { + "slug": "action-required", "displayName": "Action Required", "color": "red", "description": "Requires customer to act in order to avoid disruption" }, "drupal": { + "slug": "drupal", "displayName": "Drupal", "color": "black", "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" }, "new-feature": { + "slug": "new-feature", "displayName": "New Feature", "color": "green", "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" }, "front-end-sites": { + "slug": "front-end-sites", "displayName": "Front-End Sites", "color": "purple", "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" }, "infrastructure": { + "slug": "infrastructure", "displayName": "Infrastructure", "color": "black", "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" }, "security": { + "slug": "security", "displayName": "Security", "color": "red", "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" }, "tools-apis": { + "slug": "tools-apis", "displayName": "Tools & APIs", "color": "black", "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" }, "wordpress": { + "slug": "wordpress", "displayName": "WordPress", "color": "black", "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" }, "performance": { + "slug": "performance", "displayName": "Performance", "color": "black", "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" }, "user-interface": { + "slug": "user-interface", "displayName": "User interface", "color": "black", "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" }, "account-management": { + "slug": "account-management", "displayName": "Account Management", "color": "black", "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" }, "policy": { + "slug": "policy", "displayName": "Policy", "color": "gray", "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" }, "content-management": { + "slug": "content-management", "displayName": "Content Management", "color": "gray", "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" }, "deprecated": { + "slug": "deprecated", "displayName": "Deprecated", "color": "red", "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" }, "events": { + "slug": "events", "displayName": "Events", "color": "gray", "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" }, "general": { + "slug": "general", "displayName": "General", "color": "gray", "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" }, "issue-bug": { + "slug": "issue-bug", "displayName": "Issue/Bug", "color": "gray", "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" }, "migration": { + "slug": "migration", "displayName": "Migration", "color": "gray", "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" }, "integration": { + "slug": "integration", "displayName": "Integration", "color": "gray", "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" }, "platform": { + "slug": "platform", "displayName": "Platform", "color": "gray", "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" }, "documentation" : { + "slug": "documentation", "displayName": "Documentation", "color": "gray", "description": "Communicates substantive changes to docs.pantheon.io", From cb6729d08d9596d7a8fdf60663cfba6bbe8173b4 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 17:36:49 -0600 Subject: [PATCH 54/63] updating selector to use json object --- gatsby-config.js | 2 +- gatsby-node.js | 16 +++++-- source/data/commands.json | 3 +- src/components/releaseNoteCategorySelector.js | 44 +++++++++++-------- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 6ab261360b..dd84fbb00a 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -68,7 +68,7 @@ module.exports = { resolve: `gatsby-source-filesystem`, options: { path: `${__dirname}/source/releasenotescategories`, - name: `releasenotecategories`, + name: `releasenotescategories`, }, }, { diff --git a/gatsby-node.js b/gatsby-node.js index b53e99db7c..a94cb1d1d7 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -284,7 +284,7 @@ exports.createPages = ({ graphql, actions }) => { usage } } - releasenotecategoriesJson { + releasenotescategoriesJson { categories { slug } @@ -411,7 +411,7 @@ exports.createPages = ({ graphql, actions }) => { // Loop through all allowed categories and create a page for each one. Object.keys(allowedReleaseNoteCategories).forEach((category) => { createPage({ - path: `/release-notes/${category}`, + path: `/release-notez/${category}`, component: path.resolve("./src/templates/releaseNotesListingByCategory.js"), context: { category: category, @@ -421,8 +421,18 @@ exports.createPages = ({ graphql, actions }) => { // // Create Terminus Command pages - const allReleaseNoteCategories = result.data.dataJson.jokes + const allReleaseNoteCategories = result.data.releasenotescategoriesJson.categories console.log(allReleaseNoteCategories) + allReleaseNoteCategories.forEach(category => { + createPage({ + path: `/release-notes/${category.slug}`, + component: path.resolve("./src/templates/releaseNotesListingByCategory.js"), + context: { + category: category.slug, + }, + }) + }) + // terminusCommands.forEach(command => { // const slugRegExp = /:/g // const slug = command.name.replace(slugRegExp, "-") diff --git a/source/data/commands.json b/source/data/commands.json index c551ab2feb..a5e30d6af2 100644 --- a/source/data/commands.json +++ b/source/data/commands.json @@ -3,6 +3,7 @@ "name": "Terminus", "version": "3.3.0" }, + "commands": [ { "name": "aliases", @@ -16690,4 +16691,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 63af4fcb9d..5564ae5f13 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -1,27 +1,12 @@ import React from "react" -import { Link } from "gatsby" -import { releaseNoteCategories } from "../data/releaseNoteCategories.js" +import releaseNoteCategoriesObject from "../../source/releasenotescategories/releaseNoteCategories.json" import { MenuButton, NavMenu, } from "@pantheon-systems/pds-toolkit-react" -const releaseNoteCategoryMenuLinks = function (currentCategorySlug) { - const menuArray = [] - - // loop over the categories and add the displayName to the links array - Object.keys(releaseNoteCategories).map((categorySlug, index) => ( - menuArray.push( - { - "label": releaseNoteCategories[categorySlug].displayName, - "callback": () => { window.location.href = `/release-notes/${categorySlug}` }, - } - ) - )) - return menuArray; -} - +/* const releaseNoteCategoryLinks = function (currentCategorySlug) { const links = []; // loop over the categories and add the displayName to the links array @@ -40,13 +25,36 @@ const releaseNoteCategoryLinks = function (currentCategorySlug) { )) return links; } +*/ + +const releaseNoteCategoryLinksFromJson = function () { + const menuItems = [ + { + "label": "All Release Notes", + "callback": () => { window.location.href = `/release-notes` }, + } + ]; + // loop over the categories and add the displayName to the links array + releaseNoteCategoriesObject.categories.forEach((category) => { + + menuItems.push( + { + "label": category.displayName, + "callback": () => { window.location.href = `/release-notes/${category.slug}` }, + } + ) + }) + + return menuItems; +} + // Loop through the categories and create a list of links to each category. const ReleaseNoteCategorySelector = (currentCategorySlug) => { return ( ) } From 0ffa01adffc96b08ccbdb0210893ba60fe07275f Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 20:06:11 -0600 Subject: [PATCH 55/63] working --- .../releaseNoteCategories.json | 6 ++++ src/components/releaseNoteCategories.js | 19 +++++++++++-- src/data/releaseNoteCategories.js | 28 ++++++++++++++++++- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/source/releasenotescategories/releaseNoteCategories.json b/source/releasenotescategories/releaseNoteCategories.json index 976a5d9489..ee754fa91c 100644 --- a/source/releasenotescategories/releaseNoteCategories.json +++ b/source/releasenotescategories/releaseNoteCategories.json @@ -2,6 +2,12 @@ "categories": [ + { + "slug": "action-required", + "displayName": "Action Required", + "color": "red", + "description": "Requires customer to act in order to avoid disruption" + }, { "slug": "drupal", "displayName": "Drupal", diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index 642eed89ac..d6ff251029 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -1,14 +1,21 @@ import React from "react" import { Link } from "gatsby" -import { releaseNoteCategories } from "../data/releaseNoteCategories.js" +import { theFunction, oldReleaseNoteCategories, otherStuff } from "../data/releaseNoteCategories.js" + + const ReleaseNoteCategories = ({categories}) => { + if (!categories) { return null } + const zoldReleaseNoteCategories = theFunction(); + + console.log(zoldReleaseNoteCategories); +console.log(oldReleaseNoteCategories); return (
@@ -21,18 +28,26 @@ if (!categories) { {categories.map((categorySlug, index) => ( +// If the category is in the oldReleaseNoteCategories object +// return the displayName from the zoldReleaseNoteCategories object +// else return the categorySlug + + +
-

{releaseNoteCategories[categorySlug].displayName}

+

{zoldReleaseNoteCategories[categorySlug].displayName}

+ + )) }
diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js index bf58cb7180..b8ae58f15f 100644 --- a/src/data/releaseNoteCategories.js +++ b/src/data/releaseNoteCategories.js @@ -1,4 +1,30 @@ -export const releaseNoteCategories = { +import releaseNoteCategoriesObject from "../../source/releasenotescategories/releaseNoteCategories.json" + + + + + +export const theFunction = function () { + + + + const NewThings = { + } + + releaseNoteCategoriesObject.categories.forEach(category => { + NewThings[category.slug] = category; + }); + + console.log(NewThings); + + return NewThings; + + +}; + +export const otherStuff = "other stuff"; + +export const oldReleaseNoteCategories = { "action-required": { From ad4644a3de43e9c2bceb8b194a5f88b14fe22bb5 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 20:18:50 -0600 Subject: [PATCH 56/63] simplify categories --- src/components/releaseNoteCategories.js | 30 +---- src/components/releaseNoteTeaser.js | 2 +- src/data/releaseNoteCategories.js | 166 ++---------------------- 3 files changed, 13 insertions(+), 185 deletions(-) diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index d6ff251029..3b4b814c2c 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -1,9 +1,6 @@ import React from "react" import { Link } from "gatsby" -import { theFunction, oldReleaseNoteCategories, otherStuff } from "../data/releaseNoteCategories.js" - - - +import { releaseNoteCategoryLoader } from "../data/releaseNoteCategories.js" const ReleaseNoteCategories = ({categories}) => { @@ -12,10 +9,6 @@ const ReleaseNoteCategories = ({categories}) => { if (!categories) { return null } - const zoldReleaseNoteCategories = theFunction(); - - console.log(zoldReleaseNoteCategories); -console.log(oldReleaseNoteCategories); return (
@@ -25,29 +18,12 @@ console.log(oldReleaseNoteCategories); :

Categories:

} - {categories.map((categorySlug, index) => ( - -// If the category is in the oldReleaseNoteCategories object -// return the displayName from the zoldReleaseNoteCategories object -// else return the categorySlug - - - -
- - -

{zoldReleaseNoteCategories[categorySlug].displayName}

+ +

{releaseNoteCategoryLoader(categorySlug).displayName}

- - -
- - )) }
diff --git a/src/components/releaseNoteTeaser.js b/src/components/releaseNoteTeaser.js index 5aa97f34e3..ea1dfa7c60 100644 --- a/src/components/releaseNoteTeaser.js +++ b/src/components/releaseNoteTeaser.js @@ -21,7 +21,7 @@ const ReleaseNoteTeaser = ({ ReleaseNoteData }) => { {ReleaseNoteData.frontmatter.title} - +
diff --git a/src/data/releaseNoteCategories.js b/src/data/releaseNoteCategories.js index b8ae58f15f..6735229f9c 100644 --- a/src/data/releaseNoteCategories.js +++ b/src/data/releaseNoteCategories.js @@ -1,160 +1,12 @@ import releaseNoteCategoriesObject from "../../source/releasenotescategories/releaseNoteCategories.json" - - - - -export const theFunction = function () { - - - - const NewThings = { - } - - releaseNoteCategoriesObject.categories.forEach(category => { - NewThings[category.slug] = category; - }); - - console.log(NewThings); - - return NewThings; - - -}; - -export const otherStuff = "other stuff"; - -export const oldReleaseNoteCategories = { - - - "action-required": { - "slug": "action-required", - "displayName": "Action Required", - "color": "red", - "description": "Requires customer to act in order to avoid disruption" - }, - "drupal": { - "slug": "drupal", - "displayName": "Drupal", - "color": "black", - "description": "Tailored for updates specific to the Drupal content management system, helping Drupal users stay informed about platform changes that directly impact their workflows" - }, - "new-feature": { - "slug": "new-feature", - "displayName": "New Feature", - "color": "green", - "description": "Consolidates information about both new features and improvements, providing users with insights into enhancements that contribute to a better overall experience" - }, - "front-end-sites": { - "slug": "front-end-sites", - "displayName": "Front-End Sites", - "color": "purple", - "description": "Focuses on updates related to Front-End Site (FES) enhancements, ensuring that developers and designers stay informed about changes affecting how they use the product" - }, - "infrastructure": { - "slug": "infrastructure", - "displayName": "Infrastructure", - "color": "black", - "description": "Details changes related to the underlying technology and architecture of the Pantheon platform, providing insights into changes that may impact performance and reliability" - }, - "security": { - "slug": "security", - "displayName": "Security", - "color": "red", - "description": "Addresses security-related updates, emphasizing the importance of staying informed about changes aimed at maintaining a secure and protected environment for users" - }, - "tools-apis": { - "slug": "tools-apis", - "displayName": "Tools & APIs", - "color": "black", - "description": "Keeps users informed about updates related to tools and APIs, helping developers understand changes that may impact their workflows and integrations" - }, - "wordpress": { - "slug": "wordpress", - "displayName": "WordPress", - "color": "black", - "description": "Tailored for updates specific to the WordPress content management system, helping WordPress users stay informed about platform changes that directly impact their workflows" - }, - "performance": { - "slug": "performance", - "displayName": "Performance", - "color": "black", - "description": "Highlights updates focused on optimizing the speed, efficiency, and overall performance of the Pantheon platform, giving users insights into improvements that enhance user experience" - }, - "user-interface": { - "slug": "user-interface", - "displayName": "User interface", - "color": "black", - "description": "Highlights updates related to changes in the user interface, ensuring that designers, marketers, and other users are aware of alterations to the visual and interactive elements of the platform" - }, - "account-management": { - "slug": "account-management", - "displayName": "Account Management", - "color": "black", - "description": "Covers finance and billing-related updates, allowing billing and finance managers to track changes affecting their financial aspects" - }, - "policy": { - "slug": "policy", - "displayName": "Policy", - "color": "gray", - "description": "Communicates updates related to platform policies, ensuring users are aware of any changes in rules or guidelines that may impact their usage" - }, - "content-management": { - "slug": "content-management", - "displayName": "Content Management", - "color": "gray", - "description": "Include changes relevant to managing digital content on the Pantheon platform, ensuring users stay informed about updates related to content creation, editing, and relevant tools" - }, - "deprecated": { - "slug": "deprecated", - "displayName": "Deprecated", - "color": "red", - "description": "Reserved for updates indicating the phasing out or discontinuation of specific features or functionalities" - }, - "events": { - "slug": "events", - "displayName": "Events", - "color": "gray", - "description": "Highlights updates related to special events, promotions, or limited-time occurrences on the Pantheon platform, keeping users informed about time-sensitive opportunities" - }, - "general": { - "slug": "general", - "displayName": "General", - "color": "gray", - "description": "Serves as a catch-all for updates that don't neatly fit into specific categories, offering a broad overview of general changes on the Pantheon platform" - }, - "issue-bug": { - "slug": "issue-bug", - "displayName": "Issue/Bug", - "color": "gray", - "description": "Merges information about issues and bugs into a unified category, allowing users to easily identify and understand the current status and steps taken to address reported problems" - }, - "migration": { - "slug": "migration", - "displayName": "Migration", - "color": "gray", - "description": "Reserved for updates related to migrations, ensuring users are informed about changes affecting the movement of data and content within the Pantheon platform" - }, - "integration": { - "slug": "integration", - "displayName": "Integration", - "color": "gray", - "description": "Addresses updates related to system integration, helping IT and tech leads understand changes relevant to connecting Pantheon with other tools and services", - "_comment-from-Rachel": "I think we should remove this as a duplicate of the Tools/APIs category" - }, - "platform": { - "slug": "platform", - "displayName": "Platform", - "color": "gray", - "description": "Offers general updates about the Pantheon platform, providing users with a comprehensive overview of changes that influence the overall system", - "_comment-from-Rachel": "I think we should remove this as a duplicate of the Infrastructure category" - }, - "documentation" : { - "slug": "documentation", - "displayName": "Documentation", - "color": "gray", - "description": "Communicates substantive changes to docs.pantheon.io", - "_comment-from-Rachel": "Review needed: New category not yet reviewed/approved by Ingrid or design team", - "_another_comment-from-Rachel": "We should require any new category to go through a review panel which includes design team, since too many tags can reduce usability of the feature and duplicate categories can cause confusion for intended usage." +export const releaseNoteCategoryLoader = function (categorySlug) { +// loop over all releaseNoteCategoriesObject.categories return the first one +// that matches the categorySlug + for (let i = 0; i < releaseNoteCategoriesObject.categories.length; i++) { + if (releaseNoteCategoriesObject.categories[i].slug === categorySlug) { + return releaseNoteCategoriesObject.categories[i] + } } -}; + // Todo more elegant error handling when category not found. +} From c65455e6b30d0463eb8d67228a6d97ce819b6054 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 20:23:12 -0600 Subject: [PATCH 57/63] loader --- src/templates/releaseNotesListingByCategory.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index 5775b62894..0683cd30f2 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -3,10 +3,13 @@ import { graphql } from "gatsby" import Layout from "../layout/layout" import SEO from "../layout/seo" import ReleaseNoteTeaser from "../components/releaseNoteTeaser.js" -import { releaseNoteCategories } from "../data/releaseNoteCategories.js" +import { releaseNoteCategoryLoader } from "../data/releaseNoteCategories.js" import ReleaseNoteCategorySelector from "../components/releaseNoteCategorySelector.js" import { Container } from "@pantheon-systems/pds-toolkit-react" + + + // Set container width for search and main content. const containerWidth = "standard" @@ -15,7 +18,8 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component { render() { const releasenotes = this.props.data.allMdx.edges const categorySlug = this.props.pageContext.category; - const categoryDisplayName = releaseNoteCategories[categorySlug]["displayName"]; + const categoryData = releaseNoteCategoryLoader(categorySlug); + const categoryDisplayName = categoryData["displayName"]; return ( From 91fbf5f49eb4fa2dcfe974dbc7148eb8fbccf449 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 20:42:13 -0600 Subject: [PATCH 58/63] render categories as tags --- src/components/releaseNoteCategories.js | 16 +++++++++++++--- src/templates/releaseNotesListingByCategory.js | 7 +------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/releaseNoteCategories.js b/src/components/releaseNoteCategories.js index 3b4b814c2c..7b12c4f352 100644 --- a/src/components/releaseNoteCategories.js +++ b/src/components/releaseNoteCategories.js @@ -1,28 +1,38 @@ import React from "react" import { Link } from "gatsby" import { releaseNoteCategoryLoader } from "../data/releaseNoteCategories.js" +import { Tag } from "@pantheon-systems/pds-toolkit-react" const ReleaseNoteCategories = ({categories}) => { - if (!categories) { return null } return (
-{/* If there is one category display the singular form. */ +{/* +@todo: Should this text be present but hidden for screen readers? + +If there is one category display the singular form. categories.length === 1 ?

Category:

:

Categories:

+ */ } {categories.map((categorySlug, index) => (
+ + {/* @TODO the Tags should be links.

{releaseNoteCategoryLoader(categorySlug).displayName}

- + */} + + {/* Todo, figure out how to make the colors meaningful. */} + +
)) } diff --git a/src/templates/releaseNotesListingByCategory.js b/src/templates/releaseNotesListingByCategory.js index 0683cd30f2..c86e9febad 100644 --- a/src/templates/releaseNotesListingByCategory.js +++ b/src/templates/releaseNotesListingByCategory.js @@ -7,9 +7,6 @@ import { releaseNoteCategoryLoader } from "../data/releaseNoteCategories.js" import ReleaseNoteCategorySelector from "../components/releaseNoteCategorySelector.js" import { Container } from "@pantheon-systems/pds-toolkit-react" - - - // Set container width for search and main content. const containerWidth = "standard" @@ -19,7 +16,6 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component { const releasenotes = this.props.data.allMdx.edges const categorySlug = this.props.pageContext.category; const categoryData = releaseNoteCategoryLoader(categorySlug); - const categoryDisplayName = categoryData["displayName"]; return ( @@ -30,8 +26,7 @@ class ReleaseNotesListingByCategoryTemplate extends React.Component { />
-

Pantheon Release Notes: {categoryDisplayName}

-

TODO Render the category description here.

+

Pantheon Release Notes: {categoryData["displayName"]}


From 632cfa815a86079dc0f3fc5806921cb7bf55c6e0 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 4 Jan 2024 20:46:55 -0600 Subject: [PATCH 59/63] selecto separator --- src/components/releaseNoteCategorySelector.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 5564ae5f13..0899324171 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -32,6 +32,9 @@ const releaseNoteCategoryLinksFromJson = function () { { "label": "All Release Notes", "callback": () => { window.location.href = `/release-notes` }, + }, + { + "isSeparator": true } ]; // loop over the categories and add the displayName to the links array From 560957c1a79c94225872e3551122eed59a85792c Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 5 Jan 2024 13:16:35 -0600 Subject: [PATCH 60/63] trying navigate() --- src/components/releaseNoteCategorySelector.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 0899324171..6b8c345397 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -1,5 +1,6 @@ import React from "react" import releaseNoteCategoriesObject from "../../source/releasenotescategories/releaseNoteCategories.json" +import { navigate } from "@reach/router" import { MenuButton, NavMenu, @@ -28,6 +29,7 @@ const releaseNoteCategoryLinks = function (currentCategorySlug) { */ const releaseNoteCategoryLinksFromJson = function () { + const menuItems = [ { "label": "All Release Notes", @@ -43,7 +45,7 @@ const releaseNoteCategoryLinksFromJson = function () { menuItems.push( { "label": category.displayName, - "callback": () => { window.location.href = `/release-notes/${category.slug}` }, + "callback": () => { navigate( `/release-notes/${category.slug}` ) }, } ) }) @@ -51,7 +53,6 @@ const releaseNoteCategoryLinksFromJson = function () { return menuItems; } - // Loop through the categories and create a list of links to each category. const ReleaseNoteCategorySelector = (currentCategorySlug) => { return ( From 005502560e45b6633d077e2dbc0dfc8dd0b5a381 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 5 Jan 2024 13:41:20 -0600 Subject: [PATCH 61/63] trying different callback construction --- src/components/releaseNoteCategorySelector.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/releaseNoteCategorySelector.js b/src/components/releaseNoteCategorySelector.js index 6b8c345397..754f2cb68e 100644 --- a/src/components/releaseNoteCategorySelector.js +++ b/src/components/releaseNoteCategorySelector.js @@ -30,10 +30,14 @@ const releaseNoteCategoryLinks = function (currentCategorySlug) { const releaseNoteCategoryLinksFromJson = function () { + const navigateToCategory = (categorySlug) => { + return window.location.href = `/release-notes/${categorySlug}` + } + const menuItems = [ { "label": "All Release Notes", - "callback": () => { window.location.href = `/release-notes` }, + "callback": function () { window.location.href = `/release-notes` }, }, { "isSeparator": true @@ -45,7 +49,10 @@ const releaseNoteCategoryLinksFromJson = function () { menuItems.push( { "label": category.displayName, - "callback": () => { navigate( `/release-notes/${category.slug}` ) }, + // "callback": { navigateToCategory(`${category.slug }`) }, + //"callback": () => { window.location.href = `/release-notes/${category.slug}` }, + //"callback": () => { navigateToCategory(`${category.slug}`) }, + "callback": function () { window.location.href = `/release-notes/${category.slug}` }, } ) }) From f1af2a8550348e9c27a7db9bedf3f88f39f47c69 Mon Sep 17 00:00:00 2001 From: M Miller Date: Thu, 18 Jan 2024 12:19:39 -0800 Subject: [PATCH 62/63] Update package-lock.json add engines node version --- package-lock.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package-lock.json b/package-lock.json index a258818c67..44f8c8eed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,6 +70,9 @@ "date-fns": "^2.29.3", "prettier": "^2.8.3", "react-date-range": "^1.4.0" + }, + "engines": { + "node": ">=18.0.0 <20.0.0" } }, "node_modules/@algolia/cache-browser-local-storage": { From 5d4d34f07e2b4c5aa15f1507fbfb17dc9d231e7c Mon Sep 17 00:00:00 2001 From: M Miller Date: Thu, 18 Jan 2024 13:50:36 -0800 Subject: [PATCH 63/63] update PDS version, testing --- package-lock.json | 14 +++++++------- package.json | 2 +- src/layout/StaticHeader/index.js | 6 +----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44f8c8eed4..9eef969924 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", - "@pantheon-systems/pds-toolkit-react": "^1.0.0-dev.44", + "@pantheon-systems/pds-toolkit-react": "^1.0.0-dev.69", "algoliasearch": "^4.14.3", "babel-plugin-remove-graphql-queries": "^4.25.0", "bootstrap": "^3.4.1", @@ -4129,9 +4129,9 @@ } }, "node_modules/@pantheon-systems/pds-toolkit-react": { - "version": "1.0.0-dev.58", - "resolved": "https://registry.npmjs.org/@pantheon-systems/pds-toolkit-react/-/pds-toolkit-react-1.0.0-dev.58.tgz", - "integrity": "sha512-WW0L/s4ZmsP1QjlmpLf4nBk6+WDXnJHxtoNphHtD/mBvG8x9o7A7M5yZC9jivNQize1kZO73vEn/UNcxM4T7Hg==", + "version": "1.0.0-dev.69", + "resolved": "https://registry.npmjs.org/@pantheon-systems/pds-toolkit-react/-/pds-toolkit-react-1.0.0-dev.69.tgz", + "integrity": "sha512-V86yuDgPJJTB8LN/jdU8EG6xRCOirZS2l7oliOWIq+C2U7TzWKeICDKXIBrvcgUpICNFADmZ7kjGttvBso8V3w==", "dependencies": { "@floating-ui/react": "^0.24.3", "focus-trap-react": "^10.2.1", @@ -29359,9 +29359,9 @@ } }, "@pantheon-systems/pds-toolkit-react": { - "version": "1.0.0-dev.58", - "resolved": "https://registry.npmjs.org/@pantheon-systems/pds-toolkit-react/-/pds-toolkit-react-1.0.0-dev.58.tgz", - "integrity": "sha512-WW0L/s4ZmsP1QjlmpLf4nBk6+WDXnJHxtoNphHtD/mBvG8x9o7A7M5yZC9jivNQize1kZO73vEn/UNcxM4T7Hg==", + "version": "1.0.0-dev.69", + "resolved": "https://registry.npmjs.org/@pantheon-systems/pds-toolkit-react/-/pds-toolkit-react-1.0.0-dev.69.tgz", + "integrity": "sha512-V86yuDgPJJTB8LN/jdU8EG6xRCOirZS2l7oliOWIq+C2U7TzWKeICDKXIBrvcgUpICNFADmZ7kjGttvBso8V3w==", "requires": { "@floating-ui/react": "^0.24.3", "focus-trap-react": "^10.2.1", diff --git a/package.json b/package.json index 2c292e303a..337eb2f459 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dependencies": { "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", - "@pantheon-systems/pds-toolkit-react": "^1.0.0-dev.44", + "@pantheon-systems/pds-toolkit-react": "^1.0.0-dev.69", "algoliasearch": "^4.14.3", "babel-plugin-remove-graphql-queries": "^4.25.0", "bootstrap": "^3.4.1", diff --git a/src/layout/StaticHeader/index.js b/src/layout/StaticHeader/index.js index 0917e2c750..29e3b26c8c 100644 --- a/src/layout/StaticHeader/index.js +++ b/src/layout/StaticHeader/index.js @@ -8,11 +8,7 @@ import "./style.css" const StaticHeader = ({ page }) => (
-
- -
+
Docs Home