From d97c8f5d82218882b74a5d3bfbc3167901afad14 Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Fri, 9 Aug 2024 15:36:40 -0500 Subject: [PATCH 1/2] feat: add display query param for toggling repo contributors list view (#3907) --- pages/s/[org]/[repo]/contributors.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pages/s/[org]/[repo]/contributors.tsx b/pages/s/[org]/[repo]/contributors.tsx index a74905146c..c27f09e409 100644 --- a/pages/s/[org]/[repo]/contributors.tsx +++ b/pages/s/[org]/[repo]/contributors.tsx @@ -43,7 +43,7 @@ const AddToWorkspaceDrawer = dynamic(() => import("components/Repositories/AddTo export async function getServerSideProps(context: GetServerSidePropsContext) { const { org, repo } = context.params ?? { org: "", repo: "" }; const range = (context.query.range ? Number(context.query.range) : 30) as Range; - + const display = (context.query.display ?? "grid") as ToggleValue; const { data: repoData, error } = await fetchApiData({ path: `repos/${org}/${repo}/info`, }); @@ -66,7 +66,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { context.res.setHeader("Netlify-Vary", "query=range"); context.res.setHeader("Cache-Tag", `repo-pages,repo-page-${repoData.id}`); - return { props: { repoData, ogImageUrl } }; + return { props: { repoData, ogImageUrl, display } }; } type Range = 30 | 7 | 90 | 180 | 360; @@ -74,16 +74,16 @@ type Range = 30 | 7 | 90 | 180 | 360; interface RepoPageProps { repoData: DbRepoInfo; ogImageUrl: string; + display: ToggleValue; } -export default function RepoPageContributorsTab({ repoData, ogImageUrl }: RepoPageProps) { +export default function RepoPageContributorsTab({ repoData, ogImageUrl, display }: RepoPageProps) { const avatarUrl = getAvatarByUsername(repoData.full_name.split("/")[0], 96); const { toast } = useToast(); const posthog = usePostHog(); const { session } = useSession(true); const isMobile = useMediaQuery("(max-width: 576px)"); const [isAddToWorkspaceModalOpen, setIsAddToWorkspaceModalOpen] = useState(false); - const [contributorsView, setContributorsView] = useState("grid"); const tabList = [ { name: "Overview", path: "" }, { name: "Contributors", path: "contributors" }, @@ -220,11 +220,13 @@ export default function RepoPageContributorsTab({ repoData, ogImageUrl }: RepoPa

Contributors

setContributorsView((prev) => (prev === "list" ? "grid" : "list"))} + value={display} + onChange={() => { + setQueryParams({ display: display === "list" ? "grid" : "list" }); + }} />
- {contributorsView === "grid" && ( + {display === "grid" && ( )} - {contributorsView === "list" && ( + {display === "list" && ( Date: Fri, 9 Aug 2024 20:50:07 +0000 Subject: [PATCH 2/2] chore(minor): release 2.53.0-beta.1 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [2.53.0-beta.1](https://github.com/open-sauced/app/compare/v2.52.0...v2.53.0-beta.1) (2024-08-09) ### πŸ• Features * add display query param for toggling repo contributors list view ([#3907](https://github.com/open-sauced/app/issues/3907)) ([d97c8f5](https://github.com/open-sauced/app/commit/d97c8f5d82218882b74a5d3bfbc3167901afad14)) --- CHANGELOG.md | 7 +++++++ npm-shrinkwrap.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index becdf5f0d1..36ec7dc08e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [2.53.0-beta.1](https://github.com/open-sauced/app/compare/v2.52.0...v2.53.0-beta.1) (2024-08-09) + + +### πŸ• Features + +* add display query param for toggling repo contributors list view ([#3907](https://github.com/open-sauced/app/issues/3907)) ([d97c8f5](https://github.com/open-sauced/app/commit/d97c8f5d82218882b74a5d3bfbc3167901afad14)) + ## [2.52.0](https://github.com/open-sauced/app/compare/v2.51.0...v2.52.0) (2024-08-09) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3f3bc71f94..ed785e34fa 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "@open-sauced/app", - "version": "2.52.0", + "version": "2.53.0-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@open-sauced/app", - "version": "2.52.0", + "version": "2.53.0-beta.1", "hasInstallScript": true, "license": "Apache 2.0", "dependencies": { diff --git a/package.json b/package.json index 50acc98380..90c3b7f221 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@open-sauced/app", "description": "πŸ•The dashboard for open source discovery.", "keywords": [], - "version": "2.52.0", + "version": "2.53.0-beta.1", "author": "Brian Douglas ", "private": true, "license": "Apache 2.0",