From ac6b244c71dfd9d92c425d7e51445ff269d7033b Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Tue, 7 Jan 2025 10:01:29 -0500 Subject: [PATCH] fix(editor): Update free AI credits success claim callout (no-changelog) (#12480) --- .../src/components/FreeAiCreditsCallout.test.ts | 12 +++++++++++- .../src/components/FreeAiCreditsCallout.vue | 15 ++++++++++----- .../editor-ui/src/plugins/i18n/locales/en.json | 3 ++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/editor-ui/src/components/FreeAiCreditsCallout.test.ts b/packages/editor-ui/src/components/FreeAiCreditsCallout.test.ts index 23c1495a30..dd459f5110 100644 --- a/packages/editor-ui/src/components/FreeAiCreditsCallout.test.ts +++ b/packages/editor-ui/src/components/FreeAiCreditsCallout.test.ts @@ -60,7 +60,17 @@ const assertUserCanClaimCredits = () => { }; const assertUserClaimedCredits = () => { - expect(screen.getByText('Claimed 100 free OpenAI API credits')).toBeInTheDocument(); + expect( + screen.getByText( + 'Claimed 100 free OpenAI API credits! Please note these free credits are only for the following models:', + ), + ).toBeInTheDocument(); + + expect( + screen.getByText( + 'gpt-4o-mini, text-embedding-3-small, dall-e-3, tts-1, whisper-1, and text-moderation-latest', + ), + ).toBeInTheDocument(); }; describe('FreeAiCreditsCallout', () => { diff --git a/packages/editor-ui/src/components/FreeAiCreditsCallout.vue b/packages/editor-ui/src/components/FreeAiCreditsCallout.vue index 9f2030679c..922df4cf89 100644 --- a/packages/editor-ui/src/components/FreeAiCreditsCallout.vue +++ b/packages/editor-ui/src/components/FreeAiCreditsCallout.vue @@ -112,11 +112,16 @@ const onClaimCreditsClicked = async () => { - {{ - i18n.baseText('freeAi.credits.callout.success.title', { - interpolate: { credits: settingsStore.aiCreditsQuota }, - }) - }} + + {{ + i18n.baseText('freeAi.credits.callout.success.title.part1', { + interpolate: { credits: settingsStore.aiCreditsQuota }, + }) + }}  + + {{ i18n.baseText('freeAi.credits.callout.success.title.part2') }} diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 017390398e..67dc315aa6 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -2844,7 +2844,8 @@ "testDefinition.deleteTest": "Delete Test", "freeAi.credits.callout.claim.title": "Get {credits} free OpenAI API credits", "freeAi.credits.callout.claim.button.label": "Claim credits", - "freeAi.credits.callout.success.title": "Claimed {credits} free OpenAI API credits", + "freeAi.credits.callout.success.title.part1": "Claimed {credits} free OpenAI API credits! Please note these free credits are only for the following models:", + "freeAi.credits.callout.success.title.part2": "gpt-4o-mini, text-embedding-3-small, dall-e-3, tts-1, whisper-1, and text-moderation-latest", "freeAi.credits.credentials.edit": "This is a managed credential and cannot be edited.", "freeAi.credits.showError.claim.title": "Free AI credits", "freeAi.credits.showError.claim.message": "Enable to claim credits"