Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added extra check for already waitlisted users and created toast message for them #491

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/create.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ export class CreateEnvironment extends BaseCommand {
data: environment,
error,
success
} = await ControllerInstance
.getInstance()
.environmentController.createEnvironment(
{name, description, projectSlug},
} = await ControllerInstance.getInstance().environmentController.createEnvironment(
{ name, description, projectSlug },
this.headers
)

Expand Down
11 changes: 5 additions & 6 deletions apps/cli/src/commands/environment/delete.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ export class DeleteEnvironment extends BaseCommand {

Logger.info('Deleting Environment...')

const { success, error } = await ControllerInstance
.getInstance()
.environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)
const { success, error } =
await ControllerInstance.getInstance().environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)

if (success) {
Logger.info('Environment deleted successfully')
Expand Down
4 changes: 1 addition & 3 deletions apps/cli/src/commands/environment/get.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export class GetEnvironment extends BaseCommand {
success,
error,
data: environment
} = await ControllerInstance
.getInstance()
.environmentController.getEnvironment(
} = await ControllerInstance.getInstance().environmentController.getEnvironment(
{ slug: environmentSlug },
this.headers
)
Expand Down
16 changes: 9 additions & 7 deletions apps/cli/src/commands/environment/list.environment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BaseCommand from '../base.command'
import ControllerInstance from '@/util/controller-instance'
import {
CommandOption,
type CommandOption,
type CommandActionData,
type CommandArgument
} from 'src/types/command/command.types'
Expand Down Expand Up @@ -40,12 +40,14 @@ export class ListEnvironment extends BaseCommand {

Logger.info('Fetching all environments...')

const { data: environments, error, success } = await ControllerInstance
.getInstance()
.environmentController.getAllEnvironmentsOfProject(
{ projectSlug, ...options },
this.headers
)
const {
data: environments,
error,
success
} = await ControllerInstance.getInstance().environmentController.getAllEnvironmentsOfProject(
{ projectSlug, ...options },
this.headers
)

if (success) {
Logger.info('Fetched environments:')
Expand Down
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/update.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ export class UpdateEnvironment extends BaseCommand {
success,
error,
data: environment
} = await ControllerInstance
.getInstance().
environmentController.updateEnvironment(
{name, description, slug: environmentSlug},
} = await ControllerInstance.getInstance().environmentController.updateEnvironment(
{ name, description, slug: environmentSlug },
this.headers
)

Expand Down
5 changes: 4 additions & 1 deletion apps/cli/src/commands/workspace/list.workspace.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import BaseCommand from '@/commands/base.command'
import { Logger } from '@/util/logger'
import ControllerInstance from '@/util/controller-instance'
import { CommandActionData, CommandOption } from '@/types/command/command.types'
import {
type CommandActionData,
type CommandOption
} from '@/types/command/command.types'
import { PAGINATION_OPTION } from '@/util/pagination-options'

export default class ListWorkspace extends BaseCommand {
Expand Down
6 changes: 3 additions & 3 deletions apps/cli/src/commands/workspace/role/get.role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ export default class GetRoleCommand extends BaseCommand {
)

if (success) {
Logger.info(`Workspace role fetched successfully!`)
Logger.info('Workspace role fetched successfully!')
Logger.info(`Workspace role: ${data.name} (${data.slug})`)
Logger.info(`Description: ${data.description || 'N/A'}`)
Logger.info(`Created at ${data.createdAt}`)
Logger.info(`Updated at ${data.updatedAt}`)
Logger.info(`Authorities:`)
Logger.info('Authorities:')
for (const authority of data.authorities) {
Logger.info(`- ${authority}`)
}
Logger.info(`Projects:`)
Logger.info('Projects:')
for (const project of data.projects) {
Logger.info(`- ${project.project.name} (${project.project.slug})`)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/commands/workspace/role/list.role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BaseCommand from '@/commands/base.command'
import {
type CommandActionData,
type CommandArgument,
CommandOption
type CommandOption
} from '@/types/command/command.types'
import { Logger } from '@/util/logger'
import ControllerInstance from '@/util/controller-instance'
Expand Down
8 changes: 4 additions & 4 deletions apps/cli/src/commands/workspace/role/update.role.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BaseCommand from '@/commands/base.command'
import {
CommandOption,
type CommandOption,
type CommandActionData,
type CommandArgument
} from '@/types/command/command.types'
Expand Down Expand Up @@ -76,17 +76,17 @@ export default class UpdateRoleCommand extends BaseCommand {
)

if (success) {
Logger.info(`Workspace role updated successfully:`)
Logger.info('Workspace role updated successfully:')
Logger.info(`Workspace role: ${data.name} (${data.slug})`)
Logger.info(`Description: ${data.description || 'N/A'}`)
Logger.info(`Created at ${data.createdAt}`)
Logger.info(`Updated at ${data.updatedAt}`)
Logger.info(`Color code: ${data.colorCode}`)
Logger.info(`Authorities:`)
Logger.info('Authorities:')
for (const authority of data.authorities) {
Logger.info(`- ${authority}`)
}
Logger.info(`Projects:`)
Logger.info('Projects:')
for (const project of data.projects) {
Logger.info(`- ${project.project.name} (${project.project.slug})`)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/util/pagination-options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommandOption } from '@/types/command/command.types'
import { type CommandOption } from '@/types/command/command.types'

export const PAGINATION_OPTION: CommandOption[] = [
{
Expand Down
7 changes: 6 additions & 1 deletion apps/platform/src/app/auth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { useRouter } from 'next/navigation'
import { useAtom } from 'jotai'
import Cookies from 'js-cookie'
import { LoadingSVG } from '@public/svg/shared'
import { GithubSVG, GoogleSVG, KeyshadeBigSVG ,GitlabSVG} from '@public/svg/auth'
import {
GithubSVG,
GoogleSVG,
KeyshadeBigSVG,
GitlabSVG
} from '@public/svg/auth'
import { Input } from '@/components/ui/input'
import { Button } from '@/components/ui/button'
import { authEmailAtom } from '@/store'
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/(main)/career/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColorBGSVG } from '@public/hero'
import Link from 'next/link'
import { ColorBGSVG } from '@public/hero'
import EncryptButton from '@/components/ui/encrypt-btn'

function Career(): React.JSX.Element {
Expand Down
28 changes: 26 additions & 2 deletions apps/web/src/components/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { InputBorderSpotlight } from '../ui/input-spotlight'

function Hero(): React.JSX.Element {
const [email, setEmail] = useState<string>('')
//@typescript-eslint/no-unused-vars
const [_waitListData, setWaitListData] = useState<string[]>([])

const onSubmit = (e: React.FormEvent): void => {
e.preventDefault()
Expand All @@ -22,6 +24,24 @@ function Hero(): React.JSX.Element {
return
}

const dataInStorage: string | null = localStorage.getItem('waitListData')
const waitListedEmails: string[] = dataInStorage
? (JSON.parse(dataInStorage) as string[])
: []

// actual logic where we are checking if this email is already in waitlisted users or not
if (waitListedEmails.includes(email)) {
toast.custom(() => (
<div className="text-brandBlue border-brandBlue/20 w-[90vw] rounded-lg border bg-[#852b2c] p-2 shadow-2xl backdrop-blur-3xl md:w-[20vw]">
<p className="text-sm">
You have been already added to the waitlist. We will notify you once
we launch.{' '}
</p>
</div>
))
return
}

const url =
'https://xyz.us18.list-manage.com/subscribe/post?u=2e44b940cafe6e54d8b9e0790&amp;id=bd382dd7c5&amp;f_id=00e5c2e1f0'

Expand All @@ -39,8 +59,12 @@ function Hero(): React.JSX.Element {
await fetch(`${url}&EMAIL=${email}`, {
mode: 'no-cors'
})
setEmail('');

setWaitListData((prevData) => {
const updatedData: string[] = [...prevData, email]
localStorage.setItem('waitListData', JSON.stringify(updatedData))
return updatedData
})
setEmail('')
} catch (error) {
// eslint-disable-next-line no-console -- chill
console.error(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class WorkspaceMembershipController {
request: GetMembersRequest,
headers?: Record<string, string>
): Promise<ClientResponse<GetMembersResponse>> {
let url = parsePaginationUrl(
const url = parsePaginationUrl(
`/api/workspace-membership/${request.workspaceSlug}/members`,
request
)
Expand Down
12 changes: 7 additions & 5 deletions packages/secret-scan/src/rules/age.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ export default function age(): RegExp[] {

const testcase: TestCase[] = [
{
input: 'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK',
input:
'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK',
expected: true
},
{
input: 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
input:
'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
expected: false
},
{
input: 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L',
expected: false
},
{
input: "AGE-SECRET-KEY",
input: 'AGE-SECRET-KEY',
expected: false
},
{
input: "AGE",
input: 'AGE',
expected: false
}
]

age.testcases = testcase
age.testcases = testcase
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/airtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ const testcase: TestCase[] = [
}
]

airtable.testcases = testcase
airtable.testcases = testcase
48 changes: 24 additions & 24 deletions packages/secret-scan/src/rules/asana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
import type { TestCase } from '@/types'

export default function asana(): RegExp[] {
return [
// Asana API key regex
/asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i
]
return [
// Asana API key regex
/asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i
]
}

const testcase: TestCase[] = [
{
input: 'asana7127506407697088',
expected: true
},
{
input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX',
expected: true
},
{
input: 'asana',
expected: false
},
{
input: 'asana123',
expected: false
},
{
input: 'asanahsdiu3nniwoien',
expected: false
}
{
input: 'asana7127506407697088',
expected: true
},
{
input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX',
expected: true
},
{
input: 'asana',
expected: false
},
{
input: 'asana123',
expected: false
},
{
input: 'asanahsdiu3nniwoien',
expected: false
}
]

asana.testcases = testcase
Loading