+
{children}
+
+
+
+
+ Contributor insights
+
+
+
-
+
{banner}
{children}
diff --git a/components/atoms/Select/single-select.tsx b/components/atoms/Select/single-select.tsx
index 41389d5ed..c7c0be89d 100644
--- a/components/atoms/Select/single-select.tsx
+++ b/components/atoms/Select/single-select.tsx
@@ -49,6 +49,7 @@ const SingleSelect = ({
return (
{
setIsOpen(open);
if (!open) {
diff --git a/components/shared/SplitButton.tsx b/components/shared/SplitButton.tsx
index cda01c8e7..201bcd220 100644
--- a/components/shared/SplitButton.tsx
+++ b/components/shared/SplitButton.tsx
@@ -8,30 +8,40 @@ import {
} from "components/atoms/Dropdown/dropdown";
import Button from "./Button/button";
-type Action = { label: string; onClick: () => void };
+type Action = { label: string; onClick: () => void; icon?: React.FC };
type NonEmptyArray = [T, ...T[]];
type SplitButtonProps = {
actions: NonEmptyArray;
+ label: string;
+ side?: "top" | "right" | "left" | "bottom";
+ align?: "start" | "center" | "end";
+ alignOffset?: number;
};
-export const SplitButton = ({ actions }: SplitButtonProps) => {
+export const SplitButton = ({ actions, label, side, align, alignOffset }: SplitButtonProps) => {
const [action, setAction] = useState(actions[0]);
return (
-
+ },
+ },
+ ]}
+ />
)}
Date: Fri, 30 Aug 2024 21:16:55 +0000
Subject: [PATCH 64/81] chore(minor): release 2.62.0-beta.1 on beta channel
[skip ci]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## [2.62.0-beta.1](https://github.com/open-sauced/app/compare/v2.61.0...v2.62.0-beta.1) (2024-08-30)
### π Features
* use `SplitButton` for repo page Add Workspace buttons ([#4062](https://github.com/open-sauced/app/issues/4062)) ([6cf13e6](https://github.com/open-sauced/app/commit/6cf13e6bc1b550f595e24dbc2856fddd0ad3028c))
---
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 617de568e..c5a653d92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,13 @@
> All notable changes to this project will be documented in this file
+## [2.62.0-beta.1](https://github.com/open-sauced/app/compare/v2.61.0...v2.62.0-beta.1) (2024-08-30)
+
+
+### π Features
+
+* use `SplitButton` for repo page Add Workspace buttons ([#4062](https://github.com/open-sauced/app/issues/4062)) ([6cf13e6](https://github.com/open-sauced/app/commit/6cf13e6bc1b550f595e24dbc2856fddd0ad3028c))
+
## [2.61.0](https://github.com/open-sauced/app/compare/v2.60.0...v2.61.0) (2024-08-29)
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index b104384b4..578448e88 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,12 +1,12 @@
{
"name": "@open-sauced/app",
- "version": "2.61.0",
+ "version": "2.62.0-beta.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@open-sauced/app",
- "version": "2.61.0",
+ "version": "2.62.0-beta.1",
"hasInstallScript": true,
"license": "Apache 2.0",
"dependencies": {
diff --git a/package.json b/package.json
index 13d9d767c..7b0351fe3 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.61.0",
+ "version": "2.62.0-beta.1",
"author": "Brian Douglas ",
"private": true,
"license": "Apache 2.0",
From 5191add9fd9169555426acdb5341f1c527649830 Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Fri, 30 Aug 2024 17:39:51 -0400
Subject: [PATCH 65/81] chore: added the OpenSauced GitHub action pizza-action
(#4075)
---
.github/workflows/pizza.yml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 .github/workflows/pizza.yml
diff --git a/.github/workflows/pizza.yml b/.github/workflows/pizza.yml
new file mode 100644
index 000000000..80a823216
--- /dev/null
+++ b/.github/workflows/pizza.yml
@@ -0,0 +1,16 @@
+name: OpenSauced Pizza Action
+
+on:
+ schedule:
+ # Run once a week on Sunday at 00:00 UTC
+ - cron: "0 0 * * 0"
+ workflow_dispatch: # Allow manual triggering
+
+jobs:
+ pizza-action:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Pizza Action
+ uses: open-sauced/pizza-action@v1.0.0
+ with:
+ commit-and-push: "true"
From c3fd10ecf93d614a6017e0cb7bcb23679f0e2eec Mon Sep 17 00:00:00 2001
From: Brandon Roberts
Date: Tue, 3 Sep 2024 10:42:27 -0500
Subject: [PATCH 66/81] fix: use custom error component with Sentry error
reporting for 500s (#4078)
---
instrumentation.ts | 9 +++++++++
next.config.js | 3 +++
pages/{500.tsx => _error.tsx} | 18 +++++++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 instrumentation.ts
rename pages/{500.tsx => _error.tsx} (68%)
diff --git a/instrumentation.ts b/instrumentation.ts
new file mode 100644
index 000000000..f8a929ba4
--- /dev/null
+++ b/instrumentation.ts
@@ -0,0 +1,9 @@
+export async function register() {
+ if (process.env.NEXT_RUNTIME === "nodejs") {
+ await import("./sentry.server.config");
+ }
+
+ if (process.env.NEXT_RUNTIME === "edge") {
+ await import("./sentry.edge.config");
+ }
+}
diff --git a/next.config.js b/next.config.js
index b70350293..c782133c7 100644
--- a/next.config.js
+++ b/next.config.js
@@ -28,6 +28,9 @@ const interests = [
module.exports = millionLint({
productionBrowserSourceMaps: true,
reactStrictMode: true,
+ experimental: {
+ instrumentationHook: true,
+ },
images: {
remotePatterns: [
{
diff --git a/pages/500.tsx b/pages/_error.tsx
similarity index 68%
rename from pages/500.tsx
rename to pages/_error.tsx
index 0f15251f7..b21548039 100644
--- a/pages/500.tsx
+++ b/pages/_error.tsx
@@ -1,9 +1,14 @@
+import { NextPageContext } from "next";
import Link from "next/link";
+import Error from "next/error";
+import * as Sentry from "@sentry/nextjs";
+
import FullHeightContainer from "components/atoms/FullHeightContainer/full-height-container";
import HeaderLogo from "components/molecules/HeaderLogo/header-logo";
+
import BubbleBG from "../img/bubble-bg.svg";
-export default function Custom500() {
+function Custom500() {
return (
);
}
+
+Custom500.getInitialProps = async (contextData: NextPageContext) => {
+ // In case this is running in a serverless function, await this in order to give Sentry
+ // time to send the error before the lambda exits
+ await Sentry.captureUnderscoreErrorException(contextData);
+
+ // This will contain the status code of the response
+ return Error.getInitialProps(contextData);
+};
+
+export default Custom500;
From f3e521a85e012bd990bc82a296551d45cd20e9a5 Mon Sep 17 00:00:00 2001
From: Brandon Roberts
Date: Tue, 3 Sep 2024 15:53:56 +0000
Subject: [PATCH 67/81] chore(patch): release 2.62.0-beta.2 on beta channel
[skip ci]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## [2.62.0-beta.2](https://github.com/open-sauced/app/compare/v2.62.0-beta.1...v2.62.0-beta.2) (2024-09-03)
### π Bug Fixes
* use custom error component with Sentry error reporting for 500s ([#4078](https://github.com/open-sauced/app/issues/4078)) ([c3fd10e](https://github.com/open-sauced/app/commit/c3fd10ecf93d614a6017e0cb7bcb23679f0e2eec))
---
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 c5a653d92..2269f86c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,13 @@
> All notable changes to this project will be documented in this file
+## [2.62.0-beta.2](https://github.com/open-sauced/app/compare/v2.62.0-beta.1...v2.62.0-beta.2) (2024-09-03)
+
+
+### π Bug Fixes
+
+* use custom error component with Sentry error reporting for 500s ([#4078](https://github.com/open-sauced/app/issues/4078)) ([c3fd10e](https://github.com/open-sauced/app/commit/c3fd10ecf93d614a6017e0cb7bcb23679f0e2eec))
+
## [2.62.0-beta.1](https://github.com/open-sauced/app/compare/v2.61.0...v2.62.0-beta.1) (2024-08-30)
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 578448e88..4634c0ba1 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,12 +1,12 @@
{
"name": "@open-sauced/app",
- "version": "2.62.0-beta.1",
+ "version": "2.62.0-beta.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@open-sauced/app",
- "version": "2.62.0-beta.1",
+ "version": "2.62.0-beta.2",
"hasInstallScript": true,
"license": "Apache 2.0",
"dependencies": {
diff --git a/package.json b/package.json
index 7b0351fe3..4b6219bbb 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.62.0-beta.1",
+ "version": "2.62.0-beta.2",
"author": "Brian Douglas ",
"private": true,
"license": "Apache 2.0",
From 70cf6b3bbdb324ce0baf33473f2d9d7b14c13975 Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Tue, 3 Sep 2024 14:39:50 -0400
Subject: [PATCH 68/81] chore: updated pizza-action (#4080)
---
.github/workflows/pizza.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/pizza.yml b/.github/workflows/pizza.yml
index 80a823216..d4661f28b 100644
--- a/.github/workflows/pizza.yml
+++ b/.github/workflows/pizza.yml
@@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Pizza Action
- uses: open-sauced/pizza-action@v1.0.0
+ uses: open-sauced/pizza-action@v2.0.0
with:
- commit-and-push: "true"
+ commit-and-pr: "true"
From 9067dcaff71d77ee9dd2a39b2afc572805de32c8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 3 Sep 2024 21:23:47 -0600
Subject: [PATCH 69/81] chore(deps): bump actions/download-artifact from 2 to
4.1.7 in /.github/workflows (#4082)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/release.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 47fe61213..70b86d81e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -81,7 +81,7 @@ jobs:
token: ${{ steps.generate_token.outputs.token }}
- name: "π download build artifacts"
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4.1.7
with:
name: build
path: build
From 4fa8b7fd22b0c59dbcf5e573601bc686d9c1d1ee Mon Sep 17 00:00:00 2001
From: Ryan Furrer
Date: Wed, 4 Sep 2024 07:45:14 -0400
Subject: [PATCH 70/81] fix: fixed dropdown styling (#4077)
Co-authored-by: Nick Taylor
---
components/Repositories/AddToWorkspaceModal.tsx | 2 +-
components/atoms/Select/single-select.tsx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/components/Repositories/AddToWorkspaceModal.tsx b/components/Repositories/AddToWorkspaceModal.tsx
index e682cd983..e786667ad 100644
--- a/components/Repositories/AddToWorkspaceModal.tsx
+++ b/components/Repositories/AddToWorkspaceModal.tsx
@@ -70,7 +70,7 @@ export default function AddToWorkspaceModal({ repository, isOpen, onCloseModal,
onInteractOutside={onCloseModal}
>
Add to workspace}>
-
+
{!user ? (
@@ -75,7 +75,7 @@ const SingleSelect = ({
-
+
<>
{options.length > 0 && (
From 49dfa031bee3d8e5528c6c2da753524cc624be64 Mon Sep 17 00:00:00 2001
From: Shubham Sharma <106425076+shubhamchasing@users.noreply.github.com>
Date: Wed, 11 Sep 2024 01:33:55 +0530
Subject: [PATCH 71/81] fix: correct no insights message on contributor
insights (#4090)
---
pages/workspaces/[workspaceId]/contributor-insights/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pages/workspaces/[workspaceId]/contributor-insights/index.tsx b/pages/workspaces/[workspaceId]/contributor-insights/index.tsx
index 0741702b0..0bb6afe3b 100644
--- a/pages/workspaces/[workspaceId]/contributor-insights/index.tsx
+++ b/pages/workspaces/[workspaceId]/contributor-insights/index.tsx
@@ -119,7 +119,7 @@ const ListsHub = ({ workspace }: { workspace: Workspace }) => {
{!isLoading && sessionToken ? (
<>
-
You currently have no repository insights
+
You currently have no contributor insights
Create a new contributor insight
From f51ffa6c4fcccbb0c86a2bdf4bf94f4ecbea8825 Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Tue, 10 Sep 2024 16:36:43 -0400
Subject: [PATCH 72/81] chore: updated upload-artifact & download-artifact
actions to v4 (#4092)
---
.github/workflows/release.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 70b86d81e..704e62e1b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -50,7 +50,7 @@ jobs:
run: npm run build
- name: "π production artifacts"
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: build
path: .next
@@ -81,7 +81,7 @@ jobs:
token: ${{ steps.generate_token.outputs.token }}
- name: "π download build artifacts"
- uses: actions/download-artifact@v4.1.7
+ uses: actions/download-artifact@v4
with:
name: build
path: build
From 764674bfae626e0aa9f3e4f960bb156e0270afad Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Tue, 10 Sep 2024 17:53:36 -0400
Subject: [PATCH 73/81] chore: now hidden files are included in production
artifacts (#4097)
---
.github/workflows/release.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 704e62e1b..b17e8fcf9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -54,6 +54,7 @@ jobs:
with:
name: build
path: .next
+ include-hidden-files: true
release:
environment:
From 5e820f4c2bb219a959c6bcc000ad7ee19903a688 Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Tue, 10 Sep 2024 22:04:34 +0000
Subject: [PATCH 74/81] chore(patch): release 2.62.0-beta.3 on beta channel
[skip ci]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## [2.62.0-beta.3](https://github.com/open-sauced/app/compare/v2.62.0-beta.2...v2.62.0-beta.3) (2024-09-10)
### π Bug Fixes
* correct no insights message on contributor insights ([#4090](https://github.com/open-sauced/app/issues/4090)) ([49dfa03](https://github.com/open-sauced/app/commit/49dfa031bee3d8e5528c6c2da753524cc624be64))
* fixed dropdown styling ([#4077](https://github.com/open-sauced/app/issues/4077)) ([4fa8b7f](https://github.com/open-sauced/app/commit/4fa8b7fd22b0c59dbcf5e573601bc686d9c1d1ee))
---
CHANGELOG.md | 8 ++++++++
npm-shrinkwrap.json | 4 ++--
package.json | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2269f86c2..40c08cd41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@
> All notable changes to this project will be documented in this file
+## [2.62.0-beta.3](https://github.com/open-sauced/app/compare/v2.62.0-beta.2...v2.62.0-beta.3) (2024-09-10)
+
+
+### π Bug Fixes
+
+* correct no insights message on contributor insights ([#4090](https://github.com/open-sauced/app/issues/4090)) ([49dfa03](https://github.com/open-sauced/app/commit/49dfa031bee3d8e5528c6c2da753524cc624be64))
+* fixed dropdown styling ([#4077](https://github.com/open-sauced/app/issues/4077)) ([4fa8b7f](https://github.com/open-sauced/app/commit/4fa8b7fd22b0c59dbcf5e573601bc686d9c1d1ee))
+
## [2.62.0-beta.2](https://github.com/open-sauced/app/compare/v2.62.0-beta.1...v2.62.0-beta.2) (2024-09-03)
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 4634c0ba1..1840c1adc 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,12 +1,12 @@
{
"name": "@open-sauced/app",
- "version": "2.62.0-beta.2",
+ "version": "2.62.0-beta.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@open-sauced/app",
- "version": "2.62.0-beta.2",
+ "version": "2.62.0-beta.3",
"hasInstallScript": true,
"license": "Apache 2.0",
"dependencies": {
diff --git a/package.json b/package.json
index 4b6219bbb..38255bd44 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.62.0-beta.2",
+ "version": "2.62.0-beta.3",
"author": "Brian Douglas ",
"private": true,
"license": "Apache 2.0",
From 94a4eed0548c910027873692568634e643af0ee4 Mon Sep 17 00:00:00 2001
From: Nick Taylor
Date: Tue, 10 Sep 2024 22:12:49 +0000
Subject: [PATCH 75/81] chore(minor): release 2.62.0 [skip ci]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
## [2.62.0](https://github.com/open-sauced/app/compare/v2.61.0...v2.62.0) (2024-09-10)
### π Features
* use `SplitButton` for repo page Add Workspace buttons ([#4062](https://github.com/open-sauced/app/issues/4062)) ([6cf13e6](https://github.com/open-sauced/app/commit/6cf13e6bc1b550f595e24dbc2856fddd0ad3028c))
### π Bug Fixes
* correct no insights message on contributor insights ([#4090](https://github.com/open-sauced/app/issues/4090)) ([49dfa03](https://github.com/open-sauced/app/commit/49dfa031bee3d8e5528c6c2da753524cc624be64))
* fixed dropdown styling ([#4077](https://github.com/open-sauced/app/issues/4077)) ([4fa8b7f](https://github.com/open-sauced/app/commit/4fa8b7fd22b0c59dbcf5e573601bc686d9c1d1ee))
* use custom error component with Sentry error reporting for 500s ([#4078](https://github.com/open-sauced/app/issues/4078)) ([c3fd10e](https://github.com/open-sauced/app/commit/c3fd10ecf93d614a6017e0cb7bcb23679f0e2eec))
---
CHANGELOG.md | 14 ++++++++++++++
npm-shrinkwrap.json | 4 ++--
package.json | 2 +-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 40c08cd41..487a48894 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,20 @@
> All notable changes to this project will be documented in this file
+## [2.62.0](https://github.com/open-sauced/app/compare/v2.61.0...v2.62.0) (2024-09-10)
+
+
+### π Features
+
+* use `SplitButton` for repo page Add Workspace buttons ([#4062](https://github.com/open-sauced/app/issues/4062)) ([6cf13e6](https://github.com/open-sauced/app/commit/6cf13e6bc1b550f595e24dbc2856fddd0ad3028c))
+
+
+### π Bug Fixes
+
+* correct no insights message on contributor insights ([#4090](https://github.com/open-sauced/app/issues/4090)) ([49dfa03](https://github.com/open-sauced/app/commit/49dfa031bee3d8e5528c6c2da753524cc624be64))
+* fixed dropdown styling ([#4077](https://github.com/open-sauced/app/issues/4077)) ([4fa8b7f](https://github.com/open-sauced/app/commit/4fa8b7fd22b0c59dbcf5e573601bc686d9c1d1ee))
+* use custom error component with Sentry error reporting for 500s ([#4078](https://github.com/open-sauced/app/issues/4078)) ([c3fd10e](https://github.com/open-sauced/app/commit/c3fd10ecf93d614a6017e0cb7bcb23679f0e2eec))
+
## [2.62.0-beta.3](https://github.com/open-sauced/app/compare/v2.62.0-beta.2...v2.62.0-beta.3) (2024-09-10)
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 1840c1adc..36a95889b 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,12 +1,12 @@
{
"name": "@open-sauced/app",
- "version": "2.62.0-beta.3",
+ "version": "2.62.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@open-sauced/app",
- "version": "2.62.0-beta.3",
+ "version": "2.62.0",
"hasInstallScript": true,
"license": "Apache 2.0",
"dependencies": {
diff --git a/package.json b/package.json
index 38255bd44..e5e1e0f11 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.62.0-beta.3",
+ "version": "2.62.0",
"author": "Brian Douglas ",
"private": true,
"license": "Apache 2.0",
From 37ee0f5f5d66c39bff5b99bf7036db8c14e4b48b Mon Sep 17 00:00:00 2001
From: zeudev
Date: Fri, 13 Sep 2024 20:52:54 -0700
Subject: [PATCH 76/81] feat: updated `/explore` page (#4053)
---
components/Workspaces/WorkspaceCard.tsx | 63 +++++++
components/Workspaces/WorkspaceLayout.tsx | 3 +-
.../recommended-repo-card.tsx | 6 +-
.../organisms/SearchDialog/search-dialog.tsx | 12 +-
components/organisms/TopNav/top-nav.tsx | 5 +-
e2e/explore-page.spec.ts | 4 +-
img/explore-page-header.png | Bin 0 -> 488849 bytes
lib/hooks/api/useFetchWorkspace.ts | 16 ++
lib/hooks/useFetchTrendingRepositories.ts | 25 +++
middleware.ts | 2 +-
next-types.d.ts | 1 +
pages/explore/index.tsx | 178 ++++++++++++++++++
pages/explore/topic/[pageId]/[toolName].tsx | 61 ------
.../[toolName]/filter/[...selectedFilter].tsx | 29 ---
14 files changed, 301 insertions(+), 104 deletions(-)
create mode 100644 components/Workspaces/WorkspaceCard.tsx
create mode 100644 img/explore-page-header.png
create mode 100644 lib/hooks/api/useFetchWorkspace.ts
create mode 100644 lib/hooks/useFetchTrendingRepositories.ts
create mode 100644 pages/explore/index.tsx
delete mode 100644 pages/explore/topic/[pageId]/[toolName].tsx
delete mode 100644 pages/explore/topic/[pageId]/[toolName]/filter/[...selectedFilter].tsx
diff --git a/components/Workspaces/WorkspaceCard.tsx b/components/Workspaces/WorkspaceCard.tsx
new file mode 100644
index 000000000..7e0ebd5cd
--- /dev/null
+++ b/components/Workspaces/WorkspaceCard.tsx
@@ -0,0 +1,63 @@
+import Image from "next/image";
+import Link from "next/link";
+import Card from "components/atoms/Card/card";
+import { Spinner } from "components/atoms/SpinLoader/spin-loader";
+import CardRepoList, { RepoList } from "components/molecules/CardRepoList/card-repo-list";
+import useFetchWorkspace from "lib/hooks/api/useFetchWorkspace";
+import { useGetWorkspaceRepositories } from "lib/hooks/api/useGetWorkspaceRepositories";
+import { useWorkspaceMembers } from "lib/hooks/api/useWorkspaceMembers";
+import { getAvatarById, getAvatarByUsername } from "lib/utils/github";
+
+export default function WorkspaceCard({ workspaceId }: { workspaceId: string }) {
+ const { data: workspace, isLoading, isError } = useFetchWorkspace({ workspaceId });
+ const { data: members, isLoading: isMembersLoading, isError: isMembersError } = useWorkspaceMembers({ workspaceId });
+ const workspaceOwner = members.find((member) => member.role === "owner");
+
+ const {
+ data: workspaceRepositoriesData,
+ isLoading: isWorkspaceRepositoriesLoading,
+ error: isWorkspaceRepositoriesError,
+ } = useGetWorkspaceRepositories({ workspaceId });
+
+ const workspaceRepositories =
+ workspaceRepositoriesData?.data?.map((data) => {
+ const owner = data.repo.full_name.split("/").at(0) ?? "";
+ return { repoOwner: owner, repoName: data.repo.name, repoIcon: getAvatarByUsername(owner) };
+ }) ?? ([] as RepoList[]);
+
+ return (
+
+
+ {!(isLoading || isMembersLoading || isWorkspaceRepositoriesLoading) ? (
+ <>
+
+
+
+
{workspaceOwner?.member.name}
+
+
+
+ {workspace?.name}
+
+ {(workspace?.description.length ?? 0) > 0 ? workspace?.description : "No description given."}
+
+
+
+
+
+ >
+ ) : (
+
+
+
+ )}
+
+
+ );
+}
diff --git a/components/Workspaces/WorkspaceLayout.tsx b/components/Workspaces/WorkspaceLayout.tsx
index 4fce5eb58..dd3124cc2 100644
--- a/components/Workspaces/WorkspaceLayout.tsx
+++ b/components/Workspaces/WorkspaceLayout.tsx
@@ -68,7 +68,8 @@ export const WorkspaceLayout = ({ workspaceId, banner, children, footer }: Works
)}
-
+
+
{banner}
{children}
diff --git a/components/molecules/RecommendedRepoCard/recommended-repo-card.tsx b/components/molecules/RecommendedRepoCard/recommended-repo-card.tsx
index 93620fa38..7c688ebc0 100644
--- a/components/molecules/RecommendedRepoCard/recommended-repo-card.tsx
+++ b/components/molecules/RecommendedRepoCard/recommended-repo-card.tsx
@@ -24,12 +24,16 @@ const RecommendedRepoCard = ({ fullName, className }: RecommendedRepoCardProps):
return (