-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add signatures #611
Add signatures #611
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request implements extensive signature management features. On the backend, it adds a Changes
Sequence Diagram(s)sequenceDiagram
participant FE as Frontend (Signature UI)
participant Modal as SignatureModal
participant API as SignatureController
participant Svc as SignatureService
participant Repo as SignatureRepository
participant DB as Database
FE->>API: Request default signature (GET /signatures/default)
API->>Svc: getDefaultSignature(orgId)
Svc->>Repo: getDefaultSignature(orgId)
Repo-->>Svc: Return default signature
Svc-->>API: Return default signature
API-->>FE: Send default signature
Modal->>API: Submit new/updated signature (POST/PUT)
API->>Svc: createOrUpdateSignature(orgId, signatureDto)
Svc->>Repo: createOrUpdateSignature(orgId, signatureDto)
Repo->>DB: Upsert signature, update autoAdd state
DB-->>Repo: Confirmation
Repo-->>Svc: Return signature data
Svc-->>API: Return result
API-->>Modal: Respond with success
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (13)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -61,6 +62,7 @@ | |||
return ( | |||
<> | |||
<div className="flex gap-[5px] justify-end -mt-[30px]"> | |||
<SignatureBox editor={newRef?.current?.editor!} /> |
Check warning
Code scanning / ESLint
Disallow non-null assertions using the `!` postfix operator Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 8 days ago
To fix the problem, we should avoid using the non-null assertion operator !
and instead handle the potential null
or undefined
values more gracefully. One way to do this is by using optional chaining and providing a fallback value or handling the case where the value is null
or undefined
.
In this specific case, we can check if newRef?.current?.editor
is defined before using it. If it is not defined, we can either return early or provide a fallback behavior.
-
Copy modified lines R55-R58 -
Copy modified lines R67-R81
@@ -54,4 +54,6 @@ | ||
setTimeout(() => { | ||
// @ts-ignore | ||
Transforms.insertText(newRef?.current?.editor!, emoji); | ||
const editor = newRef?.current?.editor; | ||
if (editor) { | ||
Transforms.insertText(editor, emoji); | ||
} | ||
}, 10); | ||
@@ -64,10 +66,17 @@ | ||
<div className="flex gap-[5px] justify-end -mt-[30px]"> | ||
<SignatureBox editor={newRef?.current?.editor!} /> | ||
<UText | ||
editor={newRef?.current?.editor!} | ||
currentValue={props.value!} | ||
/> | ||
<BoldText | ||
editor={newRef?.current?.editor!} | ||
currentValue={props.value!} | ||
{newRef?.current?.editor && ( | ||
<SignatureBox editor={newRef.current.editor} /> | ||
)} | ||
{newRef?.current?.editor && ( | ||
<UText | ||
editor={newRef.current.editor} | ||
currentValue={props.value ?? ''} | ||
/> | ||
)} | ||
{newRef?.current?.editor && ( | ||
<BoldText | ||
editor={newRef.current.editor} | ||
currentValue={props.value ?? ''} | ||
/> | ||
)} | ||
/> |
import clsx from 'clsx'; | ||
import { useModals } from '@mantine/modals'; | ||
import { TopTitle } from '@gitroom/frontend/components/launches/helpers/top.title.component'; | ||
import { array, boolean, object, string } from 'yup'; |
Check warning
Code scanning / ESLint
Disallow unused variables Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 8 days ago
The best way to fix the problem is to remove the unused array
import from the yup
library. This will clean up the code and adhere to the ESLint rule that disallows unused variables. The change should be made in the file apps/frontend/src/components/settings/signatures.component.tsx
on line 8.
-
Copy modified line R8
@@ -7,3 +7,3 @@ | ||
import { TopTitle } from '@gitroom/frontend/components/launches/helpers/top.title.component'; | ||
import { array, boolean, object, string } from 'yup'; | ||
import { boolean, object, string } from 'yup'; | ||
import { FormProvider, useForm } from 'react-hook-form'; |
const modal = useModals(); | ||
const load = useCallback(async () => { | ||
return (await fetch('/signatures')).json(); | ||
}, []); |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
children: <AddOrRemoveSignature data={data} reload={mutate} />, | ||
}); | ||
}, | ||
[mutate] |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
modal.closeModal(modal.modals[modal.modals.length - 1].id); | ||
reload(); | ||
}, | ||
[data, modal] |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
const [showModal, setShowModal] = useState<any>(false); | ||
const addSignature = useCallback(() => { | ||
setShowModal(true); | ||
}, [showModal]); |
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar Warning
Summary by CodeRabbit
New Features
Bug Fixes