mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
fix(cloud-setup): no 'contact us' in the capability body when [Contact us] is hidden (CAP-GATE-DESKTOP)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { Translate } from '@/i18n/use-translate'
|
||||
import { currentStepCopy } from './cloud-setup-page-copy'
|
||||
|
||||
const t: Translate = (_key, fallback) => fallback
|
||||
|
||||
describe('CAP-GATE-DESKTOP copy', () => {
|
||||
const current = { id: 'plan', state: 'needed', need: 'capability' } as const
|
||||
|
||||
it('offers "contact us" only when [Contact us] is shown', () => {
|
||||
const withLink = currentStepCopy(
|
||||
{ current, action: 'capability-off', contactUrl: 'https://onorca.dev/contact-sales' },
|
||||
t
|
||||
)
|
||||
expect(withLink.title).toBe('Orca Cloud isn’t turned on for your team yet')
|
||||
expect(withLink.lead).toBe(
|
||||
'Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes, or contact us and we’ll turn it on.'
|
||||
)
|
||||
})
|
||||
|
||||
it('drops "contact us" when the catalog has no contact URL', () => {
|
||||
const withoutLink = currentStepCopy({ current, action: 'capability-off', contactUrl: null }, t)
|
||||
expect(withoutLink.lead).toBe(
|
||||
'Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes.'
|
||||
)
|
||||
expect(withoutLink.lead).not.toMatch(/contact/i)
|
||||
})
|
||||
})
|
||||
@@ -34,7 +34,7 @@ function trialHours(step: CloudSetupStep): string | null {
|
||||
}
|
||||
|
||||
export function currentStepCopy(
|
||||
flow: Pick<CloudSetupPageModel, 'current' | 'action'>,
|
||||
flow: Pick<CloudSetupPageModel, 'current' | 'action'> & { contactUrl?: string | null },
|
||||
t: Translate
|
||||
): StepCopy {
|
||||
const step = flow.current
|
||||
@@ -143,10 +143,16 @@ export function currentStepCopy(
|
||||
case 'capability-off':
|
||||
return {
|
||||
title: t('cloudSetupPage.capability.title', 'Orca Cloud isn’t turned on for your team yet'),
|
||||
lead: t(
|
||||
'cloudSetupPage.capability.lead',
|
||||
'Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes, or contact us and we’ll turn it on.'
|
||||
)
|
||||
// Only offer "contact us" when [Contact us] is shown (a catalog contact URL exists).
|
||||
lead: flow.contactUrl
|
||||
? t(
|
||||
'cloudSetupPage.capability.lead',
|
||||
'Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes, or contact us and we’ll turn it on.'
|
||||
)
|
||||
: t(
|
||||
'cloudSetupPage.capability.leadNoContact',
|
||||
'Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes.'
|
||||
)
|
||||
}
|
||||
case 'ask-owner':
|
||||
return {
|
||||
|
||||
@@ -28987,7 +28987,8 @@
|
||||
"tryAgain": "Try again",
|
||||
"contact": "Contact us",
|
||||
"title": "Orca Cloud isn’t turned on for your team yet",
|
||||
"lead": "Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes, or contact us and we’ll turn it on."
|
||||
"lead": "Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes, or contact us and we’ll turn it on.",
|
||||
"leadNoContact": "Your team has a plan, but Orca Cloud isn’t turned on for it yet. Try again in a few minutes."
|
||||
}
|
||||
},
|
||||
"orcaCloudSignInSheet": {
|
||||
|
||||
Reference in New Issue
Block a user