Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,12 @@ export function useChildDeployment(childWorkflowId: string | undefined): UseChil
try {
setIsLoading(true)

// Fetch both deployment versions and workflow metadata in parallel
const [deploymentsRes, workflowRes] = await Promise.all([
fetch(`/api/workflows/${wfId}/deployments`, {
cache: 'no-store',
headers: { 'Cache-Control': 'no-cache' },
}),
fetch(`/api/workflows/${wfId}`, {
cache: 'no-store',
headers: { 'Cache-Control': 'no-cache' },
}),
])
const statusRes = await fetch(`/api/workflows/${wfId}/status`, {
cache: 'no-store',
headers: { 'Cache-Control': 'no-cache' },
})

if (!deploymentsRes.ok || !workflowRes.ok) {
if (!statusRes.ok) {
if (!cancelled) {
setActiveVersion(null)
setIsDeployed(null)
Expand All @@ -56,32 +49,30 @@ export function useChildDeployment(childWorkflowId: string | undefined): UseChil
return
}

const deploymentsJson = await deploymentsRes.json()
const workflowJson = await workflowRes.json()
const statusData = await statusRes.json()

const versions = Array.isArray(deploymentsJson?.data?.versions)
? deploymentsJson.data.versions
: Array.isArray(deploymentsJson?.versions)
? deploymentsJson.versions
: []
const deploymentsRes = await fetch(`/api/workflows/${wfId}/deployments`, {
cache: 'no-store',
headers: { 'Cache-Control': 'no-cache' },
})

const active = versions.find((v: any) => v.isActive)
const workflowUpdatedAt = workflowJson?.data?.updatedAt || workflowJson?.updatedAt
let activeVersion = null
if (deploymentsRes.ok) {
const deploymentsJson = await deploymentsRes.json()
const versions = Array.isArray(deploymentsJson?.data?.versions)
? deploymentsJson.data.versions
: Array.isArray(deploymentsJson?.versions)
? deploymentsJson.versions
: []

if (!cancelled) {
const v = active ? Number(active.version) : null
const deployed = v != null
setActiveVersion(v)
setIsDeployed(deployed)
const active = versions.find((v: any) => v.isActive)
activeVersion = active ? Number(active.version) : null
}

// Check if workflow has been updated since deployment
if (deployed && active?.createdAt && workflowUpdatedAt) {
const deploymentTime = new Date(active.createdAt).getTime()
const updateTime = new Date(workflowUpdatedAt).getTime()
setNeedsRedeploy(updateTime > deploymentTime)
} else {
setNeedsRedeploy(false)
}
if (!cancelled) {
setActiveVersion(activeVersion)
setIsDeployed(statusData.isDeployed || false)
setNeedsRedeploy(statusData.needsRedeployment || false)
}
} catch {
if (!cancelled) {
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/components/emails/base-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const baseStyles = {
},
button: {
display: 'inline-block',
backgroundColor: '#802FFF',
backgroundColor: '#6F3DFA',
color: '#ffffff',
fontWeight: 'bold',
fontSize: '16px',
Expand All @@ -42,7 +42,7 @@ export const baseStyles = {
margin: '20px 0',
},
link: {
color: '#802FFF',
color: '#6F3DFA',
textDecoration: 'underline',
},
footer: {
Expand Down Expand Up @@ -79,7 +79,7 @@ export const baseStyles = {
width: '249px',
},
sectionCenter: {
borderBottom: '1px solid #802FFF',
borderBottom: '1px solid #6F3DFA',
width: '102px',
},
}
4 changes: 2 additions & 2 deletions apps/sim/components/emails/careers-confirmation-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ export const CareersConfirmationEmail = ({
href='https://docs.sim.ai'
target='_blank'
rel='noopener noreferrer'
style={{ color: '#802FFF', textDecoration: 'none' }}
style={{ color: '#6F3DFA', textDecoration: 'none' }}
>
documentation
</a>{' '}
to learn more about what we're building, or check out our{' '}
<a href={`${baseUrl}/studio`} style={{ color: '#802FFF', textDecoration: 'none' }}>
<a href={`${baseUrl}/studio`} style={{ color: '#6F3DFA', textDecoration: 'none' }}>
blog
</a>{' '}
for the latest updates.
Expand Down
8 changes: 4 additions & 4 deletions apps/sim/components/emails/careers-submission-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const CareersSubmissionEmail = ({
<td style={{ padding: '8px 0', fontSize: '14px', color: '#333333' }}>
<a
href={`mailto:${email}`}
style={{ color: '#802FFF', textDecoration: 'none' }}
style={{ color: '#6F3DFA', textDecoration: 'none' }}
>
{email}
</a>
Expand All @@ -163,7 +163,7 @@ export const CareersSubmissionEmail = ({
Phone:
</td>
<td style={{ padding: '8px 0', fontSize: '14px', color: '#333333' }}>
<a href={`tel:${phone}`} style={{ color: '#802FFF', textDecoration: 'none' }}>
<a href={`tel:${phone}`} style={{ color: '#6F3DFA', textDecoration: 'none' }}>
{phone}
</a>
</td>
Expand Down Expand Up @@ -231,7 +231,7 @@ export const CareersSubmissionEmail = ({
href={linkedin}
target='_blank'
rel='noopener noreferrer'
style={{ color: '#802FFF', textDecoration: 'none' }}
style={{ color: '#6F3DFA', textDecoration: 'none' }}
>
View Profile
</a>
Expand All @@ -255,7 +255,7 @@ export const CareersSubmissionEmail = ({
href={portfolio}
target='_blank'
rel='noopener noreferrer'
style={{ color: '#802FFF', textDecoration: 'none' }}
style={{ color: '#6F3DFA', textDecoration: 'none' }}
>
View Portfolio
</a>
Expand Down