-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: complete AI handover priorities (1-5) #35
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
Open
Adityavanjre
wants to merge
1
commit into
main
Choose a base branch
from
feature/handover-priorities-674205737836759880
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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,35 @@ | ||
| async function testResend() { | ||
| const apiKey = process.env.RESEND_API_KEY; | ||
| if (!apiKey) { | ||
| console.error('RESEND_API_KEY not found in environment'); | ||
| return; | ||
| } | ||
|
|
||
| try { | ||
| const res = await fetch('https://api.resend.com/emails', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': `Bearer ${apiKey}` | ||
| }, | ||
| body: JSON.stringify({ | ||
| from: 'Nexus System Alert <alerts@klypso.in>', | ||
| to: 'test@example.com', | ||
| subject: 'Test Resend Verification', | ||
| html: '<p>This is a test email</p>' | ||
| }) | ||
| }); | ||
|
|
||
| if (res.ok) { | ||
| console.log('Email sent successfully via Resend API'); | ||
| } else { | ||
| console.log('Failed to send email. Status:', res.status); | ||
| const text = await res.text(); | ||
| console.log('Response:', text); | ||
| } | ||
| } catch (e) { | ||
| console.error('Error during fetch:', e.message); | ||
| } | ||
| } | ||
|
|
||
| testResend(); |
533 changes: 361 additions & 172 deletions
533
nexus/frontend/src/app/(dashboard)/invoice/[id]/page.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,15 @@ | ||
| import re | ||
|
|
||
| with open('nexus/frontend/src/app/(dashboard)/invoice/[id]/page.tsx', 'r') as f: | ||
| content = f.read() | ||
|
|
||
| if 'useUX' not in content: | ||
| content = content.replace('import { toast } from "sonner";', | ||
| 'import { toast } from "sonner";\nimport { useUX } from "../../../../components/providers/ux-provider";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../../components/ui/select";') | ||
|
|
||
| if 'const { pbac } = useUX();' not in content: | ||
| content = content.replace('const [loading, setLoading] = useState(true);', | ||
| 'const [loading, setLoading] = useState(true);\n const [template, setTemplate] = useState("classic");\n const { pbac } = useUX();\n const logoUrl = pbac.tenantProfile?.logoUrl;') | ||
|
|
||
| with open('nexus/frontend/src/app/(dashboard)/invoice/[id]/page.tsx', 'w') as f: | ||
| f.write(content) |
This file contains hidden or 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,13 @@ | ||
| import re | ||
|
|
||
| with open('nexus/frontend/src/components/sales/rapid/CheckoutSidebar.tsx', 'r') as f: | ||
| content = f.read() | ||
|
|
||
| content = content.replace("import { Settings, Plus, CreditCard, Banknote, Landmark, Smartphone, FileText, Upload, Check, Trash2, Printer, CheckCircle2 } from \"lucide-react\";", | ||
| "import { Plus, CreditCard, Banknote, Landmark, Smartphone, FileText, Upload, Check, Trash2, Printer, CheckCircle2 } from \"lucide-react\";") | ||
|
|
||
| content = content.replace("customerName,", "/* customerName, */") | ||
| content = content.replace(" customerName: string;", " customerName?: string;") | ||
|
|
||
| with open('nexus/frontend/src/components/sales/rapid/CheckoutSidebar.tsx', 'w') as f: | ||
| f.write(content) |
This file contains hidden or 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,21 @@ | ||
| import re | ||
|
|
||
| with open('nexus/frontend/src/components/layout/sidebar.tsx', 'r') as f: | ||
| content = f.read() | ||
|
|
||
| if 'tenantProfile' not in content: | ||
| content = content.replace('const { pbac, triggerSessionExpiry, setUILocked } = useUX();', | ||
| 'const { pbac, triggerSessionExpiry, setUILocked } = useUX();\n const { tenantProfile } = pbac;') | ||
|
|
||
| old_logo_ui = '''<KlypsoLogo name={user?.tenantName || "KLYPSO"} />''' | ||
| new_logo_ui = '''{tenantProfile?.logoUrl ? ( | ||
| <div className="flex items-center"> | ||
| <img src={tenantProfile.logoUrl} alt={user?.tenantName || "Logo"} className="h-8 w-auto object-contain max-w-[140px]" /> | ||
| </div> | ||
| ) : ( | ||
| <KlypsoLogo name={user?.tenantName || "KLYPSO"} /> | ||
| )}''' | ||
| content = content.replace(old_logo_ui, new_logo_ui) | ||
|
|
||
| with open('nexus/frontend/src/components/layout/sidebar.tsx', 'w') as f: | ||
| f.write(content) |
This file contains hidden or 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,10 @@ | ||
| import re | ||
|
|
||
| with open('nexus/frontend/src/components/layout/sidebar.tsx', 'r') as f: | ||
| content = f.read() | ||
|
|
||
| content = content.replace('const { pbac, hasPermission } = useUX();', | ||
| 'const { pbac, hasPermission } = useUX();\n const { tenantProfile } = pbac;') | ||
|
|
||
| with open('nexus/frontend/src/components/layout/sidebar.tsx', 'w') as f: | ||
| f.write(content) |
This file contains hidden or 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,22 @@ | ||
| import re | ||
|
|
||
| with open('nexus/frontend/src/components/providers/ux-provider.tsx', 'r') as f: | ||
| content = f.read() | ||
|
|
||
| if 'tenantProfile?:' not in content: | ||
| content = content.replace('interface PBACState {\n permissions: Record<string, string[]>;\n modules: string[];\n}', | ||
| 'interface PBACState {\n permissions: Record<string, string[]>;\n modules: string[];\n tenantProfile?: { name?: string; logoUrl?: string };\n}') | ||
|
|
||
| if 'res.data.tenantProfile' not in content: | ||
| content = content.replace('''const newState = { | ||
| permissions: res.data.permissions || {}, | ||
| modules: res.data.modules || [], | ||
| };''', | ||
| '''const newState = { | ||
| permissions: res.data.permissions || {}, | ||
| modules: res.data.modules || [], | ||
| tenantProfile: res.data.tenantProfile || undefined, | ||
| };''') | ||
|
|
||
| with open('nexus/frontend/src/components/providers/ux-provider.tsx', 'w') as f: | ||
| f.write(content) |
This file contains hidden or 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,17 @@ | ||
| import { MailService } from './nexus/backend/src/system/services/mail.service'; | ||
| import { ConfigService } from '@nestjs/config'; | ||
|
|
||
| async function run() { | ||
| const config = new ConfigService({ RESEND_API_KEY: process.env.RESEND_API_KEY }); | ||
| const mailService = new MailService(config); | ||
|
|
||
| try { | ||
| console.log('Sending test email...'); | ||
| const result = await mailService.sendEmail('test@example.com', 'Test Email', '<p>This is a test email.</p>'); | ||
| console.log('Result:', result); | ||
| } catch (e) { | ||
| console.error('Error:', e); | ||
| } | ||
| } | ||
|
|
||
| run(); |
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.
Uh oh!
There was an error while loading. Please reload this page.