Skip to content

Commit

Permalink
chore: release 1.69.0 (#1863)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Oct 11, 2023
2 parents 1fc47e1 + ae164ed commit f546c0f
Show file tree
Hide file tree
Showing 38 changed files with 655 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
release:
environment:
name: ${{ needs.setup.outputs.DEPLOY_ENVIRONMENT }}
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}insights.opensauced.pizza
url: https://${{ needs.setup.outputs.DEPLOY_SUBDOMAIN }}app.opensauced.pizza
name: Semantic release
needs:
- setup
Expand Down
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,69 @@

> All notable changes to this project will be documented in this file
## [1.69.0-beta.8](https://github.com/open-sauced/insights/compare/v1.69.0-beta.7...v1.69.0-beta.8) (2023-10-11)


### 🍕 Features

* add repos/contributors treemap to list activity page ([#1853](https://github.com/open-sauced/insights/issues/1853)) ([70a67f0](https://github.com/open-sauced/insights/commit/70a67f08f6ab649621ef2c6115ca43f99ccd44ad))
* display featured insight pages to new contributors ([#1859](https://github.com/open-sauced/insights/issues/1859)) ([5344c59](https://github.com/open-sauced/insights/commit/5344c59538ae77b0d5f662fcd04e5dcc19807cc8))


### 🐛 Bug Fixes

* fixed API querystring param for repo_id for treemap API call ([0b914ba](https://github.com/open-sauced/insights/commit/0b914bab081344fc1d2fc8c67fdcc1bc8e2f09ce))
* made dynamic treemap import ssr false ([9a94bf0](https://github.com/open-sauced/insights/commit/9a94bf08fda293eb1a5f63553e6c8b4f2ce0f223))

## [1.69.0-beta.7](https://github.com/open-sauced/insights/compare/v1.69.0-beta.6...v1.69.0-beta.7) (2023-10-11)


### 🍕 Features

* add contributor search to list contributors ([#1862](https://github.com/open-sauced/insights/issues/1862)) ([8e99a1d](https://github.com/open-sauced/insights/commit/8e99a1df73092edb560357d62bfc700af522ea73))

## [1.69.0-beta.6](https://github.com/open-sauced/insights/compare/v1.69.0-beta.5...v1.69.0-beta.6) (2023-10-11)


### 🐛 Bug Fixes

* show link to hub list page in nav ([#1858](https://github.com/open-sauced/insights/issues/1858)) ([099b1aa](https://github.com/open-sauced/insights/commit/099b1aa51036111cd8c751ca286202b06be76ec4))

## [1.69.0-beta.5](https://github.com/open-sauced/insights/compare/v1.69.0-beta.4...v1.69.0-beta.5) (2023-10-11)


### 🍕 Features

* add lists link to global top nav ([#1861](https://github.com/open-sauced/insights/issues/1861)) ([9dd61be](https://github.com/open-sauced/insights/commit/9dd61beaa131ddab744c6f62be5c6029400b61d9))

## [1.69.0-beta.4](https://github.com/open-sauced/insights/compare/v1.69.0-beta.3...v1.69.0-beta.4) (2023-10-10)


### 🍕 Features

* upgrade posthog version to support posthog survey feedback ([#1857](https://github.com/open-sauced/insights/issues/1857)) ([ca44b27](https://github.com/open-sauced/insights/commit/ca44b27815d6ad2d68af1b07d998d3bf8282dced))

## [1.69.0-beta.3](https://github.com/open-sauced/insights/compare/v1.69.0-beta.2...v1.69.0-beta.3) (2023-10-10)


### 🧑‍💻 Code Refactoring

* Remove + icon from list contributors stacked avatar ([#1851](https://github.com/open-sauced/insights/issues/1851)) ([264f0dd](https://github.com/open-sauced/insights/commit/264f0ddd2fa1378407c65fdc859a9a04ae3f6a5e))

## [1.69.0-beta.2](https://github.com/open-sauced/insights/compare/v1.69.0-beta.1...v1.69.0-beta.2) (2023-10-10)


### 🐛 Bug Fixes

* Repos with long names get cut off ([#1769](https://github.com/open-sauced/insights/issues/1769)) ([cabf292](https://github.com/open-sauced/insights/commit/cabf2929f2d31cca95e8d3fe277d483276615118))

## [1.69.0-beta.1](https://github.com/open-sauced/insights/compare/v1.68.0...v1.69.0-beta.1) (2023-10-10)


### 🍕 Features

* add `Add to list` dropdown to user profile ([#1843](https://github.com/open-sauced/insights/issues/1843)) ([4d81040](https://github.com/open-sauced/insights/commit/4d81040d1968b75605eb4b42192f1cf982d090e1))

## [1.68.0](https://github.com/open-sauced/insights/compare/v1.67.0...v1.68.0) (2023-10-10)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<br>
<img alt="Open Sauced" src="https://i.ibb.co/7jPXt0Z/logo1-92f1a87f.png" width="300px">
<h1>🍕 insights.opensauced.pizza 🍕</h1>
<h1>🍕 app.opensauced.pizza 🍕</h1>
<strong>The site provides insights to Open Source projects.</strong>
</div>
<br>
Expand Down
106 changes: 52 additions & 54 deletions components/atoms/Select/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ import { Command, CommandGroup, CommandInput, CommandItem } from "../Cmd/command
export type OptionKeys = Record<"value" | "label", string>;

interface MultiSelectProps {
open: boolean;
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
options: OptionKeys[];
selected: OptionKeys[];
setSelected?: React.Dispatch<React.SetStateAction<OptionKeys[]>>;
handleSelect: (value: OptionKeys) => void;
placeholder?: string;
inputPlaceholder?: string;
className?: string;
handleKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
emptyState?: React.ReactNode;
}

const MultiSelect = ({
Expand All @@ -28,30 +32,20 @@ const MultiSelect = ({
placeholder,
handleKeyDown,
inputPlaceholder,
setSelected,
open,
setOpen,
emptyState,
}: MultiSelectProps) => {
const inputRef = useRef<HTMLInputElement>(null);
const [open, setOpen] = React.useState(false);
const [inputValue, setInputValue] = useState("");
const [dummySelected, setDummySelected] = useState<OptionKeys[]>([]);

// For testing purposes, this component is meant to be stateless.

const toggleFramework = (option: OptionKeys) => {
const isOptionSelected = dummySelected.some((s) => s.value === option.value);
if (isOptionSelected) {
setDummySelected((prev) => prev.filter((s) => s.value !== option.value));
} else {
setDummySelected((prev) => [...prev, option]);
}
inputRef?.current?.focus();
};

return (
<Popover open={open} onOpenChange={(value) => setOpen(value)}>
<div className="min-w-[250px] max-w-[100px] ">
<div className="">
<PopoverTrigger
asChild
className="p-1.5 border rounded-md bg-white data-[state=open]:border-orange-500 min-w-[250px] "
className={clsx("p-1.5 border rounded-md bg-white data-[state=open]:border-orange-500 min-w-max", className)}
>
<button
aria-controls="select-menu-list"
Expand All @@ -62,7 +56,7 @@ const MultiSelect = ({
{selected.length > 0 ? (
<span className="truncate">
{selected[0].label}
{selected.length > 1 ? `, +${dummySelected.length - 1}` : null}
{selected.length > 1 ? `, +${selected.length - 1}` : null}
</span>
) : (
<span className="opacity-50">{placeholder ?? "Select Items"}</span>
Expand All @@ -73,7 +67,7 @@ const MultiSelect = ({
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
setDummySelected([]);
setSelected?.([]);
}}
>
<IoMdCloseCircle className="text-red-600" />
Expand All @@ -83,42 +77,46 @@ const MultiSelect = ({
)}
</button>
</PopoverTrigger>
<PopoverContent className="!w-full !min-w-[250px] bg-white p-0 max-w-sm">
<Command loop onKeyDown={handleKeyDown} className="w-full px-0 bg-transparent">
<CommandInput
ref={inputRef}
placeholder={placeholder ?? "Search Items"}
value={inputValue}
onValueChange={setInputValue}
/>
<CommandGroup className="flex flex-col !px-0 overflow-scroll max-h-48">
{open && options.length > 0
? options.map((option) => (
<CommandItem
key={option.value}
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
}}
onSelect={(value) => {
setInputValue("");
toggleFramework(option);
}}
onClick={() => toggleFramework(option)}
className={clsx(
"!cursor-pointer flex justify-between items-center !px-1 rounded-md truncate break-words w-full",
selected.some((s) => s.value === option.value) && "bg-gray-100"
)}
>
{option.label}
{selected.some((s) => s.value === option.value) && (
<IoCheckmarkSharp className="w-5 h-5 ml-2 text-sauced-orange shrink-0" />
)}
</CommandItem>
))
: null}
</CommandGroup>
</Command>
<PopoverContent align="end" className="!w-full bg-white p-0 max-w-sm">
{options.length > 0 && (
<Command loop onKeyDown={handleKeyDown} className="w-full px-0 bg-transparent">
<CommandInput
ref={inputRef}
placeholder={inputPlaceholder ?? "Search Items"}
value={inputValue}
onValueChange={setInputValue}
/>
<CommandGroup className="flex flex-col !px-0 overflow-scroll max-h-48">
{open && options.length > 0
? options.map((option) => (
<CommandItem
key={option.value}
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
}}
onSelect={(value) => {
setInputValue("");
// toggleFramework(option);
handleSelect(option);
}}
onClick={() => handleSelect(option)}
className={clsx(
"!cursor-pointer flex justify-between items-center !px-1 rounded-md truncate break-words w-full",
selected.some((s) => s.value === option.value) && ""
)}
>
{option.label}
{selected.some((s) => s.value === option.value) && (
<IoCheckmarkSharp className="w-5 h-5 ml-2 text-sauced-orange shrink-0" />
)}
</CommandItem>
))
: null}
</CommandGroup>
</Command>
)}
{options.length === 0 && emptyState ? emptyState : null}
</PopoverContent>
</div>
</Popover>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { useSpring, animated } from "@react-spring/web";
import dynamic from "next/dynamic";
import Card from "components/atoms/Card/card";
import { SpecialNode } from "stories/molecules/treemap-prototype/special-node";
import { ContributorNode } from "stories/molecules/treemap-prototype/contributor-node";
import ClientOnly from "components/atoms/ClientOnly/client-only";
import type { NodeMouseEventHandler, NodeProps } from "@nivo/treemap";

interface ContributionsTreemapProps {
data: any;
color: string;
onClick: NodeMouseEventHandler<object>;
repoId: number | null;
setRepoId: (repoId: number | null) => void;
}

function BreadCrumb({ isActive, ...rest }: any) {
const separatorStyle = useSpring(isActive ? { opacity: 1 } : { opacity: 0 });
const textStyle = useSpring(isActive ? { opacity: 1, translateX: 0 } : { opacity: 0, translateX: 100 });

return (
<>
<animated.div className={"px-1"} style={separatorStyle}>
{"/"}
</animated.div>
<animated.div style={textStyle} {...rest} />
</>
);
}

const ResponsiveTreeMapHtml = dynamic(() => import("@nivo/treemap").then((module) => module.ResponsiveTreeMapHtml), {
ssr: false,
});

export const ContributionsTreemap = ({ setRepoId, repoId, data, color, onClick }: ContributionsTreemapProps) => {
return (
<Card className="grid place-content-stretch">
<div className="grid">
{/* Label: Text */}
<div className="text-lg text-slate-900 mb-2 flex">
<button className="cursor-pointer" onClick={() => setRepoId(null)}>
Repos
</button>
<div> </div>
<BreadCrumb isActive={repoId !== null}>Contributors</BreadCrumb>
</div>
<div className="rounded-md overflow-hidden grid place-content-stretch">
<div className="grid" style={{ gridArea: "1 / 1" }}>
<ClientOnly>
<ResponsiveTreeMapHtml
data={data}
tile="squarify"
labelSkipSize={12}
innerPadding={4}
leavesOnly
orientLabel={false}
nodeComponent={
repoId === null
? SpecialNode
: // TODO: Sort this out later
(ContributorNode as <Datum extends object>({
node,
animatedProps,
borderWidth,
enableLabel,
labelSkipSize,
}: NodeProps<Datum>) => JSX.Element)
}
colors={color}
nodeOpacity={1}
borderWidth={0}
onClick={onClick}
motionConfig={"default"}
/>
</ClientOnly>
</div>
</div>
</div>
</Card>
);
};
Loading

0 comments on commit f546c0f

Please sign in to comment.