-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore(dashboard): bring the hrm alive #6703
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
95b945a
feat(dashboard): workflow editor layout and route
LetItRock 665cf04
feat(dashboard): workflow editor canvas - base step nodes and edges
LetItRock 2fd5b4c
chore(dashboard): bring the hrm alive
LetItRock 555da89
chore(dashboard): the lock file update
LetItRock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { useRouteError } from 'react-router-dom'; | ||
|
||
export default function ErrorPage() { | ||
const error = useRouteError() as any; | ||
const error = useRouteError() as { statusText?: string; message: string }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed a bunch any types |
||
console.error(error); | ||
|
||
return ( | ||
|
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,4 +1,3 @@ | ||
import { StepTypeEnum } from '@novu/shared'; | ||
import { | ||
RiCellphoneFill, | ||
RiChatThreadFill, | ||
|
@@ -11,6 +10,7 @@ import { Mail3Fill } from './mail-3-fill'; | |
import { Notification5Fill } from './notification-5-fill'; | ||
import { Sms } from './sms'; | ||
import { IconType } from 'react-icons/lib'; | ||
import { StepTypeEnum } from '@/utils/enums'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copied types from |
||
export const STEP_TYPE_TO_ICON: Record<StepTypeEnum, IconType> = { | ||
[StepTypeEnum.CHAT]: RiChatThreadFill, | ||
|
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
40 changes: 40 additions & 0 deletions
40
apps/dashboard/src/components/primitives/form/form-context.ts
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,40 @@ | ||
import React from 'react'; | ||
import { FieldPath, FieldValues, useFormContext } from 'react-hook-form'; | ||
|
||
type FormFieldContextValue< | ||
TFieldValues extends FieldValues = FieldValues, | ||
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, | ||
> = { | ||
name: TName; | ||
}; | ||
|
||
export const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue); | ||
|
||
type FormItemContextValue = { | ||
id: string; | ||
}; | ||
|
||
export const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue); | ||
|
||
export const useFormField = () => { | ||
const fieldContext = React.useContext(FormFieldContext); | ||
const itemContext = React.useContext(FormItemContext); | ||
const { getFieldState, formState } = useFormContext(); | ||
|
||
const fieldState = getFieldState(fieldContext.name, formState); | ||
|
||
if (!fieldContext) { | ||
throw new Error('useFormField should be used within <FormField>'); | ||
} | ||
|
||
const { id } = itemContext; | ||
|
||
return { | ||
id, | ||
name: fieldContext.name, | ||
formItemId: `${id}-form-item`, | ||
formDescriptionId: `${id}-form-item-description`, | ||
formMessageId: `${id}-form-item-message`, | ||
...fieldState, | ||
}; | ||
}; |
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 @@ | ||
export * from './form'; |
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,39 +1,13 @@ | ||
import * as React from 'react'; | ||
import { cva, type VariantProps } from 'class-variance-authority'; | ||
import { type VariantProps } from 'class-variance-authority'; | ||
|
||
import { cn } from '@/utils/ui'; | ||
|
||
const stepVariants = cva( | ||
'inline-flex items-center shadow-xs rounded-full border text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 bg-neutral-50', | ||
{ | ||
variants: { | ||
variant: { | ||
// use solid bg here because we usually stack these on top of each other | ||
neutral: 'border-neutral-100 text-neutral-400', | ||
feature: 'border-feature/30 text-feature/30', | ||
information: 'border-information/30 text-information/30', | ||
highlighted: 'border-highlighted/30 text-highlighted/30', | ||
stable: 'border-stable/30 text-stable/30', | ||
verified: 'border-verified/30 text-verified/30', | ||
destructive: 'border-destructive/30 text-destructive/30', | ||
warning: 'border-warning/30 text-warning/30', | ||
alert: 'border-alert/30 text-alert/30', | ||
}, | ||
size: { | ||
default: 'p-1 [&>svg]:size-3.5', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'neutral', | ||
size: 'default', | ||
}, | ||
} | ||
); | ||
import { stepVariants } from './variants'; | ||
|
||
export interface StepProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof stepVariants> {} | ||
|
||
function Step({ className, variant, ...props }: StepProps) { | ||
return <div className={cn(stepVariants({ variant }), className)} {...props} />; | ||
} | ||
|
||
export { Step, stepVariants }; | ||
export { Step }; |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-refresh
eslint rule to split the exported components should be an error