diff --git a/.github/config/labeler.yml b/.github/config/labeler.yml index 9c7d68a32ae..81eb316dd9e 100644 --- a/.github/config/labeler.yml +++ b/.github/config/labeler.yml @@ -1,11 +1,8 @@ -version: 1 -labels: - - label: "✍ chore: profile" - files: - - "data/*.json" - - label: "tests" - files: - - "tests/*" - - label: "storybook" - files: - - "stories/*" +'✍ chore: profile': + - 'data/**' + +tests: + - 'tests/**' + +storybook: + - 'stories/**' diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 29fc69102fc..b6708382e32 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -1,15 +1,25 @@ name: Label PRs on: - - pull_request + - pull_request_target jobs: - build: + label: + permissions: + contents: read + pull-requests: write runs-on: ubuntu-latest steps: - - uses: srvaroa/labeler@master + - uses: actions/checkout@v3 # Uploads repository content to the runner to ensure config file available with: - config_path: .github/config/labeler.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + sparse-checkout: | + .github/config/labeler.yml + sparse-checkout-cone-mode: false + - uses: actions/labeler@v4 + with: + configuration-path: .github/config/labeler.yml + repo-token: ${{ secrets.GITHUB_TOKEN }} + dot: true + sync-labels: true + diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b43bcc10b..7e979c7025e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,45 +1,45 @@ -# [1.167.0](https://github.com/EddieHubCommunity/LinkFree/compare/v1.166.0...v1.167.0) (2023-08-01) +## [1.168.7](https://github.com/EddieHubCommunity/LinkFree/compare/v1.168.6...v1.168.7) (2023-08-03) -### Features +### Bug Fixes -* admin users list inc repos ([#8439](https://github.com/EddieHubCommunity/LinkFree/issues/8439)) ([aae68d9](https://github.com/EddieHubCommunity/LinkFree/commit/aae68d92be0dbd09c31df93c83e926a1b7786919)) +* milestone link icon and date [#8098](https://github.com/EddieHubCommunity/LinkFree/issues/8098) ([#8420](https://github.com/EddieHubCommunity/LinkFree/issues/8420)) ([21c9717](https://github.com/EddieHubCommunity/LinkFree/commit/21c9717861542833a2fc6d7a2131937573918266)) -# [1.166.0](https://github.com/EddieHubCommunity/LinkFree/compare/v1.165.3...v1.166.0) (2023-08-01) +## [1.168.6](https://github.com/EddieHubCommunity/LinkFree/compare/v1.168.5...v1.168.6) (2023-08-03) -### Features +### Bug Fixes -* GitHub repo to profile ([#8225](https://github.com/EddieHubCommunity/LinkFree/issues/8225)) ([30bc65d](https://github.com/EddieHubCommunity/LinkFree/commit/30bc65d3d075895e81ead930cbdca9e383a7f210)) +* db connection ([#8477](https://github.com/EddieHubCommunity/LinkFree/issues/8477)) ([a1af174](https://github.com/EddieHubCommunity/LinkFree/commit/a1af174bbe8866f1121b073dc91d8d0556479de2)) -## [1.165.3](https://github.com/EddieHubCommunity/LinkFree/compare/v1.165.2...v1.165.3) (2023-08-01) +## [1.168.5](https://github.com/EddieHubCommunity/LinkFree/compare/v1.168.4...v1.168.5) (2023-08-03) ### Bug Fixes -* gh action labeler ([#8430](https://github.com/EddieHubCommunity/LinkFree/issues/8430)) ([83c939e](https://github.com/EddieHubCommunity/LinkFree/commit/83c939e361790316b2ad26b1e079b8b87520ad5b)) +* changelog latest features ([#8473](https://github.com/EddieHubCommunity/LinkFree/issues/8473)) ([2a43b3a](https://github.com/EddieHubCommunity/LinkFree/commit/2a43b3ac3b7c6dee0ac1a88d2f0919784954192c)) -## [1.165.2](https://github.com/EddieHubCommunity/LinkFree/compare/v1.165.1...v1.165.2) (2023-07-31) +## [1.168.4](https://github.com/EddieHubCommunity/LinkFree/compare/v1.168.3...v1.168.4) (2023-08-03) ### Bug Fixes -* profile updated datetime on stats ([#8415](https://github.com/EddieHubCommunity/LinkFree/issues/8415)) ([80b39c8](https://github.com/EddieHubCommunity/LinkFree/commit/80b39c835e5d69a4d3dcd1d287b24fdf66890fc3)) +* labeling PRs from forks ([#8469](https://github.com/EddieHubCommunity/LinkFree/issues/8469)) ([26b4247](https://github.com/EddieHubCommunity/LinkFree/commit/26b42478e7f9097fdaed37be18ed369c3a18e22e)) -## [1.165.1](https://github.com/EddieHubCommunity/LinkFree/compare/v1.165.0...v1.165.1) (2023-07-31) +## [1.168.3](https://github.com/EddieHubCommunity/LinkFree/compare/v1.168.2...v1.168.3) (2023-08-02) ### Bug Fixes -* date format helper ([#8380](https://github.com/EddieHubCommunity/LinkFree/issues/8380)) ([b70f3b1](https://github.com/EddieHubCommunity/LinkFree/commit/b70f3b1b6164fe77bc6e8967646474fd17632d91)) +* gh labeler action ([#8466](https://github.com/EddieHubCommunity/LinkFree/issues/8466)) ([439fcc3](https://github.com/EddieHubCommunity/LinkFree/commit/439fcc3a9a124acfeffa9598f52c4a40d7dac4ed)) diff --git a/components/Tabs.js b/components/Tabs.js index 89ff70b28e3..31ecd5cfaf7 100644 --- a/components/Tabs.js +++ b/components/Tabs.js @@ -1,7 +1,7 @@ import Link from "@components/Link"; +import { classNames } from "utils/functions/classNames"; export default function Tabs({ tabs, setTabs }) { - const classNames = (...classes) => classes.filter(Boolean).join(" "); const changeTab = (e, value) => { e.preventDefault(); setTabs( diff --git a/components/event/EventTabs.js b/components/event/EventTabs.js index bd7cef087d5..9d9227a8290 100644 --- a/components/event/EventTabs.js +++ b/components/event/EventTabs.js @@ -1,7 +1,7 @@ import Link from "@components/Link"; +import { classNames } from "utils/functions/classNames"; export function EventTabs({ tabs, eventType, setEventType }) { - const classNames = (...classes) => classes.filter(Boolean).join(" "); const changeTab = (e, value) => { e.preventDefault(); setEventType(value); diff --git a/components/form/Toggle.js b/components/form/Toggle.js index e690c07f168..46a7f1528db 100644 --- a/components/form/Toggle.js +++ b/components/form/Toggle.js @@ -1,8 +1,5 @@ import { Switch } from "@headlessui/react"; - -function classNames(...classes) { - return classes.filter(Boolean).join(" "); -} +import { classNames } from "utils/functions/classNames"; export default function Toggle({ text1, text2, enabled = false, setEnabled }) { let aria = {}; diff --git a/components/layouts/DocsLayout.js b/components/layouts/DocsLayout.js index f7004efdd04..b205942dca3 100644 --- a/components/layouts/DocsLayout.js +++ b/components/layouts/DocsLayout.js @@ -70,6 +70,10 @@ export const navigation = [ name: "Testimonials with Forms", href: "/docs/how-to-guides/testimonials-forms", }, + { + name: "GitHub Repos with Forms", + href: "/docs/how-to-guides/repos-forms", + }, ], }, { diff --git a/components/navbar/Navbar.js b/components/navbar/Navbar.js index d7ae4d6c74b..6ddb8f75931 100644 --- a/components/navbar/Navbar.js +++ b/components/navbar/Navbar.js @@ -88,8 +88,8 @@ export default function Navbar() { url: "/map", }, { - name: "Docs", - url: "/docs", + name: "Repos", + url: "/repos", }, ]; diff --git a/components/navbar/SideNav.js b/components/navbar/SideNav.js index db25c209f0f..0ebbb5ef6dc 100644 --- a/components/navbar/SideNav.js +++ b/components/navbar/SideNav.js @@ -1,10 +1,7 @@ import { Disclosure } from "@headlessui/react"; import ChevronRightIcon from "@heroicons/react/20/solid/ChevronRightIcon"; import EditOnGitHub from "@components/EditOnGithub"; - -function classNames(...classes) { - return classes.filter(Boolean).join(" "); -} +import { classNames } from "utils/functions/classNames"; export default function SideNav({ navigation }) { return ( diff --git a/components/navbar/SubNav.js b/components/navbar/SubNav.js index 5f559fa939e..e44e1378976 100644 --- a/components/navbar/SubNav.js +++ b/components/navbar/SubNav.js @@ -1,9 +1,6 @@ import Link from "@components/Link"; import Router, { useRouter } from "next/router"; - -function classNames(...classes) { - return classes.filter(Boolean).join(" "); -} +import { classNames } from "utils/functions/classNames"; export default function SubNav({ tabs }) { const router = useRouter(); diff --git a/components/user/UserMilestone.js b/components/user/UserMilestone.js index 12a7b018215..cb8f8123773 100644 --- a/components/user/UserMilestone.js +++ b/components/user/UserMilestone.js @@ -28,11 +28,14 @@ export default function UserMilestone({ milestone, isGoal, manage }) {

{milestone.title} +

+

+ {date} {milestone.url && ( )} - -

{date}

+

{milestone.description} diff --git a/components/user/UserRepos.js b/components/user/UserRepos.js index a312b8f7594..56047b91a33 100644 --- a/components/user/UserRepos.js +++ b/components/user/UserRepos.js @@ -2,6 +2,7 @@ import FallbackImage from "@components/FallbackImage"; import Link from "@components/Link"; import ChevronRightIcon from "@heroicons/react/20/solid/ChevronRightIcon"; import StarIcon from "@heroicons/react/20/solid/StarIcon"; +import dateFormat from "@services/utils/dateFormat"; export default function UserRepos({ repos }) { return ( @@ -26,12 +27,7 @@ export default function UserRepos({ repos }) { {repo.owner}/{repo.name} {" "} - ( - {new Intl.DateTimeFormat("en-GB", { - dateStyle: "full", - timeStyle: "long", - }).format(new Date(repo.dates.pushedAt))} - ) + ({dateFormat({ format: "long", date: repo.dates.pushedAt })})

diff --git a/config/app.json b/config/app.json index 0ed59f93934..bb4269070dc 100644 --- a/config/app.json +++ b/config/app.json @@ -1,5 +1,5 @@ { - "version": "1.167.0", + "version": "1.168.7", "alerts": [], "layouts": [ "classic", diff --git a/data/Aladdin4u.json b/data/Aladdin4u.json new file mode 100644 index 00000000000..0f4c465940a --- /dev/null +++ b/data/Aladdin4u.json @@ -0,0 +1,72 @@ +{ + "name": "Taofeek Inaolaji", + "bio": "Full Stack Software Engineer | Open Source Enthusiast! | Blogger", + "tags": [ + "Open Source", + "Javascript", + "Typescript", + "react", + "NextJS", + "DevOps" + ], + "socials": [ + { + "icon": "FaTwitter", + "url": "https://twitter.com/devaladdin" + }, + { + "icon": "FaGithub", + "url": "https://github.com/aladdin4u" + }, + { + "icon": "FaLinkedin", + "url": "https://linkedin.com/in/aladdin4u" + }, + { + "icon": "SiHashnode", + "url": "https://hashnode.com/@aladdin4u" + } + ], + "links": [ + { + "group": "Socials Primary", + "name": "Follow me on GitHub", + "url": "https://github.com/aladdin4u", + "icon": "FaGithub" + }, + { + "group": "Socials Primary", + "name": "Follow me on Twitter", + "url": "https://twitter.com/devaladdin", + "icon": "FaTwitter" + }, + { + "group": "Socials Primary", + "name": "Follow me on LinkedIn", + "url": "https://linkedin.com/in/aladdin4u", + "icon": "FaLinkedin" + }, + { + "group": "Content", + "name": "Follow and read my blog on Hashnode", + "url": "https://hashnode.com/@aladdin4u", + "icon": "SiHashnode" + }, + { + "group": "Donate", + "name": "Buy me Coffee", + "url": "https://buymecoffee.com/devaladdin", + "icon": "FaRegMoneyBillAlt" + } + ], + "milestones": [ + { + "title": "Started Freelancing", + "date": "December 2021", + "icon": "FaDollarSign", + "color": "grey", + "description": "Started freelancing", + "url": "https://devaladdin.netlify.app/" + } + ] +} diff --git a/data/Axorax.json b/data/Axorax.json new file mode 100644 index 00000000000..89b0dbb200e --- /dev/null +++ b/data/Axorax.json @@ -0,0 +1,31 @@ +{ + "name": "Axorax", + "bio": "I like programming sometimes...", + "tags": [ + "open source", + "javascript", + "python" + ], + "socials": [ + { + "icon": "FaTwitter", + "url": "https://twitter.com/axorax_" + }, + { + "icon": "FaYoutube", + "url": "https://www.youtube.com/axorax" + } + ], + "links": [ + { + "name": "Github", + "url": "https://github.com/Axorax", + "icon": "FaGithub" + }, + { + "name": "Support me on Patreon!", + "url": "https://www.patreon.com/axorax", + "icon": "FaPatreon" + } + ] +} diff --git a/data/AyushRay06.json b/data/AyushRay06.json new file mode 100644 index 00000000000..acd39e38516 --- /dev/null +++ b/data/AyushRay06.json @@ -0,0 +1,22 @@ +{ + "name": "Ayush Ray", + "bio": "DevOps| webdev| cloud| GDSC lead", + "tags": [ + "Open Source", + "MERN", + "Kubernaties", + "AWS", + "Docker" + ], + "socials": [{ + "name": "Follow me on X", + "url": "https://twitter.com/Ayush_a_ray", + "icon": "FaTwitter" + }, + { + "name": "Follow me on Instagram", + "url": "https://www.instagram.com/oyee_ayush/", + "icon": "FaInstagram" + } + ] +} diff --git a/data/Quarkyy77.json b/data/Quarkyy77.json index 66746cc927f..f74ca5ca965 100644 --- a/data/Quarkyy77.json +++ b/data/Quarkyy77.json @@ -1,11 +1,11 @@ { - "name": "Quarkyy77", - "bio": "Starting on a open source journey , would be updating bio soon...", - "links": [ - { - "name": "Follow me onLinkedIn", - "url": "https://www.linkedin.com/in/tushar-kumar-xckecn", - "icon": "LinkedIn" - } - ] + "name": "Quarkyy77", + "bio": "Starting on a open source journey , would be updating bio soon...", + "links": [ + { + "name": "Follow me onLinkedIn", + "url": "https://www.linkedin.com/in/tushar-kumar-xckecn", + "icon": "LinkedIn" + } + ] } diff --git a/data/aladdin.json b/data/aladdin.json deleted file mode 100644 index be6fcc914da..00000000000 --- a/data/aladdin.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "Inaolaji Taofeek", - "bio": "Full Stack Software Engineer | Open Source Enthusiast!", - "links": [ - { - "name": "Follow me on GitHub", - "url": "https://github.com/aladdin4u", - "icon": "FaGithub" - }, - { - "name": "Follow me on Twitter", - "url": "https://twitter.com/devaladdin", - "icon": "FaTwitter" - }, - { - "name": "Follow me on LinkedIn", - "url": "https://linkedin.com/in/aladdin4u", - "icon": "FaLinkedin" - } - ], - "milestones": [ - { - "title": "Started Freelancing", - "date": "December 2021", - "icon": "FaDollarSign", - "color": "grey", - "description": "Started freelancing", - "url": "https://devaladdin.netlify.app/" - } - ] -} diff --git a/data/henilGondalia.json b/data/henilGondalia.json new file mode 100644 index 00000000000..e9edf73bbd0 --- /dev/null +++ b/data/henilGondalia.json @@ -0,0 +1,56 @@ +{ + "name": "Henil Gondaliya", + "bio": "**Front-End Developer** | **Freelancer** ", + "tags": ["ReactJS", "Javascript", "Typescript", "Open Source"], + "socials": [ + { + "icon": "FaGithub", + "url": "https://github.com/henilGondalia" + }, + { + "icon": "FaTwitter", + "url": "https://twitter.com/gondaliya_henil" + }, + { + "icon": "FaLinkedin", + "url": "https://www.linkedin.com/in/henilgondaliya" + } + ], + "links": [ + { + "name": "Unleash the Code Wizard in Me on GitHub", + "url": "https://github.com/henilGondalia", + "icon": "FaGithub" + }, + { + "name": "Join the Network of Tweeting Developer on Twitter", + "url": "https://twitter.com/gondaliya_henil", + "icon": "FaTwitter" + }, + { + "name": "Get Linked with the Coding Ninja on LinkedIn", + "url": "https://linkedin.com/in/henilgondaliya", + "icon": "FaLinkedin" + }, + { + "name": "Explore My Creative Work Journey!", + "url": "https://henil-gondaliya.web.app/", + "icon": "SiBiolink" + }, + { + "name": "Feeling generous? Buy me coffee, and Fuel the Late-Night Coding Sessions", + "url": "https://www.buymeacoffee.com/henilGondaliya", + "icon": "SiBuymeacoffee" + } + ], + "milestones": [ + { + "title": "Started Freelancing", + "date": "July 2023", + "icon": "FaDollarSign", + "color": "blue", + "description": "This new chapter allows me to explore diverse projects, work with different clients, and bring innovative ideas to life. Want to build somthing? Hire me.", + "url": "https://www.upwork.com/freelancers/~019f417c3378d767bf" + } + ] +} diff --git a/data/saram7619.json b/data/saram7619.json new file mode 100644 index 00000000000..2963f97c3b1 --- /dev/null +++ b/data/saram7619.json @@ -0,0 +1,27 @@ +{ + "name": "Sara McClelland", + "bio": "I am a Software Engineer, a stay at home parent and dog owner. I like coffee, reading and building ideas with coding.", + "tags": ["open source"], + "links": [ + { + "name": "Frontend Mentor", + "url": "https://www.frontendmentor.io/profile/saram7619", + "icon": "SiFrontendmentor" + }, + { + "name": "Linkedin", + "url": "https://www.linkedin.com/in/sara-mc-clelland-747361255/", + "icon": "FaLinkedin" + }, + { + "name": "Github", + "url": "https://github.com/saram7619", + "icon": "FaGithub" + }, + { + "name": "Leetcode", + "url": "https://leetcode.com/saram7619/", + "icon": "SiLeetcode" + } + ] +} diff --git a/package-lock.json b/package-lock.json index 9946e720300..6299fb9fbde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linkfree", - "version": "1.167.0", + "version": "1.168.7", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index ee354da0b55..5bfa0bb8175 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "linkfree", - "version": "1.167.0", + "version": "1.168.7", "private": false, "homepage": "https://linkfree.io", "engines": { diff --git a/pages/api/admin/events.js b/pages/api/admin/events.js index da941d1b551..97449eaa28f 100644 --- a/pages/api/admin/events.js +++ b/pages/api/admin/events.js @@ -4,6 +4,7 @@ import { getServerSession } from "next-auth/next"; import { serverEnv } from "@config/schemas/serverSchema"; import logger from "@config/logger"; import Profile from "@models/Profile"; +import connectMongo from "@config/mongo"; export default async function handler(req, res) { const session = await getServerSession(req, res, authOptions); @@ -27,6 +28,7 @@ export default async function handler(req, res) { } export async function getEvents() { + await connectMongo(); let events = []; try { events = await Profile.aggregate([ diff --git a/pages/api/discover/tags.js b/pages/api/discover/tags.js index 9972dc4b988..e5c4a46969e 100644 --- a/pages/api/discover/tags.js +++ b/pages/api/discover/tags.js @@ -1,4 +1,5 @@ import logger from "@config/logger"; +import connectMongo from "@config/mongo"; import Profile from "@models/Profile"; export default async function handler(req, res) { @@ -12,6 +13,7 @@ export default async function handler(req, res) { res.status(200).json(tags); } export async function getTags(location = false) { + await connectMongo(); let tags = []; const matchQuery = location diff --git a/pages/api/events.js b/pages/api/events.js index 4bec4190af2..27d0670f3a4 100644 --- a/pages/api/events.js +++ b/pages/api/events.js @@ -1,4 +1,5 @@ import logger from "@config/logger"; +import connectMongo from "@config/mongo"; import Profile from "@models/Profile"; import dateFormat from "@services/utils/dateFormat"; @@ -14,6 +15,7 @@ export default async function handler(req, res) { } export async function getEvents() { + await connectMongo(); let events = []; try { events = await Profile.aggregate([ diff --git a/pages/api/repos.js b/pages/api/repos.js new file mode 100644 index 00000000000..7b9e9ee4f71 --- /dev/null +++ b/pages/api/repos.js @@ -0,0 +1,39 @@ +import logger from "@config/logger"; +import connectMongo from "@config/mongo"; +import Profile from "@models/Profile"; + +export default async function handler(req, res) { + if (req.method != "GET") { + return res + .status(400) + .json({ error: "Invalid request: GET request required" }); + } + + const repos = await getRepos(); + return res.status(200).json(repos); +} + +export async function getRepos() { + await connectMongo(); + let repos = []; + try { + repos = await Profile.aggregate([ + { $project: { username: 1, repos: 1, isEnabled: 1 } }, + { $match: { isEnabled: true } }, + { $unwind: "$repos" }, + { + $sort: { "repos.dates.pushedAt": -1 }, + }, + { + $replaceRoot: { + newRoot: "$repos", + }, + }, + ]).exec(); + } catch (e) { + logger.error(e, "Failed to load repos"); + repos = []; + } + + return JSON.parse(JSON.stringify(repos)); +} diff --git a/pages/api/search/index.js b/pages/api/search/index.js index ab32859ee16..8cc106c1114 100644 --- a/pages/api/search/index.js +++ b/pages/api/search/index.js @@ -1,7 +1,9 @@ +import connectMongo from "@config/mongo"; import { getUsers } from "../profiles"; import logger from "@config/logger"; export default async function handler(req, res) { + await connectMongo(); const { slug } = req.query; if (req.method != "GET") { diff --git a/pages/changelog.js b/pages/changelog.js index 500cacff82f..4a67fed4725 100644 --- a/pages/changelog.js +++ b/pages/changelog.js @@ -9,6 +9,13 @@ export default function Changelog() { removal: "text-red-800 bg-red-100", }; const changes = [ + { + title: "GitHub Repos showcase", + description: + "Now you can add repos to your Profile and they also appear in the global repos page", + type: "addition", + date: "2023-08-01", + }, { title: "Share profile on social media", description: diff --git a/pages/docs/how-to-guides/repos-forms.mdx b/pages/docs/how-to-guides/repos-forms.mdx new file mode 100644 index 00000000000..070c5291af6 --- /dev/null +++ b/pages/docs/how-to-guides/repos-forms.mdx @@ -0,0 +1,43 @@ +import DocsLayout from "@components/layouts/DocsLayout.js"; +import ClipboardCopy from "@components/ClipboardCopy"; +import Link from "@components/Link"; + +## GitHub Repos - with Forms + +Showcase your Open Source projects by adding the GitHub Repo to your Profile. + +## Add a GitHub Repo + +1. Go to the [LinkFree homepage](https://linkfree.io/) + +2. Click on `Log in` + +![LinkFree Homepage](https://github.com/EddieHubCommunity/LinkFree/assets/82668196/ce980ed7-ad4d-42c0-886c-447a2e2ab936) + +3. You will be taken to your Profile's Statistics page + +Click on `Repos` + +![LinkFree Profile](https://github.com/EddieHubCommunity/LinkFree/assets/624760/59e998c6-f757-4678-b973-1213b86dbd62) + +4. This will take you to the Repos page + +Enter your GitHub Repo URL and then click `Add Repo` + +![LinkFree Add Repo](https://github.com/EddieHubCommunity/LinkFree/assets/624760/26d11652-4085-4b02-80d7-81bd1cb6517c) + +Note: If you already have GitHub Repos in your Profile these will shown here. + +5. Your GitHub Repo will then be shown in your Profile on your custom URL (linkfree.io/eddiejaoude) and also the global Repo page + +![Global Repo page](https://github.com/EddieHubCommunity/LinkFree/assets/624760/f7135feb-56ba-4d62-9ed4-a6cedb4e0d39) + +export default ({ children }) => ( + + {children} + +); diff --git a/pages/docs/profile-tips.mdx b/pages/docs/profile-tips.mdx index 64087921db5..70d79505e85 100644 --- a/pages/docs/profile-tips.mdx +++ b/pages/docs/profile-tips.mdx @@ -9,6 +9,7 @@ Make your LinkFree Profile stand out by following these tips. - For YouTube links you can append your url with `?sub_confirmation=1` which will ask the visitor if they wish to subscribe - For Twitter you can use the "intent" link to ask people if they would like to follow you when visiting your profile. This is done with `https://twitter.com/intent/user?screen_name=TWITTER-USERNAME` (for example [https://twitter.com/intent/user?screen_name=eddiejaoude](https://twitter.com/intent/user?screen_name=eddiejaoude)) +- If you would like people to email you directly, you can add a link on your Profile with a URL `mailto:` for example: `mailto:name@email.com` ### Milestones: Share your achievements and future goals @@ -26,6 +27,10 @@ Make your LinkFree Profile stand out by following these tips. For example profiles and how to implement these tips in your Profile, visit the end section in the [QuickStart guide](/docs/quickstart-forms) +### Repos: Share your Open Source GitHub repos/projects + +- If you have any Open Source projects on GitHub, you can add them to your Profile by adding the URL to the [repos](/docs/how-to-guides/repos-forms) tab. This will also appear in the Global [Repos](/repos) page on the app. + export default ({ children }) => ( {children} diff --git a/pages/events.js b/pages/events.js index e24bfb13f56..a0088636c7e 100644 --- a/pages/events.js +++ b/pages/events.js @@ -90,7 +90,7 @@ export default function Events({ events }) { title="Go To Event Docs" badgeClassName={"translate-x-2/4 -translate-y-1/2"} > -

Community events

+

Community Events

diff --git a/pages/repos.js b/pages/repos.js new file mode 100644 index 00000000000..22c7a9e20bc --- /dev/null +++ b/pages/repos.js @@ -0,0 +1,30 @@ +import { getRepos } from "./api/repos"; + +import Page from "@components/Page"; +import PageHead from "@components/PageHead"; +import UserRepos from "@components/user/UserRepos"; + +export async function getServerSideProps() { + let repos = await getRepos(); + + return { + props: { repos }, + }; +} + +export default function Repos({ repos }) { + return ( + <> + + + +

Community Repos

+ + +
+ + ); +} diff --git a/pages/roadmap.js b/pages/roadmap.js index 0f9b7bc9215..58431b09a61 100644 --- a/pages/roadmap.js +++ b/pages/roadmap.js @@ -5,6 +5,7 @@ import ClockIcon from "@heroicons/react/24/outline/ClockIcon"; import Page from "@components/Page"; import PageHead from "@components/PageHead"; import Link from "@components/Link"; +import { classNames } from "utils/functions/classNames"; export default function Roadmap() { const releases = [ @@ -74,9 +75,6 @@ export default function Roadmap() { }, ]; - function classNames(...classes) { - return classes.filter(Boolean).join(" "); - } return ( <> { + await page.goto("/events"); + await expect(page.locator("h1")).toHaveText("Community Events"); +}); + test.fixme("Events listed", async ({ page }) => { await page.goto("/events"); await expect(page.locator("li")).toBeGreaterThan(1); diff --git a/tests/repos.spec.js b/tests/repos.spec.js new file mode 100644 index 00000000000..56712ca5bc9 --- /dev/null +++ b/tests/repos.spec.js @@ -0,0 +1,41 @@ +// @ts-check +import { test, expect } from "@playwright/test"; +import AxeBuilder from "@axe-core/playwright"; + +test("Click on repos in navbar navigates to repo page", async ({ page }) => { + await page.goto("/"); + await page + .getByRole("navigation") + .getByRole("link", { name: "Repos" }) + .click(); + await expect(page).toHaveURL("/repos"); +}); + +test("Repos has title", async ({ page }) => { + await page.goto("/repos"); + await expect(page.locator("h1")).toHaveText("Community Repos"); +}); + +test.describe("accessibility tests (light)", () => { + test.use({ colorScheme: "light" }); + + test("should pass axe wcag accessibility tests", async ({ page }) => { + await page.goto("/repos"); + const accessibilityScanResults = await new AxeBuilder({ page }) + .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) + .analyze(); + expect(accessibilityScanResults.violations).toEqual([]); + }); +}); + +test.describe("accessibility tests (dark)", () => { + test.use({ colorScheme: "dark" }); + + test("should pass axe wcag accessibility tests (dark)", async ({ page }) => { + await page.goto("/repos"); + const accessibilityScanResults = await new AxeBuilder({ page }) + .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]) + .analyze(); + expect(accessibilityScanResults.violations).toEqual([]); + }); +}); diff --git a/utils/functions/classNames.js b/utils/functions/classNames.js new file mode 100644 index 00000000000..28cc7a750a1 --- /dev/null +++ b/utils/functions/classNames.js @@ -0,0 +1,3 @@ +export const classNames = (...classes) => { + return classes.filter(Boolean).join(" "); +};