Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit eb0d2b1

Browse files
chore: release 2.41.0 (#3672)
2 parents dce7b4f + 20c30ff commit eb0d2b1

File tree

22 files changed

+321
-236
lines changed

22 files changed

+321
-236
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,43 @@
55

66
> All notable changes to this project will be documented in this file
77

8+
## [2.41.0-beta.1](https://github.com/open-sauced/app/compare/v2.40.1-beta.4...v2.41.0-beta.1) (2024-07-02)
9+
10+
11+
### 🍕 Features
12+
13+
* add range filter when importing GitHub repos for an org ([#3665](https://github.com/open-sauced/app/issues/3665)) ([89abf59](https://github.com/open-sauced/app/commit/89abf59f6770507ce7c659016ca88240e907f2da))
14+
15+
## [2.40.1-beta.4](https://github.com/open-sauced/app/compare/v2.40.1-beta.3...v2.40.1-beta.4) (2024-07-02)
16+
17+
18+
### 🐛 Bug Fixes
19+
20+
* now workspace pages on smaller screens keep their layout in bounds ([#3664](https://github.com/open-sauced/app/issues/3664)) ([8b2a879](https://github.com/open-sauced/app/commit/8b2a8795f2d10a30cc187431cce2e199c4802d9b))
21+
22+
## [2.40.1-beta.3](https://github.com/open-sauced/app/compare/v2.40.1-beta.2...v2.40.1-beta.3) (2024-07-02)
23+
24+
25+
### 🐛 Bug Fixes
26+
27+
* now OSCR that is 0 gets rendered as a dash ([#3662](https://github.com/open-sauced/app/issues/3662)) ([5e12564](https://github.com/open-sauced/app/commit/5e1256491964dc6e443b0f6db5bef59a9b9c57e9))
28+
* remove dots from `IssueChart` & `PRChart` ([#3659](https://github.com/open-sauced/app/issues/3659)) ([deb24a0](https://github.com/open-sauced/app/commit/deb24a0be3b040883e4f03c31db50e48a90dbde1))
29+
30+
## [2.40.1-beta.2](https://github.com/open-sauced/app/compare/v2.40.1-beta.1...v2.40.1-beta.2) (2024-07-01)
31+
32+
33+
### 🐛 Bug Fixes
34+
35+
* workspace insight header paddings ([#3623](https://github.com/open-sauced/app/issues/3623)) ([10438b4](https://github.com/open-sauced/app/commit/10438b4935a2020bd2e1171c2e63c048e0be81cd))
36+
37+
## [2.40.1-beta.1](https://github.com/open-sauced/app/compare/v2.40.0...v2.40.1-beta.1) (2024-06-29)
38+
39+
40+
### 🐛 Bug Fixes
41+
42+
* reset input after deleting contributor insight list ([#3600](https://github.com/open-sauced/app/issues/3600)) ([2a2ac76](https://github.com/open-sauced/app/commit/2a2ac7653bfe61914a950edb0cbe7d419d1ee2df))
43+
* reset input after deleting contributor insight list([#3553](https://github.com/open-sauced/app/issues/3553)) ([e436e8d](https://github.com/open-sauced/app/commit/e436e8d1f5fccb4ca6e640b85a889dfd53132907))
44+
845
## [2.40.0](https://github.com/open-sauced/app/compare/v2.39.0...v2.40.0) (2024-06-27)
946

1047

components/Contributors/OscrPill.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import Tooltip from "components/atoms/Tooltip/tooltip";
44
export const OscrPill = ({ rating }: { rating: number }) => {
55
const percentageRating = Math.floor(rating * 100);
66

7+
if (percentageRating < 1) {
8+
return null;
9+
}
10+
711
return (
812
<Tooltip direction="top" content="Open Source Contributor Rating (OSCR)">
913
<Pill color="purple" size="small" text={`${percentageRating}`} />

components/Graphs/IssuesChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export default function IssuesChart({ stats, velocity, syncId, range = 30, isLoa
9898
/>
9999
<Tooltip content={CustomTooltip} filterNull={false} />
100100
<CartesianGrid vertical={false} strokeDasharray="4" stroke="#E2E8F0" />
101-
<Line dataKey="opened_issues" stroke="#16a34a" strokeWidth={2} />
102-
<Line dataKey="closed_issues" stroke="#9333ea" strokeWidth={2} />
101+
<Line dataKey="opened_issues" stroke="#16a34a" strokeWidth={2} dot={false} />
102+
<Line dataKey="closed_issues" stroke="#9333ea" strokeWidth={2} dot={false} />
103103
</LineChart>
104104
)}
105105
</ResponsiveContainer>

components/Graphs/PRChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export default function PRChart({ stats, velocity, syncId, range = 30, isLoading
9898
/>
9999
<Tooltip content={CustomTooltip} filterNull={false} />
100100
<CartesianGrid vertical={false} strokeDasharray="4" stroke="#E2E8F0" />
101-
<Line dataKey="active_prs" stroke="#16a34a" strokeWidth={2} />
102-
<Line dataKey="accepted_prs" stroke="#9333ea" strokeWidth={2} />
101+
<Line dataKey="active_prs" stroke="#16a34a" strokeWidth={2} dot={false} />
102+
<Line dataKey="accepted_prs" stroke="#9333ea" strokeWidth={2} dot={false} />
103103
</LineChart>
104104
)}
105105
</ResponsiveContainer>

components/Workspaces/TrackedRepoWizard/SelectOrgReposStep.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { useEffect, useState } from "react";
2+
import { useRouter } from "next/router";
23
import { Avatar } from "components/atoms/Avatar/avatar-hover-card";
4+
import { DayRangePicker } from "components/shared/DayRangePicker";
35
import { SearchedReposTable } from "../SearchReposTable";
46

57
interface SearchByReposStepProps {
@@ -53,6 +55,9 @@ export const SelectOrgReposStep = ({
5355
hasError,
5456
}: SearchByReposStepProps) => {
5557
const [filteredRepositories, setFilteredRepositories] = useState<Map<string, boolean>>(repositories);
58+
const router = useRouter();
59+
const initialRange = router.query.range as string;
60+
const [range, setRange] = useState(initialRange ? Number(initialRange) : 30);
5661

5762
useEffect(() => {
5863
const lowercasedOrg = organization.toLowerCase();
@@ -78,11 +83,17 @@ export const SelectOrgReposStep = ({
7883

7984
return (
8085
<div className="flex flex-col gap-4 h-96 max-h-96">
81-
<div className="flex items-center gap-2 font-semibold">
82-
<Avatar contributor={organization} size="xsmall" />
83-
<span>{organization}</span>
86+
<div className="flex w-full justify-between gap-2 font-semibold">
87+
<div className="flex gap-2 justify-start align-middle">
88+
<Avatar contributor={organization} size="small" />
89+
<span className="flex align-middle">{organization}</span>
90+
</div>
91+
<DayRangePicker onDayRangeChanged={(e) => setRange(Number(e))} />
8492
</div>
85-
<p>Select the organization repositories that you want to track.</p>
93+
<p>
94+
Select the organization repositories updated in the last <span className="font-bold">{range} days</span> that
95+
you want to track.
96+
</p>
8697
<SearchedReposTable
8798
type="by-org"
8899
repositories={filteredRepositories}

components/Workspaces/TrackedRepoWizard/TrackedRepoWizard.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useLocalStorage } from "react-use";
22
import { useEffect, useState } from "react";
3+
import { useRouter } from "next/router";
34
import { useSearchRepos } from "lib/hooks/useSearchRepos";
45
import { useUserOrganizations } from "lib/hooks/useUserOrganizations";
56
import { useGetOrgRepos } from "lib/hooks/useGetOrgRepos";
@@ -33,10 +34,12 @@ async function organizationExists(orgSearchTerm: string) {
3334
}
3435

3536
export const TrackedReposWizard = ({ onAddToTrackingList, onCancel, onCloseModal }: TrackedReposWizardProps) => {
37+
const router = useRouter();
38+
const range = router.query.range as string;
39+
const initialOrg = router.query.organization as string;
3640
const [step, setStep] = useState<TrackedReposStep>("pickReposOrOrg");
37-
const [organization, setOrganization] = useState<string | undefined>();
41+
const [organization, setOrganization] = useState<string | undefined>(initialOrg);
3842
const [currentTrackedRepositories, setCurrentTrackedRepositories] = useState<Map<string, boolean>>(new Map());
39-
4043
const suggestedRepos: any[] = [];
4144
const [searchTerm, setSearchTerm] = useState<string | undefined>();
4245
const [orgSearchTerm, setOrgSearchTerm] = useState<string | undefined>();
@@ -74,7 +77,7 @@ export const TrackedReposWizard = ({ onAddToTrackingList, onCancel, onCloseModal
7477
// passing it as a dependency will cause an infinite loop though as the reference to it
7578
// keeps changing. This is a workaround to avoid that.
7679
// eslint-disable-next-line react-hooks/exhaustive-deps
77-
}, [organization, isOrgReposError, isLoadingOrgRepos]);
80+
}, [organization, isOrgReposError, isLoadingOrgRepos, range]);
7881

7982
useEffect(() => {
8083
if (rawUserOrgs) {
@@ -149,6 +152,11 @@ export const TrackedReposWizard = ({ onAddToTrackingList, onCancel, onCloseModal
149152
break;
150153
}
151154
}
155+
useEffect(() => {
156+
if (organization) {
157+
setStep("pickOrgRepos");
158+
}
159+
}, [range, organization]);
152160

153161
function onSearchRepos(searchTerm?: string) {
154162
if (searchTerm && searchTerm.length > 2) {
@@ -204,6 +212,7 @@ export const TrackedReposWizard = ({ onAddToTrackingList, onCancel, onCloseModal
204212
<SearchOrgStep
205213
onSelectOrg={(org) => {
206214
setOrganization(org);
215+
router.push({ query: { ...router.query, organization: org, range: range } });
207216
setStep("pickOrgRepos");
208217
}}
209218
onSearch={(searchTerm) => {

components/Workspaces/WorkspaceHeader.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import { writeToClipboard } from "lib/utils/write-to-clipboard";
1111

1212
interface WorkspaceHeaderProps {
1313
workspace: Workspace;
14+
children?: React.ReactNode;
1415
}
1516

16-
export const WorkspaceHeader = ({ workspace }: WorkspaceHeaderProps) => {
17+
export const WorkspaceHeader = ({ workspace, children }: WorkspaceHeaderProps) => {
1718
const { toast } = useToast();
1819
const posthog = usePostHog();
1920
const { userId } = useSupabaseAuth();
@@ -44,7 +45,8 @@ export const WorkspaceHeader = ({ workspace }: WorkspaceHeaderProps) => {
4445
</span>
4546
<Pill className="font-medium" text={workspace.is_public ? "Public" : "Private"} />
4647
</h1>
47-
<div className="flex gap-4">
48+
<div className="flex gap-2 justify-end">
49+
{children}
4850
<Button
4951
variant="outline"
5052
onClick={copyUrlToClipboard}

components/molecules/ContributorListTableRow/contributor-list-table-row.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const ContributorListTableRow = ({
198198

199199
{/* Column: OSCR */}
200200
<div className={clsx("flex-1 lg:max-w-[5rem] text-light-slate-11 justify-center lg:flex ")}>
201-
<div className="flex gap-x-3">{contributor.oscr ? <OscrPill rating={contributor.oscr} /> : "-"}</div>
201+
<div className="flex gap-x-3">{contributor.oscr ? <OscrPill rating={contributor.oscr} /> ?? "-" : "-"}</div>
202202
</div>
203203

204204
{/* Column Repositories */}

components/molecules/InsightHeader/insight-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const InsightHeader = ({
9494
</div>
9595
</div>
9696
</div>
97-
<div className="absolute right-0 bottom-0 top-0 flex flex-col items-end gap-3 py-2 md:items-center md:flex-row md:static">
97+
<div className="flex gap-2 items-center">
9898
<Button
9999
onClick={() => handleCopyToClipboard(insightPageLink)}
100100
className="px-6 py-2 bg-white w-max"

components/organisms/ListPage/DeleteListPageModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const DeleteListPageModal: FC<ModalProps> = ({
3737
const handleOnConfirm = async () => {
3838
if (input !== listName) return;
3939
await onConfirm();
40+
setInput("");
4041
};
4142

4243
const disabled = input !== listName || submitted;

components/organisms/ToolList/nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Nav: React.FC<NavProps> = ({
3737
aria-orientation="horizontal"
3838
aria-label="Browse the tools"
3939
tabIndex={0}
40-
className="tool-list-nav flex w-full overflow-x-auto overflow-y-hidden gap-2 px-4 md:px-16 border-b pt-3"
40+
className="tool-list-nav flex w-full overflow-x-auto overflow-y-hidden gap-2 border-b pt-3"
4141
>
4242
{toolList.map((tool, index) => {
4343
// TODO: Too much is going on here in terms of handling URLs. This should be revisited.

layouts/hub-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const HubPageLayout = ({
4040
return (
4141
<>
4242
<div>
43-
<Header>
43+
<Header classNames="px-0 md:px-0 pt-0">
4444
<ClientOnly>
4545
{isLoading ? (
4646
<div className="flex justify-between w-full h-46">

layouts/lists.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const ListPageLayout = ({
4747

4848
return (
4949
<>
50-
<div>
50+
<div className="px-4 pt-6 lg:px-16">
5151
<Header classNames="px-0 md:px-0">
5252
{list && (
5353
<ListHeader
@@ -86,7 +86,7 @@ const ListPageLayout = ({
8686
</div>
8787

8888
<main className="flex flex-col items-center flex-1 w-full py-8 bg-light-slate-2">
89-
<div className="container px-2 mx-auto md:px-16">{children}</div>
89+
<div className="container">{children}</div>
9090
</main>
9191
</>
9292
);

lib/hooks/useGetOrgRepos.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import useSWR, { Fetcher } from "swr";
2+
import { useRouter } from "next/router";
23
import { supabase } from "lib/utils/supabase";
4+
import { calcDaysFromToday } from "lib/utils/date-utils";
5+
import { useIsWorkspaceUpgraded } from "./api/useIsWorkspaceUpgraded";
36

47
const baseUrl = "https://api.github.com";
58

@@ -29,9 +32,13 @@ const githubApiRepoFetcher: Fetcher = async (apiUrl: string) => {
2932
throw error;
3033
}
3134

35+
const requestUrl = new URL(apiUrl, baseUrl);
36+
const upgraded = requestUrl.searchParams.get("upgraded");
3237
const linkHeader = res.headers.get("link");
3338

34-
if (linkHeader && linkHeader.includes('rel="last"')) {
39+
const responses = [res];
40+
41+
if (linkHeader && linkHeader.includes('rel="last"') && upgraded === "true") {
3542
// @ts-expect-error the regex group will exist as the link header is present as per https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28#using-link-headers
3643
const groups = /page=(?<lastPage>\d+)>;\s+rel="last"/.exec(linkHeader).groups as { lastPage: string };
3744

@@ -44,16 +51,16 @@ const githubApiRepoFetcher: Fetcher = async (apiUrl: string) => {
4451
return url.toString();
4552
});
4653

47-
const responses = await Promise.all(
54+
const resolvedResponses = await Promise.all(
4855
pageUrls.map((url) =>
4956
fetch(url, {
5057
headers,
51-
})
58+
}).catch(() => new Response(JSON.stringify({})))
5259
)
5360
);
5461

5562
// add the initial request's reponse to the start of the array of paged data responses
56-
responses.unshift(res);
63+
responses.push(...resolvedResponses);
5764

5865
const data = await Promise.all(responses.map((response) => response.json()));
5966

@@ -64,11 +71,16 @@ const githubApiRepoFetcher: Fetcher = async (apiUrl: string) => {
6471
};
6572

6673
export const useGetOrgRepos = ({ organization, limit = 100 }: { organization: string | undefined; limit?: number }) => {
74+
const router = useRouter();
75+
const workspaceId = router.query.workspaceId as string;
76+
const range = router.query.range as string;
77+
const { data: exceededLimit } = useIsWorkspaceUpgraded({ workspaceId });
6778
const query = new URLSearchParams();
6879
query.set("per_page", `${limit}`);
6980
query.set("type", "public");
70-
query.set("sort", "full_name");
71-
query.set("direction", "asc");
81+
query.set("sort", "pushed");
82+
query.set("direction", "desc");
83+
query.set("upgraded", !exceededLimit ? "true" : "false");
7284

7385
const endpointString = organization ? `orgs/${organization}/repos?${query}` : null;
7486

@@ -78,7 +90,10 @@ export const useGetOrgRepos = ({ organization, limit = 100 }: { organization: st
7890
);
7991

8092
return {
81-
data: data?.map((item) => item.full_name) ?? [],
93+
data:
94+
data
95+
?.filter((item) => calcDaysFromToday(new Date(item.pushed_at)) <= Number(range ?? 30))
96+
.map((item) => item.full_name) ?? [],
8297
isLoading: !error && !data,
8398
isError: !!error,
8499
mutate,

next-types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ interface GhOrg {
412412
id: number;
413413
name: string;
414414
full_name: string;
415+
pushed_at: string;
415416
private: boolean;
416417
}
417418

npm-shrinkwrap.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@open-sauced/app",
33
"description": "🍕The dashboard for open source discovery.",
44
"keywords": [],
5-
"version": "2.40.0",
5+
"version": "2.41.0-beta.1",
66
"author": "Brian Douglas <[email protected]>",
77
"private": true,
88
"license": "Apache 2.0",

0 commit comments

Comments
 (0)