From bf7c1e988d2d66ee20c0036f5b23d9da4103536a Mon Sep 17 00:00:00 2001 From: Sergey Roytman Date: Tue, 31 Oct 2023 16:50:29 +0200 Subject: [PATCH] chore: Replace Github contributors list to be from vibe-storybook-components (#1721) --- package-lock.json | 14 +-- package.json | 2 +- .../other-contributors-list/contributors.tsx | 30 ----- .../other-contributors-list.jsx | 114 ------------------ .../other-contributors-list.module.scss | 3 + .../other-contributors-list.scss | 9 -- .../other-contributors-list.tsx | 66 ++++++++++ .../welcome/welcome.stories.mdx | 1 - 8 files changed, 77 insertions(+), 162 deletions(-) delete mode 100644 src/storybook/stand-alone-documentaion/welcome/other-contributors-list/contributors.tsx delete mode 100644 src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.jsx create mode 100644 src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.module.scss delete mode 100644 src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.scss create mode 100644 src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.tsx diff --git a/package-lock.json b/package-lock.json index 39b75e9444..ccf9e7da53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "react-window": "^1.8.7", "react-windowed-select": "^2.0.4", "style-inject": "^0.3.0", - "vibe-storybook-components": "^0.10.3" + "vibe-storybook-components": "^0.11.0" }, "devDependencies": { "@babel/core": "^7.23.2", @@ -36605,9 +36605,9 @@ } }, "node_modules/vibe-storybook-components": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/vibe-storybook-components/-/vibe-storybook-components-0.10.3.tgz", - "integrity": "sha512-Q+BzFXjM9eIF7dxwpg3wepRyc/mA1De4DMm4AjKHZzz6DWkHb7wupDmcsB+SICoQ4mONMv65Flap+OMxb0XDUw==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/vibe-storybook-components/-/vibe-storybook-components-0.11.0.tgz", + "integrity": "sha512-nMe3jPmIADfqSc7G7ueonbOMkLSQM6pMXdVhWZfmILFZbANxx6l0BxORTW/4vPMzAwigmJ7BPew8mzDy0wEd/A==", "dependencies": { "@storybook/types": "^7.5.0", "browserslist-config-monday": "^1.0.6", @@ -65929,9 +65929,9 @@ } }, "vibe-storybook-components": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/vibe-storybook-components/-/vibe-storybook-components-0.10.3.tgz", - "integrity": "sha512-Q+BzFXjM9eIF7dxwpg3wepRyc/mA1De4DMm4AjKHZzz6DWkHb7wupDmcsB+SICoQ4mONMv65Flap+OMxb0XDUw==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/vibe-storybook-components/-/vibe-storybook-components-0.11.0.tgz", + "integrity": "sha512-nMe3jPmIADfqSc7G7ueonbOMkLSQM6pMXdVhWZfmILFZbANxx6l0BxORTW/4vPMzAwigmJ7BPew8mzDy0wEd/A==", "requires": { "@storybook/types": "^7.5.0", "browserslist-config-monday": "^1.0.6", diff --git a/package.json b/package.json index 3148ace67e..7526fa734e 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "react-window": "^1.8.7", "react-windowed-select": "^2.0.4", "style-inject": "^0.3.0", - "vibe-storybook-components": "^0.10.3" + "vibe-storybook-components": "^0.11.0" }, "devDependencies": { "@babel/core": "^7.23.2", diff --git a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/contributors.tsx b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/contributors.tsx deleted file mode 100644 index 10ed6917d9..0000000000 --- a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/contributors.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { FC } from "react"; -import cx from "classnames"; -import { Link } from "vibe-storybook-components"; - -type Contributor = { - name: string; - href: string; - key?: string; -}; - -interface contributorsDataProps { - contributorsData: Array; -} - -export const Contributors: FC = ({ contributorsData }) => { - const lastIndex = contributorsData.length - 1; - return ( - <> - {contributorsData.map(({ name, href, key }, index) => ( - - {name} - - ))} - - ); -}; diff --git a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.jsx b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.jsx deleted file mode 100644 index f1ce865cb9..0000000000 --- a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.jsx +++ /dev/null @@ -1,114 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; -import { Paragraph } from "vibe-storybook-components"; -import { Contributors } from "./contributors"; -import "./other-contributors-list.scss"; - -const BASE_CLASS = "monday-other-contributors-list"; - -const excludedDevelopers = new Set(); -excludedDevelopers.add(41898282); // github-actions[bot] -excludedDevelopers.add(49699333); // dependabot[bot] -excludedDevelopers.add(19733683); // snyk-bot - -const STATIC_FOUNDING_DESIGNERS = [ - { - name: "Evgeniy Kazinec", - href: "https://www.linkedin.com/in/evgeniy-kazinec/" - }, - { - name: "Rotem Dekel", - href: "https://www.linkedin.com/in/rotem-dekel-7a8b12133/" - } -]; -const STATIC_CONTRIBUTERS = [ - { - name: "Devorah Friedman", - href: "mailto:devorahfr@monday.com" - }, - { - name: "Dmitry Kogan", - href: "mailto:dimako@monday.com" - }, - { - name: "Meytal Badichi", - href: "mailto:mailto:meytal@monday.com" - }, - { - name: "Shay Cohen", - href: "mailto:shay@monday.com" - }, - { - name: "Eylon Goren", - href: "mailto:eylon@monday.com" - }, - { - name: "Noa Fenko", - href: "mailto:noafe@monday.com" - }, - { - name: "LeanyLabs", - href: "https://github.com/LeanyLabs" - }, - { - name: "Hadas Farhi", - href: "https://github.com/hadasfa" - } -]; - -async function getContributors(page) { - let request = await fetch( - `https://api.github.com/repos/mondaycom/monday-ui-react-core/contributors?per_page=100&page=${page}&order=desc`, - { - method: "GET", - headers: { - "Content-Type": "application/json" - } - } - ); - - return await request.json(); -} - -async function getAllContributors() { - let contributors = []; - let page = 1; - let list; - do { - list = await getContributors(page++); - contributors = contributors.concat(list); - } while (list.length > 0); - - return contributors; -} - -export const OtherContributorsList = () => { - const [contributorsJson, setContributorsJson] = useState(); - useEffect(() => { - getAllContributors().then(contributors => setContributorsJson(contributors)); - }, []); - - const contributors = useMemo(() => { - if (contributorsJson && Array.isArray(contributorsJson)) { - // developer contributors - const developerContributors = contributorsJson - .filter(contributor => !excludedDevelopers.has(contributor.id)) - .sort((a, b) => b.contributions - a.contributions) - .map(contributor => ({ - name: contributor.login, - href: contributor.html_url, - key: contributor.id - })); - const contributorsData = STATIC_CONTRIBUTERS.concat(developerContributors); - return ; - } - }, [contributorsJson]); - - return ( - <> - - Special thanks to our founding designers:
- {contributors ? <>Thanks to all of our contributors: {contributors} : null} -
- - ); -}; diff --git a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.module.scss b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.module.scss new file mode 100644 index 0000000000..4a13bcffdc --- /dev/null +++ b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.module.scss @@ -0,0 +1,3 @@ +.contributorsList { + margin-top: var(--sb-spacing-between-section-items); +} diff --git a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.scss b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.scss deleted file mode 100644 index 97e27bd4ad..0000000000 --- a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.scss +++ /dev/null @@ -1,9 +0,0 @@ -@import "~vibe-storybook-components/dist/mixins"; - -.monday-other-contributors-list { - margin-top: var(--sb-spacing-between-section-items); - &_contributor:after { - @include sb-small-text; - content: ","; - } -} diff --git a/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.tsx b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.tsx new file mode 100644 index 0000000000..a49fbca032 --- /dev/null +++ b/src/storybook/stand-alone-documentaion/welcome/other-contributors-list/other-contributors-list.tsx @@ -0,0 +1,66 @@ +import { GithubContributorsList, ContributorsList, Paragraph } from "vibe-storybook-components"; +import styles from "./other-contributors-list.module.scss"; + +const excludedContributorsIds: Set = new Set(); +excludedContributorsIds.add(41898282); // github-actions[bot] +excludedContributorsIds.add(49699333); // dependabot[bot] +excludedContributorsIds.add(19733683); // snyk-bot + +const STATIC_FOUNDING_DESIGNERS = [ + { + name: "Evgeniy Kazinec", + href: "https://www.linkedin.com/in/evgeniy-kazinec/" + }, + { + name: "Rotem Dekel", + href: "https://www.linkedin.com/in/rotem-dekel-7a8b12133/" + } +]; +const STATIC_CONTRIBUTORS = [ + { + name: "Devorah Friedman", + href: "mailto:devorahfr@monday.com" + }, + { + name: "Dmitry Kogan", + href: "mailto:dimako@monday.com" + }, + { + name: "Meytal Badichi", + href: "mailto:mailto:meytal@monday.com" + }, + { + name: "Shay Cohen", + href: "mailto:shay@monday.com" + }, + { + name: "Eylon Goren", + href: "mailto:eylon@monday.com" + }, + { + name: "Noa Fenko", + href: "mailto:noafe@monday.com" + }, + { + name: "LeanyLabs", + href: "https://github.com/LeanyLabs" + }, + { + name: "Hadas Farhi", + href: "https://github.com/hadasfa" + } +]; + +export const OtherContributorsList = () => { + return ( + + Special thanks to our founding designers: + + + ); +}; diff --git a/src/storybook/stand-alone-documentaion/welcome/welcome.stories.mdx b/src/storybook/stand-alone-documentaion/welcome/welcome.stories.mdx index b4bbbbbe2f..d01495e9f7 100644 --- a/src/storybook/stand-alone-documentaion/welcome/welcome.stories.mdx +++ b/src/storybook/stand-alone-documentaion/welcome/welcome.stories.mdx @@ -5,7 +5,6 @@ import { Principles } from "./principles/principles"; import { Contributors } from "./contributors/contributors"; import { WelcomeHeader } from "./welcome-header/welcome-header"; import { OtherContributorsList } from "./other-contributors-list/other-contributors-list"; -import { Link } from "vibe-storybook-components";