From 58cadeb3b929d593e6e2929179a3dbbc5621805a Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Wed, 5 Feb 2025 04:27:10 +0100 Subject: [PATCH] feat(frontend): Fix wordings for auto top-up feature (#9419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Changes Make the auto top-up wordings clearer: Screenshot 2025-02-05 at 1 38 16 AM Screenshot 2025-02-05 at 1 40 29 AM es 🏗️ ### Checklist 📋 #### For code changes: - [ ] I have clearly listed my changes in the PR description - [ ] I have made a test plan - [ ] I have tested my changes according to the test plan: - [ ] ...
Example test plan - [ ] Create from scratch and execute an agent with at least 3 blocks - [ ] Import an agent from file upload, and confirm it executes correctly - [ ] Upload agent to marketplace - [ ] Import an agent from marketplace and confirm it executes correctly - [ ] Edit an agent from monitor, and confirm it executes correctly
#### For configuration changes: - [ ] `.env.example` is updated or already compatible with my changes - [ ] `docker-compose.yml` is updated or already compatible with my changes - [ ] I have included a list of my configuration changes in the PR description (under **Changes**)
Examples of configuration changes - Changing ports - Adding new services that need to communicate with each other - Secrets or environment variable changes - New or infrastructure changes such as databases
--- .../backend/backend/server/routers/v1.py | 2 +- .../app/marketplace/(user)/credits/page.tsx | 73 ++++++++++++------- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/autogpt_platform/backend/backend/server/routers/v1.py b/autogpt_platform/backend/backend/server/routers/v1.py index 1d1aaf386..ebbad8eb0 100644 --- a/autogpt_platform/backend/backend/server/routers/v1.py +++ b/autogpt_platform/backend/backend/server/routers/v1.py @@ -177,7 +177,7 @@ async def configure_user_auto_top_up( ) -> str: if request.threshold < 0: raise ValueError("Threshold must be greater than 0") - if request.amount < 500: + if request.amount < 500 and request.amount != 0: raise ValueError("Amount must be greater than or equal to 500") if request.amount < request.threshold: raise ValueError("Amount must be greater than or equal to threshold") diff --git a/autogpt_platform/frontend/src/app/marketplace/(user)/credits/page.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/credits/page.tsx index 6cec26403..8500e458d 100644 --- a/autogpt_platform/frontend/src/app/marketplace/(user)/credits/page.tsx +++ b/autogpt_platform/frontend/src/app/marketplace/(user)/credits/page.tsx @@ -108,7 +108,7 @@ export default function CreditsPage() { htmlFor="topUpAmount" className="mb-1 block text-neutral-700" > - Top-up Amount (Credits, Minimum 500 = 5 USD) + Amount, minimum 500 credits = 5 USD: -

Auto Top-up Configuration

- -
- - -
+

Automatic Refill Settings

- +
+ + +
+ + {autoTopUpConfig?.amount ? ( + <> + + + + ) : ( + + )}