1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Merge pull request #767 from oceanprotocol/issue-766-build-issue

Issue-#766: Remove draft releases
This commit is contained in:
Trent McConaghy 2021-09-21 12:35:05 +02:00 committed by GitHub
commit 59d5229644
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,11 +26,12 @@ const queryGithub = graphql`
totalCount totalCount
} }
releases( releases(
first: 1 first: 2
orderBy: { field: CREATED_AT, direction: DESC } orderBy: { field: CREATED_AT, direction: DESC }
) { ) {
edges { edges {
node { node {
isDraft
tag { tag {
name name
} }
@ -80,12 +81,21 @@ const Repository = ({ name, links, readme }) => (
}) })
.filter((n) => n) .filter((n) => n)
const repo = repoFilteredArray[0] var repo = repoFilteredArray[0]
// safeguard against more empty items, // safeguard against more empty items,
// e.g. when private repos are referenced in repositories.yml // e.g. when private repos are referenced in repositories.yml
if (repo === undefined) return null if (repo === undefined) return null
const releasesFilteredArray = repo.releases.edges
.filter(({ node }) => {
return !node.isDraft
})
.splice(1)
repo = {
...repo,
releases: { edges: releasesFilteredArray }
}
const { const {
url, url,
description, description,
@ -110,7 +120,6 @@ const Repository = ({ name, links, readme }) => (
}) })
const moreLinks = links || linksFilteredArray.filter((n) => n)[0] const moreLinks = links || linksFilteredArray.filter((n) => n)[0]
return ( return (
<article className={styles.repository}> <article className={styles.repository}>
<Title <Title