Skip to content

Commit

Permalink
chore: release 2.21.0 (#3249)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Apr 25, 2024
2 parents 6093f6c + 95d545f commit e1e95c8
Show file tree
Hide file tree
Showing 28 changed files with 577 additions and 263 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,53 @@

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

## [2.21.0-beta.6](https://github.com/open-sauced/app/compare/v2.21.0-beta.5...v2.21.0-beta.6) (2024-04-25)


### 🧑‍💻 Code Refactoring

* show banner across workspace when limits are exceeded ([#3233](https://github.com/open-sauced/app/issues/3233)) ([f0d1dac](https://github.com/open-sauced/app/commit/f0d1dac5e434324fee0573714f760403aec04a02))

## [2.21.0-beta.5](https://github.com/open-sauced/app/compare/v2.21.0-beta.4...v2.21.0-beta.5) (2024-04-25)


### 🍕 Features

* update stars and forks stats on repo pages ([#3199](https://github.com/open-sauced/app/issues/3199)) ([43ffce4](https://github.com/open-sauced/app/commit/43ffce4ac78bf9a6711526715bda5d7eea4f6ae5))

## [2.21.0-beta.4](https://github.com/open-sauced/app/compare/v2.21.0-beta.3...v2.21.0-beta.4) (2024-04-25)


### 🍕 Features

* add OG image to StarSearch waitlist ([#3245](https://github.com/open-sauced/app/issues/3245)) ([8563264](https://github.com/open-sauced/app/commit/8563264dd477969d569e7936e096b30182aa3e2d))

## [2.21.0-beta.3](https://github.com/open-sauced/app/compare/v2.21.0-beta.2...v2.21.0-beta.3) (2024-04-25)


### 🐛 Bug Fixes

* now suggestion prompts run immediately ([#3242](https://github.com/open-sauced/app/issues/3242)) ([662d0b5](https://github.com/open-sauced/app/commit/662d0b50855db11cf472431b39483249004a9f1d))

## [2.21.0-beta.2](https://github.com/open-sauced/app/compare/v2.21.0-beta.1...v2.21.0-beta.2) (2024-04-24)


### 🍕 Features

* add share button to repo pages ([#3235](https://github.com/open-sauced/app/issues/3235)) ([cde9d62](https://github.com/open-sauced/app/commit/cde9d62266f14fc04374f515e154ec1fa460d3f0))


### 🐛 Bug Fixes

* now StarSearch responses with links have styled links ([#3236](https://github.com/open-sauced/app/issues/3236)) ([99e622e](https://github.com/open-sauced/app/commit/99e622ea1d30013dfdb4812d059d442d6a42a6c0))

## [2.21.0-beta.1](https://github.com/open-sauced/app/compare/v2.20.0...v2.21.0-beta.1) (2024-04-24)


### 🍕 Features

* implemented StarSearch waitlist ([#3231](https://github.com/open-sauced/app/issues/3231)) ([654d525](https://github.com/open-sauced/app/commit/654d52550a805f59ae9c50770316e84367adf9f9))

## [2.20.0](https://github.com/open-sauced/app/compare/v2.19.0...v2.20.0) (2024-04-23)


Expand Down
56 changes: 0 additions & 56 deletions components/Graphs/MetricCard.stories.tsx

This file was deleted.

78 changes: 0 additions & 78 deletions components/Graphs/MetricCard.tsx

This file was deleted.

17 changes: 4 additions & 13 deletions components/Workspaces/InsightUpgradeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,13 @@ export default function InsightUpgradeModal({
<DialogCloseButton onClick={onClose} />
<section className="flex flex-col gap-2">
<DialogTitle className="text-xl">
{variant !== "workspace"
? "This Insight page is over the free Workspace limit"
: "Upgrade to a PRO Workspace"}
{variant !== "workspace" ? "This Workspace is over the free limit" : "Upgrade to a PRO Workspace"}
</DialogTitle>
{variant !== "workspace" ? (
<p className="text-sm text-slate-500">
Your Insight page has{" "}
<span className="font-bold">
{overLimit} {variant}
</span>{" "}
but the free Workspace only allows for{" "}
<span className="font-bold">
{variant === "repositories" ? 100 : 10} {variant}
</span>{" "}
tracked. Don&apos;t worry, your insights won&apos;t be deleted. If you want to continue using
OpenSauced you should upgrade your Workspace to a PRO Account.
Your workspace has exceeded the limit for free usage. Free Workspaces only allow for 100 repositories
and 10 contributors tracked. Don&apos;t worry, your insights won&apos;t be deleted. If you want to
continue using OpenSauced you should upgrade your Workspace to a PRO Account.
</p>
) : (
<p className="text-sm text-slate-500">
Expand Down
30 changes: 28 additions & 2 deletions components/Workspaces/RepositoryStatCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { FaStar } from "react-icons/fa6";
import { BiGitRepoForked } from "react-icons/bi";
import { ArrowTrendingDownIcon, ArrowTrendingUpIcon, MinusSmallIcon } from "@heroicons/react/24/solid";
import { GitPullRequestIcon, HeartIcon, IssueOpenedIcon } from "@primer/octicons-react";

import Card from "components/atoms/Card/card";
import Pill from "components/atoms/Pill/pill";
import SkeletonWrapper from "components/atoms/SkeletonLoader/skeleton-wrapper";
Expand All @@ -21,12 +24,22 @@ type RepositoryStatCardProps = {
type: "engagement";
stats: { stars: number; forks: number; activity_ratio: number } | undefined;
}
| {
type: "stars";
stats: { total: number; range: number; over_range: number; average_over_range: number } | undefined;
}
| {
type: "forks";
stats: { total: number; range: number; over_range: number; average_over_range: number } | undefined;
}
);

const titles = {
pulls: "Pull Requests",
issues: "Issues",
engagement: "Engagement",
stars: "Stars",
forks: "Forks",
} as const;

type CardType = RepositoryStatCardProps["type"];
Expand All @@ -39,6 +52,10 @@ function getIcon(type: CardType) {
return <IssueOpenedIcon size={18} className="text-slate-600 border-1 rounded-md p-2 h-8 w-8 shadow-xs" />;
case "engagement":
return <HeartIcon size={18} className="text-slate-600 border-1 rounded-md p-2 h-8 w-8 shadow-xs" />;
case "stars":
return <FaStar size={18} className="text-slate-600 border-1 rounded-md p-2 h-8 w-8 shadow-xs" />;
case "forks":
return <BiGitRepoForked size={18} className="text-slate-600 border-1 rounded-md p-2 h-8 w-8 shadow-xs" />;
}
}

Expand All @@ -50,6 +67,9 @@ function getStatPropertiesByType(type: CardType) {
return ["opened", "closed", "velocity"];
case "engagement":
return ["stars", "forks", "activity_ratio"];
case "forks":
case "stars":
return ["total", "over_range", "average_over_range"];
default:
throw new Error("Invalid repository stat card type");
}
Expand Down Expand Up @@ -123,8 +143,14 @@ export const RepositoryStatCard = ({ stats, type, isLoading, hasError }: Reposit
.map(([stat, value]) => {
return (
<tr key={stat} className="flex flex-col">
<th scope="row" className="capitalize font-normal text-lg lg:text-sm text-light-slate-12 text-left">
{stat.replace("_", " ")}
<th scope="row" className="capitalize font-normal text-xs lg:text-sm text-light-slate-12 text-left">
{type === "stars" || type === "forks"
? stat === "over_range"
? `Over ${stats.range} Days`
: stat === "average_over_range"
? `Avg. per day`
: stat.replace("_", " ")
: stat.replace("_", " ")}
<span
className={`w-2 h-2 rounded-full ml-1 ${
stat === "opened"
Expand Down
7 changes: 2 additions & 5 deletions components/Workspaces/WorkspaceBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ export default function WorkspaceBanner({ workspaceId, openModal }: WorkspaceBan
}, []);

return (
<button
onClick={openModal}
className="absolute top-0 inset-x-0 w-full h-fit px-4 py-2 bg-light-orange-10 text-white"
>
This insight page is over the free limit. <span className="font-bold underline">Upgrade to a PRO Workspace.</span>
<button onClick={openModal} className="inset-x-0 w-full h-fit px-4 py-2 bg-light-orange-10 text-white">
This workspace is over the free limit. <span className="font-bold underline">Upgrade to a PRO Workspace.</span>
</button>
);
}
9 changes: 7 additions & 2 deletions components/Workspaces/WorkspaceLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useLocalStorage } from "react-use";
import { LuArrowRightToLine } from "react-icons/lu";
import { useOutsideClick } from "rooks";
import { useRef } from "react";
import clsx from "clsx";
import TopNav from "components/organisms/TopNav/top-nav";
import { AppSideBar } from "components/shared/AppSidebar/AppSidebar";
import { useMediaQuery } from "lib/hooks/useMediaQuery";
Expand Down Expand Up @@ -62,9 +63,13 @@ export const WorkspaceLayout = ({ workspaceId, banner, children, footer }: Works
)}
</ClientOnly>
</div>
<div className="relative flex flex-col items-center grow pt-8 md:pt-14 lg:pt-20">
<div className={clsx("flex-col items-center grow", !banner && "pt-8 md:pt-14 lg:pt-20")}>
<ClientOnly>{banner}</ClientOnly>
<div className="px-1 sm:px-2 md:px-4 xl:px-16 container w-full min-h-[100px] pb-20">{children}</div>
<div
className={clsx("px-1 sm:px-2 md:px-4 xl:px-16 container w-full min-h-[100px] pb-20", banner && "md:mt-9")}
>
{children}
</div>
</div>
</div>
{footer ? (
Expand Down
30 changes: 11 additions & 19 deletions components/organisms/TopNav/top-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Link from "next/link";
import { useRouter } from "next/router";
import React from "react";
import { useAsync } from "react-use";
import AuthSection from "components/molecules/AuthSection/auth-section";
import HeaderLogo from "components/molecules/HeaderLogo/header-logo";

Expand All @@ -11,7 +10,6 @@ import { useFetchUser } from "lib/hooks/useFetchUser";
import OnboardingButton from "components/molecules/OnboardingButton/onboarding-button";
import Tooltip from "components/atoms/Tooltip/tooltip";
import { useMediaQuery } from "lib/hooks/useMediaQuery";
import { getAllFeatureFlags } from "lib/utils/server/feature-flags";

const TopNav = () => {
const isLargeScreen = useMediaQuery("(min-width: 1024px)");
Expand Down Expand Up @@ -41,10 +39,6 @@ const TopNav = () => {
const Nav = ({ className }: { className?: string }) => {
const { user } = useSupabaseAuth();
const { data: gitHubUser } = useFetchUser(user?.user_metadata.user_name);
const state = useAsync(async () => {
const featureFlags = await getAllFeatureFlags(Number(user?.user_metadata.sub));
return featureFlags["star_search"];
}, [user]);
const userInterest = gitHubUser?.interests.split(",")[0] || "javascript";
const router = useRouter();

Expand Down Expand Up @@ -85,19 +79,17 @@ const Nav = ({ className }: { className?: string }) => {
Highlights
</Link>
</li>
{state.value && (
<li className="hidden lg:inline">
<Link
className={`tracking-tight font-medium text-sm text-slate-700 hover:text-orange-500 flex gap-1 items-center transition-all ${getActiveStyle(
router.pathname === "/star-search"
)}`}
href={"/star-search"}
>
<img src="/assets/star-search-logo.svg" alt="Star Search logo" className="w-5 h-5" />
<p className="mt-0.5">StarSearch</p>
</Link>
</li>
)}
<li className="hidden lg:inline">
<Link
className={`tracking-tight font-medium text-sm text-slate-700 hover:text-orange-500 flex gap-1 items-center transition-all ${getActiveStyle(
router.pathname === "/star-search"
)}`}
href={"/star-search"}
>
<img src="/assets/star-search-logo.svg" alt="Star Search logo" className="w-5 h-5" />
<p className="mt-0.5">StarSearch</p>
</Link>
</li>
</ul>
</nav>
);
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/api/useIsWorkspaceUpgraded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export function useIsWorkspaceUpgraded({ workspaceId }: { workspaceId: string })
publicApiFetcher as Fetcher<Workspace, Error>
);

return { data: data?.payee_user_id !== null, error };
return { data: data?.exceeds_upgrade_limits === false, error };
}
Loading

0 comments on commit e1e95c8

Please sign in to comment.