-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sam/24_11_07/feat/enforce-max-cli-version
- Loading branch information
Showing
30 changed files
with
154 additions
and
46 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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- master | ||
- staging/** | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
build-image: | ||
|
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- opened | ||
- edited | ||
- synchronize | ||
merge_group: | ||
|
||
permissions: | ||
pull-requests: read | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- master | ||
- staging/** | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
lint-code: | ||
|
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import formData from 'form-data'; | ||
import Mailgun from 'mailgun.js'; | ||
import { getLogger } from '@nangohq/utils'; | ||
import type Client from 'mailgun.js/client'; | ||
|
||
const logger = getLogger('Server.EmailClient'); | ||
|
||
export class EmailClient { | ||
private static instance: EmailClient | undefined; | ||
private client: any; | ||
private client: Client; | ||
|
||
private constructor(config: { username: string; key: string }) { | ||
private constructor(config: { username: string; key: string; url?: string }) { | ||
const mailgun = new Mailgun(formData); | ||
this.client = mailgun.client(config); | ||
} | ||
|
@@ -17,7 +18,8 @@ export class EmailClient { | |
if (!EmailClient.instance) { | ||
EmailClient.instance = new EmailClient({ | ||
username: 'api', | ||
key: process.env['MAILGUN_API_KEY'] || 'EMPTY' | ||
key: process.env['MAILGUN_API_KEY'] || 'EMPTY', | ||
url: process.env['MAILGUN_URL'] || '' | ||
}); | ||
} | ||
return EmailClient.instance; | ||
|
@@ -31,6 +33,7 @@ export class EmailClient { | |
logger.info(html); | ||
return; | ||
} | ||
|
||
return this.client.messages.create('email.nango.dev', { | ||
from: 'Nango <[email protected]>', | ||
to: [email], | ||
|
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
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,67 @@ | ||
import { useState, useEffect, useRef } from 'react'; | ||
import type { ClassValue } from 'clsx'; | ||
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/Tooltip'; | ||
import { IconCopy } from '@tabler/icons-react'; | ||
import { cn } from '../utils/utils'; | ||
|
||
export const CopyText: React.FC<{ text: string; showOnHover?: boolean; className?: ClassValue }> = ({ text, showOnHover, className }) => { | ||
const [tooltipText, setTooltipText] = useState('Copy'); | ||
const triggerRef = useRef(null); | ||
|
||
const copyToClipboard = async (e: React.MouseEvent) => { | ||
try { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
await navigator.clipboard.writeText(text); | ||
setTooltipText('Copied'); | ||
} catch (err) { | ||
//this should never happen! | ||
console.error('Failed to copy:', err); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setTooltipText('Copy'); | ||
}, 1000); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [tooltipText]); | ||
|
||
return ( | ||
<Tooltip delayDuration={0}> | ||
<TooltipTrigger asChild> | ||
<button | ||
className={cn( | ||
'group transition-colors inline-flex max-w-full items-center gap-1.5 text-dark-400 border border-transparent px-2 py-0.5 rounded-md hover:border-dark-500 hover:text-white', | ||
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring', | ||
className | ||
)} | ||
onClick={copyToClipboard} | ||
ref={triggerRef} | ||
> | ||
<div className="truncate">{text}</div> | ||
<div className={cn('text-xs text-white', showOnHover && 'transition-opacity opacity-0 group-hover:opacity-100')}> | ||
<IconCopy stroke={1} size={15} /> | ||
</div> | ||
</button> | ||
</TooltipTrigger> | ||
<TooltipContent | ||
sideOffset={10} | ||
align="end" | ||
className="text-white" | ||
onPointerDownOutside={(event) => { | ||
// Radix assume a click on a tooltip should close it | ||
// https://github.com/radix-ui/primitives/issues/2029 | ||
if (event.target === triggerRef.current || (event.target as any).parentNode === triggerRef.current) { | ||
event.preventDefault(); | ||
} | ||
}} | ||
> | ||
{tooltipText} | ||
</TooltipContent> | ||
</Tooltip> | ||
); | ||
}; |
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
Oops, something went wrong.