Skip to content

Commit

Permalink
chore: Release 1.77.0 (#2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline authored Nov 20, 2023
2 parents fb28219 + a8f781b commit a072f27
Show file tree
Hide file tree
Showing 24 changed files with 439 additions and 112 deletions.
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.77.0-beta.7](https://github.com/open-sauced/insights/compare/v1.77.0-beta.6...v1.77.0-beta.7) (2023-11-20)


### 🐛 Bug Fixes

* feature flagged contributions evolution by contributor type graph ([#2187](https://github.com/open-sauced/insights/issues/2187)) ([98637b6](https://github.com/open-sauced/insights/commit/98637b67fcba8efb7ef56b20d78699e4c84aa90a))

## [1.77.0-beta.6](https://github.com/open-sauced/insights/compare/v1.77.0-beta.5...v1.77.0-beta.6) (2023-11-20)


### 🧑‍💻 Code Refactoring

* params create highlight logic ([#2096](https://github.com/open-sauced/insights/issues/2096)) ([8b697a6](https://github.com/open-sauced/insights/commit/8b697a685d1c7b41d402cab3501a46f3eb54a623))

## [1.77.0-beta.5](https://github.com/open-sauced/insights/compare/v1.77.0-beta.4...v1.77.0-beta.5) (2023-11-20)


### 🍕 Features

* Svelte added to interests dropdown list ([#2168](https://github.com/open-sauced/insights/issues/2168)) ([88a778e](https://github.com/open-sauced/insights/commit/88a778e64f4a38b0991995055681d6b31bee5c6e))

## [1.77.0-beta.4](https://github.com/open-sauced/insights/compare/v1.77.0-beta.3...v1.77.0-beta.4) (2023-11-20)


### 🐛 Bug Fixes

* fixed styling of insights delete page modal ([#2182](https://github.com/open-sauced/insights/issues/2182)) ([41b2e8a](https://github.com/open-sauced/insights/commit/41b2e8a15ac36349917dd4319a2a13b26a946b6b))

## [1.77.0-beta.3](https://github.com/open-sauced/insights/compare/v1.77.0-beta.2...v1.77.0-beta.3) (2023-11-18)


### 🍕 Features

* implemented feature flag support ([e4acf39](https://github.com/open-sauced/insights/commit/e4acf39aed6ac9caaad912c801a59830dc3dcd30))
* implemented feature flag support ([#2180](https://github.com/open-sauced/insights/issues/2180)) ([a53dfb6](https://github.com/open-sauced/insights/commit/a53dfb663d1ed5f61ba4df27163cb9f0829b18bd))

## [1.77.0-beta.2](https://github.com/open-sauced/insights/compare/v1.77.0-beta.1...v1.77.0-beta.2) (2023-11-17)


### 🐛 Bug Fixes

* use custom text-area component for bio ([#2103](https://github.com/open-sauced/insights/issues/2103)) ([3afe9d5](https://github.com/open-sauced/insights/commit/3afe9d5b300bfe1d91d6d2a3013d58583b4378b9))

## [1.77.0-beta.1](https://github.com/open-sauced/insights/compare/v1.76.1-beta.1...v1.77.0-beta.1) (2023-11-17)


### ⏩ Reverts

* Revert "fix: refactor TableRepositoryName prop naming (#2102)" ([8dd5d71](https://github.com/open-sauced/insights/commit/8dd5d71e22251b967ff42201a8eb543c98d07a17)), closes [#2102](https://github.com/open-sauced/insights/issues/2102)


### 🍕 Features

* add most used languages graph ([#2158](https://github.com/open-sauced/insights/issues/2158)) ([c79381b](https://github.com/open-sauced/insights/commit/c79381bc2b588a7641f87ee0aeef89d7a1dc681f))

### [1.76.1-beta.1](https://github.com/open-sauced/insights/compare/v1.76.0...v1.76.1-beta.1) (2023-11-17)


### 🐛 Bug Fixes

* changed delete button color to match the ui ([#2159](https://github.com/open-sauced/insights/issues/2159)) ([6e7e3bd](https://github.com/open-sauced/insights/commit/6e7e3bd543186dc2027c6ab6e422cf4967f8275c))
* Revert "fix: refactor TableRepositoryName prop naming ([#2102](https://github.com/open-sauced/insights/issues/2102))" ([#2169](https://github.com/open-sauced/insights/issues/2169)) ([5f49034](https://github.com/open-sauced/insights/commit/5f49034e78427dba2f9c091df8a09b2bd2526b2e))

## [1.76.0](https://github.com/open-sauced/insights/compare/v1.75.0...v1.76.0) (2023-11-16)


Expand Down
134 changes: 134 additions & 0 deletions components/Graphs/MostUsedLanguagesGraph/most-used-languages-graph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import { BsFillCircleFill } from "react-icons/bs";
import Skeleton from "react-loading-skeleton";
import { useEffect, useRef, useState } from "react";
import Card from "components/atoms/Card/card";
import Text from "components/atoms/Typography/text";
import { ContributorType, ContributorTypeFilter } from "../shared/contributor-type-filter";

export interface MostUsedLanguagesGraphProps {
data: {
mainLanguage: string;
data: {
name: string;
value: number;
}[];
};
setContributorType: (type: ContributorType) => void;
contributorType: ContributorType;
isLoading?: boolean;
}

export const MostUsedLanguagesGraph = ({
data,
setContributorType,
contributorType,
isLoading = false,
}: MostUsedLanguagesGraphProps) => {
const colors = [
"hsl(53, 91%, 59%)",
"hsl(204, 100%, 40%)",
"hsl(14, 98%, 49%)",
"hsl(267, 36%, 37%)",
"hsl(17, 100%, 50%)",
];
const percentage = 10;
const { data: languages = [], mainLanguage } = data;
const lastItem = languages.length > 0 ? languages.length - 1 : 0;
const sortedLanguages = languages.sort((a, b) => b.value - a.value);
const languagesRef = useRef<HTMLUListElement>(null);
const [language, setLanguage] = useState<string | null>();

useEffect(() => {
if (language) {
const languageElement = languagesRef.current?.querySelector(`[data-language="${language}"]`);
if (languageElement) {
languageElement.classList.add("font-semibold");
}
}
}, [language]);

return (
<Card className="p-5">
<div className="flex flex-col gap-6">
<div>
<h2 className="pb-1 font-medium text-lg tracking-tight">Most used languages</h2>
<Text>
{mainLanguage} contributions have been growing on average {percentage}% MoM
</Text>
</div>
<div className="w-max">
<ContributorTypeFilter setContributorType={setContributorType} contributorType={contributorType} />
</div>

<div className="flex h-3 place-content-center">
{isLoading ? (
<div className="loading rounded-lg w-max" style={{ width: "100%" }}>
<span className="sr-only">loading most used languages graph</span>
</div>
) : (
<>
{sortedLanguages.length > 0 ? (
sortedLanguages.map((item, index) => {
return (
<button
aria-label={`${item.name} is ${item.value}% of the most used languages for contributors in your list`}
key={item.name}
data-language={item.name}
className={`${index === 0 ? "rounded-l-lg" : ""} ${
index === lastItem ? "rounded-r-lg" : ""
} transform hover:scale-110 transition-transform hover:z-10`}
style={{ backgroundColor: colors[index], width: `${item.value}%` }}
onMouseOver={(event) => {
const { language } = event.currentTarget.dataset;
setLanguage(language);
}}
onMouseOut={(event) => {
setLanguage(null);
}}
onFocus={(event) => {
const { language } = event.currentTarget.dataset;
setLanguage(language);
}}
onBlur={(event) => {
setLanguage(null);
}}
/>
);
})
) : (
<div className="rounded-lg bg-slate-100 w-full" />
)}
</>
)}
</div>

{isLoading ? (
<Skeleton height={24} count={5} className="mt-4 mb-4" />
) : (
<ul ref={languagesRef} className="grid grid-cols-1 content-center">
{sortedLanguages.length > 0 ? (
sortedLanguages.map((item, index) => (
<li
key={item.name}
className={`flex justify-between pt-4 pb-4 ${
index === lastItem ? "" : "border-b-1 border-slate-100"
} ${language === item.name ? "font-semibold" : ""}`}
>
<span
className={`flex gap-2 items-center ${language === item.name ? "text-black" : "text-slate-700"}`}
>
<BsFillCircleFill size={11} style={{ fill: colors[index] }} />
{item.name}
</span>
<span className={`${language === item.name ? "text-black" : "text-slate-600"}`}>{item.value}%</span>
</li>
))
) : (
<p className="text-center">There is no language data</p>
)}
</ul>
)}
</div>
</Card>
);
};
50 changes: 50 additions & 0 deletions components/Graphs/shared/contributor-type-filter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import Button from "components/atoms/Button/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "components/atoms/Dropdown/dropdown";
import PeopleIcon from "img/icons/people.svg";
import ChevronDownIcon from "img/chevron-down.svg";
import SVGIcon from "components/atoms/SVGIcon/svg-icon";
import Icon from "components/atoms/Icon/icon";

interface ContributorTypeFilterProps {
setContributorType: (type: ContributorType) => void;
contributorType: ContributorType;
}

export type ContributorType = "all" | "active" | "new" | "alumni";

const peopleFilters: Record<ContributorType, string> = {
all: "All Contributors",
active: "Active Contributors",
new: "New Contributors",
alumni: "Alumni Contributors",
};

export const ContributorTypeFilter = ({ setContributorType, contributorType }: ContributorTypeFilterProps) => {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="default" className="items-center gap-1">
<SVGIcon IconImage={`${PeopleIcon.src}#icon`} className="w-4 h-4" />
{peopleFilters[contributorType]}
<Icon IconImage={ChevronDownIcon} className="w-4 h-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="flex flex-col gap-2">
{Object.entries(peopleFilters).map(([key, value]) => (
<DropdownMenuItem
key={key}
className="rounded-md !cursor-pointer"
onClick={() => setContributorType(key as keyof typeof peopleFilters)}
>
{value}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
);
};
1 change: 1 addition & 0 deletions components/atoms/LanguagePill/LanguagePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface LanguagePillProps {
| "csharp"
| "php"
| "java"
| "svelte"
| "typescript"
| "golang"
| "vue"
Expand Down
4 changes: 2 additions & 2 deletions components/molecules/HighlightInput/highlight-input-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
className="flex-1 font-normal placeholder:text-sm focus:outline-none"
type="text"
placeholder={"Post a highlight to show your work!"}
id="highlight-create-input"
id="highlight-create"
onFocus={() => setIsDivFocused(true)}
/>
</div>
Expand Down Expand Up @@ -972,7 +972,7 @@ const HighlightInputForm = ({ refreshCallback }: HighlightInputFormProps): JSX.E
<div
onClick={() => setIsFormOpenMobile(true)}
className="p-3 mb-10 -mr-4 text-white rounded-full shadow-lg bg-light-orange-10"
id="mobile-highlight-create-button"
id="mobile-highlight-create"
>
<RxPencil1 className="text-3xl" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@ import { useGesture } from "@use-gesture/react";

import { ReactNode, useState } from "react";
import * as RawTooltip from "@radix-ui/react-tooltip";
import Button from "components/atoms/Button/button";
import Card from "components/atoms/Card/card";
import Icon from "components/atoms/Icon/icon";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "components/atoms/Dropdown/dropdown";
import PeopleIcon from "img/icons/people.svg";
import ChevronDownIcon from "img/chevron-down.svg";
import SVGIcon from "components/atoms/SVGIcon/svg-icon";

import Tooltip from "components/atoms/Tooltip/tooltip";
import { ContributorType, ContributorTypeFilter } from "components/Graphs/shared/contributor-type-filter";
import AvatarHoverCard from "components/atoms/Avatar/avatar-hover-card";

// omit total_contributions and login from ContributorStat
Expand All @@ -40,8 +31,6 @@ export interface ContributorStat {
total_contributions: number;
}

export type ContributorType = "all" | "active" | "new" | "alumni";

interface Props {
topContributor?: ContributorStat;
data: ContributorStat[];
Expand All @@ -51,13 +40,6 @@ interface Props {
totalContributions: number;
}

const peopleFilters: Record<ContributorType, string> = {
all: "All Contributors",
active: "Active Contributors",
new: "New Contributors",
alumni: "Alumni Contributors",
};

const LegendItem = ({ color, title }: { color?: string; title: string }) => {
return (
<div className="flex items-center gap-2">
Expand Down Expand Up @@ -136,26 +118,7 @@ export default function MostActiveContributorsCard({

{/* buttons */}
<div className="flex gap-1 mb-4">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="default" className="items-center gap-1">
<SVGIcon IconImage={`${PeopleIcon.src}#icon`} className="w-4 h-4" />
{peopleFilters[contributorType]}
<Icon IconImage={ChevronDownIcon} className="w-4 h-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="flex flex-col gap-2">
{Object.entries(peopleFilters).map(([key, value]) => (
<DropdownMenuItem
key={key}
className="rounded-md !cursor-pointer"
onClick={() => setContributorType(key as keyof typeof peopleFilters)}
>
{value}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
<ContributorTypeFilter contributorType={contributorType} setContributorType={setContributorType} />
</div>
{/* chart */}
<div className="relative grid place-content-stretch overflow-y-hidden mb-4">
Expand Down
10 changes: 4 additions & 6 deletions components/organisms/InsightPage/DeleteInsightPageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,15 @@ const DeleteInsightPageModal: FC<ModalProps> = ({

return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent className="px-2 max-w-[90%] lg:max-w-2xl rounded-t-lg pt-2">
<DialogContent className="grid grid-cols-1 gap-4 p-4 max-w-[90%] lg:max-w-xl rounded-t-lg">
<DialogTitle>
<Title level={3}>Delete Page</Title>
</DialogTitle>

<Text>
Are you sure you want to delete <span className="font-bold text-light-slate-12">{`${pageName}`}</span>?
</Text>
<Text>
If you have data on this page that your team is using it would be difficult for your team to get access to
track your project.
Are you sure you want to delete <span className="font-bold text-light-slate-12">{`${pageName}`}</span>? If you
have data on this page that your team is using it would be difficult for your team to get access to track your
project.
</Text>
<Text>
{" "}
Expand Down
Loading

0 comments on commit a072f27

Please sign in to comment.