From 292078765d4b6457cfc02705c946cdb81d166d0e Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Sun, 16 Jul 2023 02:40:17 +0200 Subject: [PATCH 1/3] chore: update meetings.json and newsrooom_videos.json (#1956) --- dashboard.json | 158 ++++++++++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 67 deletions(-) diff --git a/dashboard.json b/dashboard.json index 197b16fe294..f7f133b0fb5 100644 --- a/dashboard.json +++ b/dashboard.json @@ -14,7 +14,7 @@ "color": "C2E0C6" } ], - "score": 53.41447350736213 + "score": 53.988822684860644 }, { "id": "I_kwDOFLhIt84-OUI3", @@ -45,7 +45,7 @@ "resourcePath": "/asyncapi/generator/pull/978", "repo": "asyncapi/generator", "labels": [], - "score": 27.28158593117958 + "score": 30.727680996170687 }, { "id": "PR_kwDODCuNRs4r1oNL", @@ -56,7 +56,7 @@ "resourcePath": "/asyncapi/bindings/pull/84", "repo": "asyncapi/bindings", "labels": [], - "score": 23.835490866188476 + "score": 24.984189221185513 }, { "id": "I_kwDOBGu-185CELGB", @@ -70,33 +70,33 @@ "score": 22.68679251119144 }, { - "id": "I_kwDOBW5R_c5Pi3rO", + "id": "MDU6SXNzdWU5OTMxODc5ODM=", "isPR": false, "isAssigned": false, - "title": "Epic roadmap to the new AsyncAPI community section", - "author": "AceTheCreator", - "resourcePath": "/asyncapi/website/issues/903", - "repo": "asyncapi/website", + "title": "Proposal to allow defining schema format other than default one (AsyncAPI Schema)", + "author": "magicmatatjahu", + "resourcePath": "/asyncapi/spec/issues/622", + "repo": "asyncapi/spec", "labels": [ { - "name": "🎨 design", - "color": "0D67D3" + "name": "💭 Strawman (RFC 0)", + "color": "C2E0C6" } ], - "score": 22.399617922442182 + "score": 22.68679251119144 }, { - "id": "MDU6SXNzdWU5OTMxODc5ODM=", + "id": "I_kwDOBW5R_c5Pi3rO", "isPR": false, "isAssigned": false, - "title": "Proposal to allow defining schema format other than default one (AsyncAPI Schema)", - "author": "magicmatatjahu", - "resourcePath": "/asyncapi/spec/issues/622", - "repo": "asyncapi/spec", + "title": "Epic roadmap to the new AsyncAPI community section", + "author": "AceTheCreator", + "resourcePath": "/asyncapi/website/issues/903", + "repo": "asyncapi/website", "labels": [ { - "name": "💭 Strawman (RFC 0)", - "color": "C2E0C6" + "name": "🎨 design", + "color": "0D67D3" } ], "score": 22.399617922442182 @@ -121,12 +121,28 @@ "id": "PR_kwDOBW5R_c5TUuUu", "isPR": true, "isAssigned": false, - "title": "chore: adding 3 New Articles as Blog Posts", + "title": "chore(blog): adding 3 New Articles as Blog Posts", "author": "ivangsa", "resourcePath": "/asyncapi/website/pull/1805", "repo": "asyncapi/website", "labels": [], - "score": 18.666348268701817 + "score": 20.102221212448114 + }, + { + "id": "PR_kwDOBW5R_c5Uj1dR", + "isPR": true, + "isAssigned": false, + "title": "feat: adding unit tests for newsroom component", + "author": "reachaadrika", + "resourcePath": "/asyncapi/website/pull/1891", + "repo": "asyncapi/website", + "labels": [ + { + "name": "gsoc", + "color": "F4D03F" + } + ], + "score": 17.230475324955524 }, { "id": "PR_kwDOBW5R_c5KIyGW", @@ -140,29 +156,63 @@ "score": 16.65612614745701 }, { - "id": "PR_kwDOFLhIt85RTiHb", - "isPR": true, - "isAssigned": false, - "title": "docs: add flowchart for GSoC23 project in README.md", - "author": "14Richa", - "resourcePath": "/asyncapi/community/pull/719", - "repo": "asyncapi/community", - "labels": [], - "score": 14.645904026212197 - }, - { - "id": "PR_kwDOBGu-185KHmXZ", + "id": "PR_kwDOBW5R_c5VAjCE", "isPR": true, "isAssigned": false, - "title": "feat: new traits merge mechanism", - "author": "magicmatatjahu", - "resourcePath": "/asyncapi/spec/pull/907", - "repo": "asyncapi/spec", + "title": "docs: structure of a AsyncAPI document", + "author": "TRohit20", + "resourcePath": "/asyncapi/website/pull/1922", + "repo": "asyncapi/website", "labels": [], - "score": 14.645904026212197 + "score": 15.794602381209232 } ], "goodFirstIssues": [ + { + "id": "I_kwDOBW5R_c5rjzKd", + "title": "Bug: Incorrect link to meetings page", + "isAssigned": false, + "resourcePath": "/asyncapi/website/issues/1947", + "repo": "asyncapi/website", + "author": "CynthiaPeter", + "area": "Unknown", + "labels": [ + { + "name": "bug", + "color": "ee0701" + } + ] + }, + { + "id": "I_kwDOFDnrNc5rjLlc", + "title": "add `.prettierignore` to prevent autoformatting ", + "isAssigned": false, + "resourcePath": "/asyncapi/cli/issues/682", + "repo": "asyncapi/cli", + "author": "chinma-yyy", + "area": "Unknown", + "labels": [ + { + "name": "enhancement", + "color": "a2eeef" + } + ] + }, + { + "id": "I_kwDOBW5R_c5rh81V", + "title": "[📑 Docs]: suggestions on 'create-asyncapi-document.md' file", + "isAssigned": false, + "resourcePath": "/asyncapi/website/issues/1945", + "repo": "asyncapi/website", + "author": "AnimeshKumar923", + "area": "docs", + "labels": [ + { + "name": "📑 docs", + "color": "E50E99" + } + ] + }, { "id": "I_kwDOCHlHJM5rH7-B", "title": "[📑 Docs]: Update versioning docs with info how to check generator version", @@ -223,21 +273,6 @@ } ] }, - { - "id": "I_kwDOFLhIt85q_THl", - "title": "[📑 Docs]: A Typo in the Contributing Guideline", - "isAssigned": false, - "resourcePath": "/asyncapi/community/issues/795", - "repo": "asyncapi/community", - "author": "AnimeshKumar923", - "area": "docs", - "labels": [ - { - "name": "📑 docs", - "color": "E50E99" - } - ] - }, { "id": "I_kwDOBW5R_c5q1B5J", "title": "Overlay bug in the `/roadmap`", @@ -668,21 +703,6 @@ } ] }, - { - "id": "I_kwDOBW5R_c5kbYkc", - "title": "[📑 Docs]: improve adeo case study", - "isAssigned": false, - "resourcePath": "/asyncapi/website/issues/1615", - "repo": "asyncapi/website", - "author": "derberg", - "area": "Unknown", - "labels": [ - { - "name": "📑 docs", - "color": "E50E99" - } - ] - }, { "id": "I_kwDOBW5R_c5jSPTM", "title": "filter section is overflowing for small screen in dashboard section", @@ -891,6 +911,10 @@ { "name": "enhancement", "color": "a2eeef" + }, + { + "name": "stale", + "color": "ededed" } ] }, From bd4504a7eae4a48d2f9084a878c9f720eae4b23a Mon Sep 17 00:00:00 2001 From: Aadrika Bhargava <64789514+reachaadrika@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:03:19 +0530 Subject: [PATCH 2/3] feat: adding unit tests for layout component (#1914) Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in> --- components/AlgoliaSearch.js | 11 +- components/Head.js | 44 ++- components/layout/BlogLayout.js | 86 ++++-- components/layout/Column.js | 6 +- components/layout/Container.js | 35 ++- components/layout/DocsLayout.js | 326 ++++++++++++-------- components/layout/GenericLayout.js | 8 +- components/layout/GenericPostLayout.js | 21 +- components/layout/GenericWideLayout.js | 19 +- components/layout/JobsLayout.js | 34 +- components/layout/Layout.js | 52 ++-- components/layout/Row.js | 8 +- cypress/fixtures/blogpost.json | 248 +++++++++++++++ cypress/fixtures/docspost.json | 45 +++ cypress/fixtures/jobpost.json | 56 ++++ cypress/test/layout/BlogLayout.cy.js | 27 ++ cypress/test/layout/Column.cy.js | 17 + cypress/test/layout/Container.cy.js | 52 ++++ cypress/test/layout/DocsLayout.cy.js | 25 ++ cypress/test/layout/GenericLayout.cy.js | 45 +++ cypress/test/layout/GenericPostLayout.cy.js | 27 ++ cypress/test/layout/JobsLayout.cy.js | 27 ++ cypress/test/layout/Layout.cy.js | 50 +++ cypress/test/layout/Row.cy.js | 10 + cypress/utils/router.js | 27 ++ 25 files changed, 1039 insertions(+), 267 deletions(-) create mode 100644 cypress/fixtures/blogpost.json create mode 100644 cypress/fixtures/docspost.json create mode 100644 cypress/fixtures/jobpost.json create mode 100644 cypress/test/layout/BlogLayout.cy.js create mode 100644 cypress/test/layout/Column.cy.js create mode 100644 cypress/test/layout/Container.cy.js create mode 100644 cypress/test/layout/DocsLayout.cy.js create mode 100644 cypress/test/layout/GenericLayout.cy.js create mode 100644 cypress/test/layout/GenericPostLayout.cy.js create mode 100644 cypress/test/layout/JobsLayout.cy.js create mode 100644 cypress/test/layout/Layout.cy.js create mode 100644 cypress/test/layout/Row.cy.js create mode 100644 cypress/utils/router.js diff --git a/components/AlgoliaSearch.js b/components/AlgoliaSearch.js index c71aea80bae..2eafb6b2446 100644 --- a/components/AlgoliaSearch.js +++ b/components/AlgoliaSearch.js @@ -11,7 +11,7 @@ export const DOCS_INDEX_NAME = 'asyncapi-docs'; const APP_ID = 'Z621OGRI9Y'; const API_KEY = '5a4122ae46ce865146d23d3530595d38'; -const SearchContext = createContext() +const SearchContext = createContext({}); export default function AlgoliaSearch({ children }) { const [isOpen, setIsOpen] = useState(false); @@ -47,14 +47,7 @@ export default function AlgoliaSearch({ children }) { - + {children} {isOpen && } diff --git a/components/Head.js b/components/Head.js index 0aaf3a9a949..b353336ad2d 100644 --- a/components/Head.js +++ b/components/Head.js @@ -1,24 +1,33 @@ -import { useContext } from 'react' -import Head from 'next/head' -import AppContext from '../context/AppContext' -import ReactGA from 'react-ga' -import TagManager from 'react-gtm-module' +import { useContext, useEffect } from 'react'; +import Head from 'next/head'; +import AppContext from '../context/AppContext'; +import ReactGA from 'react-ga'; +import TagManager from 'react-gtm-module'; export default function HeadComponent({ title, description = 'Open source tools to easily build and maintain your event-driven architecture. All powered by the AsyncAPI specification, the industry standard for defining asynchronous APIs.', image = '/img/social/website-card.jpg', rssTitle = 'RSS Feed for AsyncAPI Initiative Blog', - rssLink = '/rss.xml' + rssLink = '/rss.xml', }) { - const url = process.env.DEPLOY_PRIME_URL || process.env.DEPLOY_URL || "http://localhost:3000" - const { path = '' } = useContext(AppContext) - const permalink = `${url}${path}` - let type = 'website' - if (path.startsWith('/docs') || path.startsWith('/blog')) type = 'article' - if (!image.startsWith('http') && !image.startsWith('https')) image = `${url}${image}` - const permTitle = 'AsyncAPI Initiative for event-driven APIs' - title = title ? `${title} | ${permTitle}` : permTitle + const url = process.env.DEPLOY_PRIME_URL || process.env.DEPLOY_URL || 'http://localhost:3000'; + const appContext = useContext(AppContext); + const { path = '' } = appContext || {}; + + const permalink = `${url}${path}`; + let type = 'website'; + + if (path.startsWith('/docs') || path.startsWith('/blog')) { + type = 'article'; + } + + if (!image.startsWith('http') && !image.startsWith('https')) { + image = `${url}${image}`; + } + + const permTitle = 'AsyncAPI Initiative for event-driven APIs'; + title = title ? `${title} | ${permTitle}` : permTitle; //enable google analytics if (typeof window !== 'undefined') { @@ -27,6 +36,7 @@ export default function HeadComponent({ ReactGA.pageview(window.location.pathname + window.location.search) } + return ( @@ -50,13 +60,13 @@ export default function HeadComponent({ - + {/* Twitter Card data */} - + {/* Open Graph data */} @@ -66,5 +76,5 @@ export default function HeadComponent({ {title} - ) + ); } diff --git a/components/layout/BlogLayout.js b/components/layout/BlogLayout.js index 290634b5bdb..1d379b20585 100644 --- a/components/layout/BlogLayout.js +++ b/components/layout/BlogLayout.js @@ -1,36 +1,45 @@ -import { useRouter } from 'next/router' -import HtmlHead from 'next/head' -import ErrorPage from 'next/error' -import moment from 'moment' -import Head from '../Head' -import BlogContext from '../../context/BlogContext' -import TOC from '../TOC' -import NavBar from '../navigation/NavBar' -import Container from './Container' -import AuthorAvatars from '../AuthorAvatars' -import StickyNavbar from '../navigation/StickyNavbar' -import AnnouncementHero from '../campaigns/AnnoucementHero' +import { useRouter } from 'next/router'; +import HtmlHead from 'next/head'; +import ErrorPage from 'next/error'; +import moment from 'moment'; +import Head from '../Head'; +import BlogContext from '../../context/BlogContext'; +import TOC from '../TOC'; +import NavBar from '../navigation/NavBar'; +import Container from './Container'; +import AuthorAvatars from '../AuthorAvatars'; +import StickyNavbar from '../navigation/StickyNavbar'; +import AnnouncementHero from '../campaigns/AnnoucementHero'; export default function BlogLayout({ post, children }) { - if (!post) return - if (post.title === undefined) throw new Error('Post title is required') + if (!post) return ; + if (post.title === undefined) throw new Error('Post title is required'); - const router = useRouter() + const router = useRouter(); if (!router.isFallback && !post?.slug) { - return + return ; } return ( - + - + - +
-

{post.title}

+

+ {post.title} +

@@ -38,19 +47,25 @@ export default function BlogLayout({ post, children }) {

- {post.authors.map((author, index) => author.link ? {author.name} : author.name).reduce((prev, curr) => [prev, ' & ', curr])} + {post.authors + .map((author, index) => + author.link ? ( + + {author.name} + + ) : ( + author.name + ) + ) + .reduce((prev, curr) => [prev, ' & ', curr])}

- - · - - - {post.readingTime} min read - + · + {post.readingTime} min read
@@ -62,7 +77,11 @@ export default function BlogLayout({ post, children }) { image={post.cover} /> -