Skip to content

Commit 6f3dee8

Browse files
authored
fix(notes): fix notes block spacing, additional logs for billing transfer route (#2029)
1 parent bfa7c91 commit 6f3dee8

File tree

3 files changed

+60
-97
lines changed

3 files changed

+60
-97
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/note-block/note-block.tsx

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,51 +35,64 @@ const NoteMarkdown = memo(function NoteMarkdown({ content }: { content: string }
3535
<ReactMarkdown
3636
remarkPlugins={[remarkGfm]}
3737
components={{
38-
p: ({ children }) => (
39-
<p className='!mt-0 !-mb-4 text-[#E5E5E5] text-sm leading-tight'>{children}</p>
38+
p: ({ children }: any) => (
39+
<p className='mb-2 break-words text-[#E5E5E5] text-sm'>{children}</p>
4040
),
41-
h1: ({ children }) => (
42-
<h1 className='!mt-0 !-mb-4 font-semibold text-[#E5E5E5] text-lg leading-tight'>
41+
h1: ({ children }: any) => (
42+
<h1 className='mt-3 mb-1 break-words font-semibold text-[#E5E5E5] text-lg first:mt-0'>
4343
{children}
4444
</h1>
4545
),
46-
h2: ({ children }) => (
47-
<h2 className='!mt-0 !-mb-4 font-semibold text-[#E5E5E5] text-base leading-tight'>
46+
h2: ({ children }: any) => (
47+
<h2 className='mt-3 mb-1 break-words font-semibold text-[#E5E5E5] text-base first:mt-0'>
4848
{children}
4949
</h2>
5050
),
51-
h3: ({ children }) => (
52-
<h3 className='!mt-0 !-mb-4 font-semibold text-[#E5E5E5] text-sm leading-tight'>
51+
h3: ({ children }: any) => (
52+
<h3 className='mt-3 mb-1 break-words font-semibold text-[#E5E5E5] text-sm first:mt-0'>
5353
{children}
5454
</h3>
5555
),
56-
h4: ({ children }) => (
57-
<h4 className='!mt-0 !-mb-4 font-semibold text-[#E5E5E5] text-xs leading-tight'>
56+
h4: ({ children }: any) => (
57+
<h4 className='mt-3 mb-1 break-words font-semibold text-[#E5E5E5] text-xs first:mt-0'>
5858
{children}
5959
</h4>
6060
),
61-
ul: ({ children }) => (
62-
<ul className='!-mt-4 !-mb-4 [&_li>ul]:!mt-0 [&_li>ul]:!mb-0 [&_li>ol]:!mt-0 [&_li>ol]:!mb-0 list-disc pl-4 text-[#E5E5E5] text-sm leading-tight'>
61+
ul: ({ children }: any) => (
62+
<ul className='mt-1 mb-2 list-disc break-words pl-4 text-[#E5E5E5] text-sm'>
6363
{children}
6464
</ul>
6565
),
66-
ol: ({ children }) => (
67-
<ol className='!-mt-4 !-mb-4 [&_li>ul]:!mt-0 [&_li>ul]:!mb-0 [&_li>ol]:!mt-0 [&_li>ol]:!mb-0 list-decimal pl-4 text-[#E5E5E5] text-sm leading-tight'>
66+
ol: ({ children }: any) => (
67+
<ol className='mt-1 mb-2 list-decimal break-words pl-4 text-[#E5E5E5] text-sm'>
6868
{children}
6969
</ol>
7070
),
71-
li: ({ children }) => <li className='!mb-0 leading-tight'>{children}</li>,
72-
code: ({ inline, children }: any) =>
73-
inline ? (
74-
<code className='break-words rounded bg-[var(--divider)] px-1 py-0.5 text-[#F59E0B] text-xs'>
75-
{children}
76-
</code>
77-
) : (
78-
<code className='block whitespace-pre-wrap break-words rounded bg-[#1A1A1A] p-2 text-[#E5E5E5] text-xs'>
71+
li: ({ children }: any) => <li className='mb-0 break-words'>{children}</li>,
72+
code: ({ inline, className, children, ...props }: any) => {
73+
const isInline = inline || !className?.includes('language-')
74+
75+
if (isInline) {
76+
return (
77+
<code
78+
{...props}
79+
className='whitespace-normal rounded bg-gray-200 px-1 py-0.5 font-mono text-[#F59E0B] text-xs dark:bg-[var(--surface-11)] dark:text-[#F59E0B]'
80+
>
81+
{children}
82+
</code>
83+
)
84+
}
85+
86+
return (
87+
<code
88+
{...props}
89+
className='block whitespace-pre-wrap break-words rounded bg-[#1A1A1A] p-2 text-[#E5E5E5] text-xs'
90+
>
7991
{children}
8092
</code>
81-
),
82-
a: ({ href, children }) => (
93+
)
94+
},
95+
a: ({ href, children }: any) => (
8396
<a
8497
href={href}
8598
target='_blank'
@@ -89,10 +102,12 @@ const NoteMarkdown = memo(function NoteMarkdown({ content }: { content: string }
89102
{children}
90103
</a>
91104
),
92-
strong: ({ children }) => <strong className='font-semibold text-white'>{children}</strong>,
93-
em: ({ children }) => <em className='text-[#B8B8B8]'>{children}</em>,
94-
blockquote: ({ children }) => (
95-
<blockquote className='!mt-0 !-mb-4 border-[#F59E0B] border-l-2 pl-3 text-[#B8B8B8] italic'>
105+
strong: ({ children }: any) => (
106+
<strong className='break-words font-semibold text-white'>{children}</strong>
107+
),
108+
em: ({ children }: any) => <em className='break-words text-[#B8B8B8]'>{children}</em>,
109+
blockquote: ({ children }: any) => (
110+
<blockquote className='mt-1 mb-2 break-words border-[#F59E0B] border-l-2 pl-3 text-[#B8B8B8] italic'>
96111
{children}
97112
</blockquote>
98113
),
@@ -195,7 +210,7 @@ export const NoteBlock = memo(function NoteBlock({ id, data }: NodeProps<NoteBlo
195210
</div>
196211

197212
<div className='relative px-[12px] pt-[6px] pb-[8px]'>
198-
<div className='relative whitespace-pre-wrap break-words'>
213+
<div className='relative break-words'>
199214
{isEmpty ? (
200215
<p className='text-[#868686] text-sm italic'>Add a note...</p>
201216
) : showMarkdown ? (

apps/sim/lib/subscription/upgrade.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function useSubscriptionUpgrade() {
7676
try {
7777
await client.organization.setActive({ organizationId: result.organizationId })
7878

79-
logger.info('Set organization as active and updated referenceId', {
79+
logger.info('Set organization as active', {
8080
organizationId: result.organizationId,
8181
oldReferenceId: userId,
8282
newReferenceId: referenceId,
@@ -90,6 +90,11 @@ export function useSubscriptionUpgrade() {
9090
}
9191

9292
if (currentSubscriptionId) {
93+
logger.info('Transferring personal subscription to organization', {
94+
subscriptionId: currentSubscriptionId,
95+
organizationId: referenceId,
96+
})
97+
9398
const transferResponse = await fetch(
9499
`/api/users/me/subscription/${currentSubscriptionId}/transfer`,
95100
{
@@ -101,8 +106,18 @@ export function useSubscriptionUpgrade() {
101106

102107
if (!transferResponse.ok) {
103108
const text = await transferResponse.text()
109+
logger.error('Failed to transfer subscription to organization', {
110+
subscriptionId: currentSubscriptionId,
111+
organizationId: referenceId,
112+
error: text,
113+
})
104114
throw new Error(text || 'Failed to transfer subscription to organization')
105115
}
116+
117+
logger.info('Successfully transferred subscription to organization', {
118+
subscriptionId: currentSubscriptionId,
119+
organizationId: referenceId,
120+
})
106121
}
107122
} catch (error) {
108123
logger.error('Failed to create organization for team plan', error)

helm/sim/templates/NOTES.txt

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)