Skip to content

Commit

Permalink
fix(editor): Update free AI credits success claim callout (no-changel…
Browse files Browse the repository at this point in the history
…og) (n8n-io#12480)
  • Loading branch information
RicardoE105 authored Jan 7, 2025
1 parent c03fe0a commit ac6b244
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
12 changes: 11 additions & 1 deletion packages/editor-ui/src/components/FreeAiCreditsCallout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
15 changes: 10 additions & 5 deletions packages/editor-ui/src/components/FreeAiCreditsCallout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,16 @@ const onClaimCreditsClicked = async () => {
</template>
</n8n-callout>
<n8n-callout v-else-if="showSuccessCallout" theme="success" icon="check-circle">
{{
i18n.baseText('freeAi.credits.callout.success.title', {
interpolate: { credits: settingsStore.aiCreditsQuota },
})
}}
<n8n-text>
{{
i18n.baseText('freeAi.credits.callout.success.title.part1', {
interpolate: { credits: settingsStore.aiCreditsQuota },
})
}}</n8n-text
>&nbsp;
<n8n-text :bold="true">
{{ i18n.baseText('freeAi.credits.callout.success.title.part2') }}</n8n-text
>
</n8n-callout>
</div>
</template>
3 changes: 2 additions & 1 deletion packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ac6b244

Please sign in to comment.