Skip to content

Commit

Permalink
chore: release 2.57.0 (#3964)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Aug 15, 2024
2 parents 6b7eca8 + 6c5988f commit 28e8b8e
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 98 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@

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

## [2.57.0-beta.3](https://github.com/open-sauced/app/compare/v2.57.0-beta.2...v2.57.0-beta.3) (2024-08-15)


### 🐛 Bug Fixes

* add docs link for SBOM to repository page ([#3958](https://github.com/open-sauced/app/issues/3958)) ([58360d9](https://github.com/open-sauced/app/commit/58360d9e85f0c9118e1734b8d7275fd066462639))

## [2.57.0-beta.2](https://github.com/open-sauced/app/compare/v2.57.0-beta.1...v2.57.0-beta.2) (2024-08-15)


### 🐛 Bug Fixes

* add loading feedback when creating contributor insight ([#3947](https://github.com/open-sauced/app/issues/3947)) ([7f94272](https://github.com/open-sauced/app/commit/7f94272ccd1a7b073137bc221647f6154d2b24a8))

## [2.57.0-beta.1](https://github.com/open-sauced/app/compare/v2.56.1-beta.1...v2.57.0-beta.1) (2024-08-15)


### 🍕 Features

* update onboarding steps to include sharing the DevCard ([#3951](https://github.com/open-sauced/app/issues/3951)) ([1391aad](https://github.com/open-sauced/app/commit/1391aadc0629bbd2599456a7c5823a11161ab225))

## [2.56.1-beta.1](https://github.com/open-sauced/app/compare/v2.56.0...v2.56.1-beta.1) (2024-08-15)


### 🐛 Bug Fixes

* now see it now link on feed when logged in goes to the user's dev card ([#3954](https://github.com/open-sauced/app/issues/3954)) ([cd3d5b2](https://github.com/open-sauced/app/commit/cd3d5b2554dfb9deec196b1551114358f84767fb))

## [2.56.0](https://github.com/open-sauced/app/compare/v2.55.2...v2.56.0) (2024-08-14)


Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@open-sauced/app",
"description": "🍕The dashboard for open source discovery.",
"keywords": [],
"version": "2.56.0",
"version": "2.57.0-beta.3",
"author": "Brian Douglas <[email protected]>",
"private": true,
"license": "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default function Feeds(props: HighlightSSRProps) {
"Discover your open source impact with the OSCR - Open Source Contributor Rating. Visit your profile to view your personalized DevCard, showcasing your influence and impact on the open source ecosystem. Check out your OSCR DevCard and share it today!"
}
bannerSrc={"/assets/images/anouncement-cards/OSCR-devcard.png"}
url={`/u/${loggedInUser?.name ? loggedInUser.name + "/card" : "bdougie/card"}`}
url={`/u/${loggedInUser?.login ? loggedInUser.login + "/card" : "bdougie/card"}`}
cta={"See It Now!"}
/>
</div>
Expand Down
6 changes: 5 additions & 1 deletion pages/s/[org]/[repo]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ export default function RepoPage({ repoData, ogImageUrl }: RepoPageProps) {
<div className="grid gap-2">
<p>Create a workspace from the software bill of materials (SBOM) for this repository</p>

<a href="https://www.cisa.gov/sbom" className="underline" target="_blank">
<a
href="https://opensauced.pizza/docs/features/repo-pages/#create-a-workspace-from-sbom"
className="underline"
target="_blank"
>
Learn more...<span className="sr-only"> about SBOM</span>
</a>
</div>
Expand Down
183 changes: 90 additions & 93 deletions pages/start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ import Title from "components/atoms/Typography/title";
import Text from "components/atoms/Typography/text";
import Icon from "components/atoms/Icon/icon";
import Button from "components/shared/Button/button";
import DevCard from "components/molecules/DevCard/dev-card";

import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import { setQueryParams } from "lib/utils/query-params";
import useSession from "lib/hooks/useSession";
import { captureAnalytics } from "lib/utils/analytics";

import useStore from "lib/store";
import { getInterestOptions } from "lib/utils/getInterestOptions";

import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "components/atoms/Select/select";
import { timezones } from "lib/utils/timezones";
import { useFetchUser } from "lib/hooks/useFetchUser";
import { LanguageSwitch } from "components/shared/LanguageSwitch/language-switch";

type StepKeys = "1" | "2" | "3";

Expand Down Expand Up @@ -66,11 +65,11 @@ const LoginStep1: React.FC<LoginStep1Props> = ({ user }) => {

useEffect(() => {
if (onboarded) {
router.push("/workspaces");
// router.push("/workspaces");
} else if (onboarded === false && user && providerToken) {
setQueryParams({ step: "2" } satisfies QueryParams);
}
}, [user, onboarded, providerToken]);
}, [user, onboarded, providerToken, router]);

const handleGitHubAuth = async () => {
// Redirect user to GitHub to authenticate
Expand Down Expand Up @@ -127,83 +126,10 @@ const LoginStep1: React.FC<LoginStep1Props> = ({ user }) => {
};

interface LoginStep2Props {
handleUpdateInterests: (interests: string[]) => void;
}

const LoginStep2: React.FC<LoginStep2Props> = ({ handleUpdateInterests: handleUpdateInterestsParent }) => {
const [selectedInterests, setSelectedInterests] = useState<string[]>([]);
const interestArray = getInterestOptions();
const { user } = useSupabaseAuth();
const { data: userInfo, isLoading } = useFetchUser(user?.user_metadata.user_name);

useEffect(() => {
if (isLoading) {
return;
}

captureAnalytics({
title: "User Onboarding",
property: "onboardingStep2",
value: "visited",
userInfo,
});
}, [userInfo, isLoading]);

const handleSelectInterest = (interest: string) => {
if (selectedInterests.length > 0 && selectedInterests.includes(interest)) {
setSelectedInterests((prev) => prev.filter((item) => item !== interest));
} else {
setSelectedInterests((prev) => [...prev, interest]);
}
};

const handleUpdateInterest = async () => {
handleUpdateInterestsParent(selectedInterests);
setQueryParams({ step: "3" } satisfies QueryParams);
};

return (
<>
<div className="flex flex-col h-full login-step lg:gap-28">
<div>
<div className="flex items-center gap-2 mb-4">
<Icon className="lg:hidden" IconImage={ChooseInterestsActiveIcon} size={48} />
<Title className="!text-sm !text-light-orange-9">Step Two</Title>
</div>
<div className="gap-2 mb-4">
<Title className="!text-2xl">Choose your interests</Title>
</div>
<div className="mb-4 text-left ">
<Text className="!text-sm">
Take a moment to select your interests to help us provide personalized project recommendations. By doing
so, you&apos;ll find projects that match your skills and aspirations.
</Text>
</div>
<div className="flex flex-wrap gap-3">
{interestArray.map((topic, index) => (
<LanguageSwitch
checked={selectedInterests.includes(topic)}
onClick={() => handleSelectInterest(topic)}
topic={topic}
key={index}
/>
))}
</div>
</div>
<Button onClick={handleUpdateInterest} variant="primary" className="justify-center w-full h-10 mt-3">
Confirm Selections
</Button>
</div>
</>
);
};

interface LoginStep3Props {
interests: string[];
user: User | null;
}

const LoginStep3: React.FC<LoginStep3Props> = ({ interests, user }) => {
const LoginStep2: React.FC<LoginStep2Props> = ({ user }) => {
const { data: userInfo, isLoading } = useFetchUser(user?.user_metadata.user_name);

useEffect(() => {
Expand All @@ -213,14 +139,13 @@ const LoginStep3: React.FC<LoginStep3Props> = ({ interests, user }) => {

captureAnalytics({
title: "User Onboarding",
property: "onboardingStep3",
property: "onboardingStep2",
value: "visited",
userInfo,
});
}, [userInfo, isLoading]);

const store = useStore();
const router = useRouter();
const { sessionToken } = useSupabaseAuth();
const [timezone, setTimezone] = useState("");
const [loading, setLoading] = useState(false);
Expand All @@ -242,12 +167,12 @@ const LoginStep3: React.FC<LoginStep3Props> = ({ interests, user }) => {
"Content-Type": "application/json",
Authorization: `Bearer ${sessionToken}`,
},
body: JSON.stringify({ interests, timezone }),
body: JSON.stringify({ interests: [], timezone }),
});

if (data.ok) {
store.onboardUser();
router.push("/workspaces");
setQueryParams({ step: "3" } satisfies QueryParams);
} else {
setLoading(false);
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -315,6 +240,77 @@ const LoginStep3: React.FC<LoginStep3Props> = ({ interests, user }) => {
);
};

interface LoginStep3Props {
user: User | null;
}

const LoginStep3: React.FC<LoginStep3Props> = ({ user }) => {
type UserDevStats = DbUser & DbListContributorStat;
const username: string = user?.user_metadata.user_name;
const router = useRouter();
const [userDevStats, setUserDevStats] = useState<UserDevStats | undefined>(undefined);

async function fetchUserData(username: string) {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/users/${username}/devstats`, {
headers: {
"Content-Type": "application/json",
},
});

if (response.ok) {
return (await response.json()) as UserDevStats;
}

return undefined;
}

useEffect(() => {
fetchUserData(username).then((devstats) => {
setUserDevStats(devstats);
});
}, []);

return (
<>
<div className="flex flex-col h-full lg:gap-36">
<div>
<div className="flex items-center gap-2 mb-4">
<Icon className="lg:hidden" IconImage={ChooseInterestsActiveIcon} size={48} />
<Title className="!text-sm !text-light-orange-9">Congrats!</Title>
</div>
<div className="gap-2 mb-4">
<Title className="!text-2xl">Share Your DevCard!</Title>
</div>
<div className="mb-4 text-left ">
<Text className="!text-sm">
Congratulations on your new account. Share your creator card to let other people know you&apos;re here.
</Text>
</div>
<div className="flex justify-center mb-4 md:mb-0">
{userDevStats && <DevCard key="card" isInteractive={false} user={userDevStats} isFlipped={false} />}
</div>

<Button
variant="primary"
onClick={() => router.push(`/u/${username}/card`)}
className="justify-center w-full mt-4"
>
Go to Your DevCard
</Button>

<Button
variant="primary"
onClick={() => router.push(`/u/${username}`)}
className="justify-center w-full mt-4"
>
Go to Your Profile
</Button>
</div>
</div>
</>
);
};

const Login: WithPageLayout = () => {
type LoginSteps = number;

Expand All @@ -328,8 +324,6 @@ const Login: WithPageLayout = () => {

const [currentLoginStep, setCurrentLoginStep] = useState<LoginSteps>(Number(step) || 1);

const [interests, setInterests] = useState<string[]>([]);

useEffect(() => {
if (step) {
setCurrentLoginStep(Number(step));
Expand Down Expand Up @@ -364,24 +358,27 @@ const Login: WithPageLayout = () => {
<Icon
IconImage={
currentLoginStep === 2
? ChooseInterestsActiveIcon
? ChooseTimezoneActiveIcon
: currentLoginStep < 2
? ChooseInterestsIcon
? ChooseTimezoneIcon
: CompletedIcon
}
size={48}
/>
<Text disabled={currentLoginStep !== 2} className={`!text-[16px] ${currentLoginStep === 2 && highlighted}`}>
Choose your interests
<Text
disabled={currentLoginStep !== 2}
className={`!text-[16px] ${currentLoginStep === 2 && highlighted}`}
>
What time is it?
</Text>
</div>
<div className="items-center hidden gap-2 mb-8 lg:flex">
<Icon
IconImage={
currentLoginStep === 3
? ChooseTimezoneActiveIcon
? ChooseInterestsActiveIcon
: currentLoginStep < 3
? ChooseTimezoneIcon
? ChooseInterestsIcon
: CompletedIcon
}
size={48}
Expand All @@ -390,14 +387,14 @@ const Login: WithPageLayout = () => {
disabled={currentLoginStep !== 3}
className={`!text-[16px] ${currentLoginStep === 3 && highlighted}`}
>
What time is it?
Share Your DevCard!
</Text>
</div>
</section>
<section className="w-full lg:max-w-[50%] p-9 rounded-lg lg:rounded-r-lg bg-white">
{currentLoginStep === 1 && <LoginStep1 user={user} />}
{currentLoginStep === 2 && <LoginStep2 handleUpdateInterests={(interests) => setInterests(interests)} />}
{currentLoginStep >= 3 && <LoginStep3 interests={interests} user={user} />}
{currentLoginStep === 2 && <LoginStep2 user={user} />}
{currentLoginStep >= 3 && <LoginStep3 user={user} />}
</section>
</>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export default function ContributorInsightEditPage({
className="flex gap-2.5 items-center cursor-pointer w-min sm:mt-0 self-end"
disabled={loading}
onClick={updateInsight}
loading={loading}
loadingText={"Updating insight"}
>
Update Insight
</Button>
Expand Down
2 changes: 2 additions & 0 deletions pages/workspaces/[workspaceId]/contributor-insights/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export default function CreateContributorInsightPage({
variant="primary"
className="flex gap-2.5 items-center cursor-pointer w-min mt-2 sm:mt-0 self-end"
disabled={loading}
loading={loading}
loadingText={"Creating insight"}
>
Create Insight
</Button>
Expand Down

0 comments on commit 28e8b8e

Please sign in to comment.