Skip to content

Commit

Permalink
run the pre-commit hooks (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade authored Nov 15, 2024
1 parent 24c3da0 commit d7ef0b0
Show file tree
Hide file tree
Showing 32 changed files with 133 additions and 284 deletions.
14 changes: 0 additions & 14 deletions apps/console/public/icons/horizonal-bars.svg

This file was deleted.

2 changes: 1 addition & 1 deletion apps/console/src/app/(auth)/verify/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Suspense } from 'react'
import { LoaderCircle } from 'lucide-react'
import { TokenVerifier } from '@/components/pages/auth/subscriber-verify/verifier'
import { TokenVerifier } from '@/components/pages/auth/subscriber-verify/verifier'

export const dynamic = 'force-dynamic'

Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/app/(auth)/waitlist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Waitlist: React.FC = () => {
<Subscribe />

<div className="flex flex-col text-center text-sm text-oxford-blue-100 mt-20">
<Link href="/login">Back to login</Link>
<Link href="/login">Back to login</Link>
</div>
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function RootLayout({
async
src="https://js.stripe.com/v3/pricing-table.js">
</script>
</head>
</head>
<body
className={`${outfit.variable} ${mincho.variable} ${jetBrainsMono.variable} font-sans w-full h-full bg-ziggurat-100 overscroll-none dark:bg-oxford-blue-900`}
>
Expand Down
4 changes: 2 additions & 2 deletions apps/console/src/components/pages/auth/signup/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ export const SignupPage = () => {
}}
onSubmit={async (payload: RegisterUser) => {
setIsLoading(true)
try {
try {
const v: any = await validateEmail(payload)
if (!v) {
router.push('/waitlist')
return
}

if (payload.password === payload.confirmedPassword) {
delete payload.confirmedPassword

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const TokenVerifier = () => {

const [message, setMessage] = useState('')
const [error, setError] = useState('')


useEffect(() => {
const verifyToken = async () => {
Expand All @@ -42,7 +42,7 @@ export const TokenVerifier = () => {
<>
<div className="mx-auto animate-pulse w-96">
<Logo theme='dark' />
</div>
</div>
<div className={errorMessage()}>
No token provided, please check your email for a verification link.
</div>
Expand All @@ -51,11 +51,11 @@ export const TokenVerifier = () => {
}

if (error) {
return (
return (
<>
<div className="mx-auto animate-pulse w-96">
<Logo theme='dark' />
</div>
</div>
<div className={errorMessage()}>{error}</div>
</>
)
Expand All @@ -81,7 +81,7 @@ export const TokenVerifier = () => {
<>
<div className="mx-auto animate-pulse w-96">
<Logo theme='dark' />
</div>
</div>
<div className={loading()}>
<LoaderCircle className="animate-spin" size={20} />
<span className={successMessage()}>Verifying</span>
Expand Down
10 changes: 5 additions & 5 deletions apps/console/src/components/pages/invite/accept.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const InviteAccepter = () => {
const { data: session, update } = useSession()
const { push } = useRouter()
const token = searchParams?.get('token')

const { isLoading, verified, error } = useAcceptOrganizationInvite(token ?? null)

useEffect(() => {
const updateSession = async () => {
if (verified && session) {
Expand All @@ -28,14 +28,14 @@ export const InviteAccepter = () => {
organization: verified?.joined_org_id,
},
})

push('/dashboard')
}
}

updateSession()
}, [verified, error])

return (
<main className="flex flex-col min-h-screen w-full items-center space-between dark:bg-dk-surface-0 bg-surface-0">
<div className="flex flex-col justify-center mx-auto my-auto w-full p-6 sm:w-1/3 h-full relative ease-in-out">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ const PersonalAccessTokenForm = () => {
{Object.entries(orgs)
.reverse()
.map(([key, value], i) => (
<DropdownMenuCheckboxItem
<DropdownMenuCheckboxItem
className={checkboxRow()}
key={value?.node?.name}
key={value?.node?.name}
checked={value?.node?.id ? field.value?.includes(value.node.id) ?? false : false}
onCheckedChange={(checked) => {
const newValue = checked
Expand All @@ -235,7 +235,7 @@ const PersonalAccessTokenForm = () => {
<AvatarFallback>
{value?.node?.name?.substring(0, 2)}
</AvatarFallback>
</Avatar>
</Avatar>
{value?.node?.name}
</DropdownMenuCheckboxItem>
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const MemberActions = ({

type FormData = zInfer<typeof formSchema>


const form = useForm<FormData>({
resolver: zodResolver(formSchema),
defaultValues: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Actions = ({
const router = useRouter()
const { actionIcon } = pageStyles()
const { toast } = useToast()

// const [ _, deleteTemplate] = useDeletePolicyMutation()

const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
Expand Down Expand Up @@ -87,8 +87,8 @@ export const Actions = ({
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>


<AlertDialog open={isDeleteDialogOpen} onOpenChange={setIsDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const PoliciesTable = () => {
// onChange={handleSearch}
/>
</div>
<Button
<Button
icon={<PlusIcon />}
iconPosition="left"
onClick={handleCreateNew}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Actions = ({
const router = useRouter()
const { actionIcon } = pageStyles()
const { toast } = useToast()

// const [ _, deleteTemplate] = useDeleteProcedureMutation()

const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
Expand Down Expand Up @@ -87,8 +87,8 @@ export const Actions = ({
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>


<AlertDialog open={isDeleteDialogOpen} onOpenChange={setIsDeleteDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const ProceduresTable = () => {
// onChange={handleSearch}
/>
</div>
<Button
<Button
icon={<PlusIcon />}
iconPosition="left"
onClick={handleCreateNew}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const Actions = ({
})
}


const handleDeleteTemplate = async () => {
const response = await deleteTemplate({ deleteTemplateId: templateId })

Expand Down Expand Up @@ -144,7 +144,7 @@ export const Actions = ({
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>

<AlertDialog open={isSendDialogOpen} onOpenChange={setIsSendDialogOpen}>
<AlertDialogContent>
<AlertDialogHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ export const CreateDropdown = () => {
const router = useRouter()

const [isTemplateDialogOpen, setTemplateDialogOpen] = useState(false);

const handleCreateNew = () => {
router.push('/documents/questionnaire-editor')
}

const {
buttons,
} = pageStyles()


return (
<div className={buttons()} >
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
<Button
icon={<PlusIcon />}
iconPosition="left"
onClick={handleCreateNew}
Expand All @@ -53,4 +53,3 @@ export const CreateDropdown = () => {
</div>
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const creatorOptions = {
};

// Register the SurveyJS license key
slk(
slk(
surveyLicenseKey as string,
)

Expand All @@ -45,7 +45,7 @@ export default function CreateQuestionnaire(input: { templateId: string, existin

const creator = new SurveyCreator(creatorOptions);
const themeTabPlugin = creator.themeEditor;

function addCustomTheme(theme: ITheme, userFriendlyThemeName : string) {
// Add a localized user-friendly theme name
if (theme.themeName) {
Expand All @@ -54,7 +54,7 @@ export default function CreateQuestionnaire(input: { templateId: string, existin
// Add the theme to the theme list as the default theme
themeTabPlugin.addTheme(theme, true);
}

// Register a custom theme with Dark and Light variations
addCustomTheme(lightTheme, customThemeName);
addCustomTheme(darkTheme, customThemeName);
Expand All @@ -75,13 +75,13 @@ export default function CreateQuestionnaire(input: { templateId: string, existin
const variables = { getTemplateId: input.existingId || input.templateId }

const [templateResult] = useGetTemplateQuery({ variables });

if (templateResult.data) {
creator.JSON = templateResult.data.template.jsonconfig;
}

// setup save function
const [template, createTemplateData] = useCreateTemplateMutation();
const [template, createTemplateData] = useCreateTemplateMutation();
const [, updateTemplateData] = useUpdateTemplateMutation()

const saveTemplate = async (data: any, saveNo : string, callback : any) => {
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function CreateQuestionnaire(input: { templateId: string, existin
title: 'A questionnaire with this name already exists, please choose a different name',
variant: 'destructive',
})
} else if (response.error.graphQLErrors[0].message == 'must be defined') {
} else if (response.error.graphQLErrors[0].message == 'must be defined') {

const missingField = response.error.graphQLErrors[0].path?.slice(-1)[0]
toast({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const QuestionnairesTable = () => {
onChange={handleSearch}
/>
</div>

{createDropdown()}

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function ViewQuestionnaire(input: {existingId: string }) {
// apply theme to the creator
const themeContext = useTheme()
const theme = themeContext.resolvedTheme as "light" | "dark" | "white" | undefined

const variables = { getTemplateId: input.existingId}
const [templateResult] = useGetTemplateQuery({ variables });
const surveyJson = templateResult?.data?.template?.jsonconfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const TemplateList = () => {
const formSchema = z.object({
templateId: z.string(),
})

type FormData = zInfer<typeof formSchema>

const form = useForm<FormData>({
Expand Down
8 changes: 4 additions & 4 deletions apps/console/src/components/shared/editor/plate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const resetBlockTypesCommonRule = {
types: [BlockquotePlugin.key, TodoListPlugin.key],
defaultType: ParagraphPlugin.key,
};

const resetBlockTypesCodeBlockRule = {
types: [CodeBlockPlugin.key],
defaultType: ParagraphPlugin.key,
Expand Down Expand Up @@ -279,17 +279,17 @@ export default function PlateEditor() {
const handleChange = ({ value }: { value: typeof initialValue }) => {
setEditorContent(value);
};

return (
<>
<DndProvider backend={HTML5Backend}>
<Plate editor={editor} onChange={handleChange} >
<FixedToolbar>
<FixedToolbarButtons />
</FixedToolbar>

<Editor variant="fullWidth" />

<FloatingToolbar>
<FloatingToolbarButtons />
</FloatingToolbar>
Expand Down
4 changes: 2 additions & 2 deletions apps/console/src/lib/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const config = {
if (!allow) {
return '/waitlist'
}

// register user that signed in via oauth provider
if (account?.type === 'oauth' || account?.type === 'oidc') {
const oauthUser = {
Expand Down Expand Up @@ -108,7 +108,7 @@ export const config = {
return true
},
jwt({ token, user, account, profile, trigger, session }) {
/*
/*
set tokens on user
*/
if (typeof user !== 'undefined') {
Expand Down
Loading

0 comments on commit d7ef0b0

Please sign in to comment.