-
-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'migrate-ts' into ag-ts-tools
- Loading branch information
Showing
44 changed files
with
1,770 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Notify Triagers | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened, synchronize, edited, ready_for_review] | ||
|
||
jobs: | ||
Notify-triagers: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Check PR Changes for .md files | ||
id: md-pr-changes | ||
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0 | ||
with: | ||
files: | | ||
**.md | ||
- name: Check PR Changes for non-.md files | ||
id: non-md-pr-changes | ||
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0 | ||
with: | ||
files: | | ||
!**.md | ||
- name: Extract Doc Triage Maintainers | ||
id: doc-triager | ||
run: | | ||
docTriagers=$(grep '^#' CODEOWNERS | tail -n 2 | head -n 1) | ||
echo "docTriagers: $docTriagers" | ||
prefix="#docTriagers: " | ||
docTriagers=${docTriagers#$prefix} | ||
echo "docTriagers=$docTriagers" >> $GITHUB_ENV | ||
- name: Extract Code Triage Maintainers | ||
id: code-triager | ||
run: | | ||
codeTriagers=$(grep '^#' CODEOWNERS | tail -n 1) | ||
echo "codeTriagers: $codeTriagers" | ||
prefix="#codeTriagers: " | ||
codeTriagers=${codeTriagers#$prefix} | ||
echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV | ||
- name: Add Reviewers for code files | ||
if: steps.non-md-pr-changes.outputs.any_changed == 'true' | ||
run: | | ||
IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}" | ||
reviewers=$(printf ', "%s"' "${codeTriagers[@]}") | ||
reviewers=[${reviewers:2}] | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ | ||
-d "{ | ||
\"reviewers\": $reviewers | ||
}" | ||
- name: Add Reviewers for doc files | ||
if: steps.md-pr-changes.outputs.any_changed == 'true' | ||
run: | | ||
IFS=' ' read -r -a docTriagers <<< "${{ env.docTriagers }}" | ||
reviewers=$(printf ', "%s"' "${docTriagers[@]}") | ||
reviewers=[${reviewers:2}] | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ | ||
-d "{ | ||
\"reviewers\": $reviewers | ||
}" |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
interface IModalProps { | ||
title: string; | ||
children: React.ReactNode; | ||
onModalClose?: () => void; | ||
} | ||
|
||
/** | ||
* @description Modal component. | ||
* @param {string} props.title - The title of the modal. | ||
* @param {React.ReactNode} props.children - The content of the modal. | ||
* @param {function} props.onModalClose=()=>{} - Function to handle modal close event. | ||
*/ | ||
export default function Modal({ | ||
title, | ||
children, | ||
onModalClose = () => {} | ||
}: IModalProps) { | ||
const modalRef = useRef<HTMLDivElement>(null); | ||
|
||
// Focus the modal when it mounts | ||
useEffect(() => { | ||
if (modalRef.current) modalRef.current.focus(); | ||
}, []); | ||
|
||
/** | ||
* @description Handles the backdrop click event. | ||
* @param {React.MouseEvent<HTMLDivElement>} e - The event object. | ||
*/ | ||
function backdropClickHandler(e: React.MouseEvent<HTMLDivElement>) { | ||
if (modalRef.current && (modalRef.current === e.target || !modalRef.current.contains(e.target as Node))) { | ||
onModalClose(); | ||
} | ||
} | ||
|
||
/** | ||
* @description Handles the key up event. | ||
* @param {React.KeyboardEvent<HTMLDivElement>} e - The event object. | ||
*/ | ||
function onKeyUpHandler(e: React.KeyboardEvent<HTMLDivElement>) { | ||
if (e.key === 'Escape') onModalClose(); | ||
} | ||
|
||
return ( | ||
<div ref={modalRef} tabIndex={-1} className='fixed inset-0 z-30 my-auto mt-2 flex min-h-full items-end justify-center bg-black/30 p-4 text-center backdrop-blur sm:items-center sm:p-0' onClick={backdropClickHandler} onKeyUp={onKeyUpHandler}> | ||
<div className='relative m-auto overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:w-full sm:max-w-4xl sm:p-6'> | ||
<div className='mb-6 flex justify-between'> | ||
<h1 className='mr-4 truncate text-lg font-bold'>{title}</h1> | ||
<button onClick={() => onModalClose()} data-testid='Modal-close'> | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' strokeWidth={1.5} stroke='currentColor' className='size-6'> | ||
<path strokeLinecap='round' strokeLinejoin='round' d='M6 18L18 6M6 6l12 12' /> | ||
</svg> | ||
</button> | ||
</div> | ||
<div className='max-h-[65vh] w-full overflow-auto lg:max-h-[70vh]'> | ||
{children} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
interface ISupportItemType { | ||
href: string; | ||
imgSrc: string; | ||
imgTitle: string; | ||
imgClass: string; | ||
section: number; | ||
}; | ||
|
||
export const items : ISupportItemType[] = [ | ||
{ | ||
href: 'https://slack.com/media-kit', | ||
imgSrc: '/img/supportus/slack.webp', | ||
imgTitle: 'Slack - Free Standard Subscription.', | ||
imgClass: 'inline-block px-4 sm:h-10', | ||
section: 1 | ||
}, | ||
{ | ||
href: 'https://toast.ninja/', | ||
imgSrc: '/img/supportus/toast.webp', | ||
imgTitle: 'Toast - Free services.', | ||
imgClass: 'inline-block px-4 sm:h-10', | ||
section: 1 | ||
}, | ||
{ | ||
href: 'https://www.netlify.com/', | ||
imgSrc: '/img/supportus/netlify.webp', | ||
imgTitle: 'Netlify - Free website deployment.', | ||
imgClass: 'inline-block px-4 sm:h-10', | ||
section: 1 | ||
}, | ||
{ | ||
href: 'https://sonarcloud.io/', | ||
imgSrc: '/img/supportus/sonarcloud.webp', | ||
imgTitle: 'Sonarcloud - Free tier for automated project scanning.', | ||
imgClass: 'inline-block px-4 md:h-14', | ||
section: 2 | ||
}, | ||
{ | ||
href: 'https://www.digitalocean.com/press/', | ||
imgSrc: '/img/supportus/digitalocean.webp', | ||
imgTitle: 'DigitalOcean - 500 dollars on cloud services.', | ||
imgClass: 'inline-block px-2 sm:h-8', | ||
section: 2 | ||
}, | ||
{ | ||
href: 'https://restream.io/', | ||
imgSrc: '/img/supportus/restream.webp', | ||
imgTitle: 'Restream - Free professional plan subscription.', | ||
imgClass: 'inline-block px-4 sm:h-6', | ||
section: 2 | ||
}, | ||
{ | ||
href: 'https://sessionize.com/', | ||
imgSrc: '/img/supportus/sessionize.webp', | ||
imgTitle: 'Sessionize-Free community license for AACoT Madrid.', | ||
imgClass: 'inline-block px-4 sm:h-9', | ||
section: 3 | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { items } from './SupportItemsList'; | ||
|
||
interface SupportUsProps { | ||
className?: string; | ||
showSupportBanner?: boolean; | ||
}; | ||
|
||
/** | ||
* @description This component displays support items. | ||
* @param {SupportUsProps} props - The props for SupportUs component. | ||
* @param {string} props.className - Additional CSS classes for styling. | ||
* @param {boolean} props.showSupportBanner - Indicates whether support banner should be displayed. | ||
*/ | ||
export default function SupportUs({ | ||
className = '' | ||
} : SupportUsProps): React.ReactNode { | ||
return ( | ||
<div className={ `text-center ${ className }` } data-testid='SupportUs-main'> | ||
<div className='flex flex-wrap items-center justify-center sm:py-2 md:mb-4 md:px-4' data-testid='SupportUs-section'> | ||
{ items | ||
.filter((item) => item.section === 1) | ||
.map((item, index) => ( | ||
<a | ||
key={ index } | ||
href={ item.href } | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
className='relative block w-2/3 p-4 text-center sm:w-1/3 sm:p-0 md:w-1/3 lg:w-1/5' | ||
> | ||
<img | ||
className={ item.imgClass } | ||
src={ item.imgSrc } | ||
title={ item.imgTitle } | ||
alt={item.imgTitle} | ||
/> | ||
</a> | ||
)) } | ||
</div> | ||
<div className='mb-4 flex flex-wrap items-center justify-center md:px-2' data-testid='SupportUs-subsection'> | ||
{ items | ||
.filter((item) => item.section === 2) | ||
.map((item, index) => ( | ||
<a | ||
key={ index } | ||
href={ item.href } | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
className='relative block w-2/3 p-4 text-center sm:w-1/3 sm:p-0 md:w-1/3 lg:w-1/5' | ||
> | ||
<img | ||
className={ item.imgClass } | ||
src={ item.imgSrc } | ||
title={ item.imgTitle } | ||
alt={item.imgTitle} | ||
/> | ||
</a> | ||
)) } | ||
</div> | ||
<div className='mb-4 flex flex-wrap items-center justify-center md:px-2' data-testid='SupportUs-last-div'> | ||
{ items | ||
.filter((item) => item.section === 3) | ||
.map((item, index) => ( | ||
<a | ||
key={ index } | ||
href={ item.href } | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
className='relative block w-2/3 p-4 text-center sm:w-1/3 sm:p-0 md:w-1/3 lg:w-1/5' | ||
> | ||
<img | ||
className={ item.imgClass } | ||
src={ item.imgSrc } | ||
title={ item.imgTitle } | ||
alt={item.imgTitle} | ||
/> | ||
</a> | ||
)) } | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.