Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editor): Add free AI credits CTA #12365

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented Dec 24, 2024

Summary

Builds on top of #12363

Demo: https://share.cleanshot.com/gcK464Kn

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-2994/[n8n-fe]-add-cta-to-generate-the-credits-in-the-users-instance

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@RicardoE105 RicardoE105 changed the base branch from master to expose-license-feature-flags-to-frontend December 24, 2024 20:30
@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Dec 24, 2024
@RicardoE105 RicardoE105 changed the title ado 2994 n8n fe add cta to generate the credits in the users instance v2 feat(editor) Add free AI credits CTA Dec 24, 2024
@RicardoE105 RicardoE105 changed the title feat(editor) Add free AI credits CTA feat(editor): Add free AI credits CTA Dec 24, 2024
@@ -1061,7 +1070,9 @@ function resetCredentialData(): void {
<InlineNameEdit
:model-value="credentialName"
:subtitle="credentialType ? credentialType.displayName : ''"
:readonly="!credentialPermissions.update || !credentialType"
:readonly="
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents users from editing the credential name

@@ -597,6 +602,10 @@ function scrollToBottom() {
}

async function retestCredential() {
if (isEditingManagedCredential.value) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not send the request as there is nothing to test on managed credentials

@@ -235,7 +236,10 @@ watch(showOAuthSuccessBanner, (newValue, oldValue) => {
</script>

<template>
<div>
<n8n-callout v-if="isManaged" theme="warning" icon="exclamation-triangle">
Copy link
Contributor Author

@RicardoE105 RicardoE105 Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent user from seeing the credential values

Copy link

codecov bot commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 84.74576% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...i/src/components/CredentialEdit/CredentialEdit.vue 33.33% 6 Missing ⚠️
.../editor-ui/src/components/FreeAiCreditsCallout.vue 93.54% 6 Missing ⚠️
packages/editor-ui/src/stores/credentials.store.ts 33.33% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RicardoE105 RicardoE105 requested a review from mutdmour December 24, 2024 23:42
Copy link
Contributor

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. A few small comments.

beforeEach(() => {
vi.clearAllMocks();

(useSettingsStore as any).mockReturnValue({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be type-safer to avoid using any here. You can find other examples of places where we have mocked the settings store, for example here packages/editor-ui/src/composables/useDebugInfo.test.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address in a follow up PR

packages/editor-ui/src/components/FreeAiCreditsCallout.vue Outdated Show resolved Hide resolved
@RicardoE105 RicardoE105 force-pushed the expose-license-feature-flags-to-frontend branch from 7f40bd3 to fdbc530 Compare December 27, 2024 14:53
Base automatically changed from expose-license-feature-flags-to-frontend to master December 27, 2024 15:23
@RicardoE105 RicardoE105 force-pushed the ado-2994-n8n-fe-add-cta-to-generate-the-credits-in-the-users-instance-v2 branch from 145007d to e38df6f Compare December 27, 2024 15:25
@RicardoE105 RicardoE105 requested a review from mutdmour December 27, 2024 15:36
Copy link

cypress bot commented Dec 27, 2024

n8n    Run #8491

Run Properties:  status check passed Passed #8491  •  git commit 870f8640c7: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Project n8n
Branch Review master
Run status status check passed Passed #8491
Run duration 04m 42s
Commit git commit 870f8640c7: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 484
View all changes introduced in this branch ↗︎

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

1 similar comment
Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

@RicardoE105 RicardoE105 requested a review from mutdmour December 27, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants