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: Anticipated Price #3357

Merged
merged 4 commits into from Jun 16, 2023
Merged

feat: Anticipated Price #3357

merged 4 commits into from Jun 16, 2023

Conversation

c121914yu
Copy link
Collaborator

@c121914yu c121914yu commented Jun 14, 2023

🤖 Generated by Copilot at 0517b2a

Summary

💰🌐🐛

This pull request adds a new feature to the application launchpad frontend and backend that allows users to see the estimated cost of the app resources based on their subscription plan and the source price. It also fixes some bugs and improves the UI and localization of some components. The main files involved are resourcePrice.ts, PriceBox.tsx, Form.tsx, and static.ts.

Sing, O Muse, of the skillful pull request
That brought to the launchpad a wondrous feature
To show the mortal users the price of their apps
And the resources they consume in the cloud.

Walkthrough

  • Implement the feature of displaying the estimated cost of the application resources in the frontend and backend (link, link, link, link, link, link, link, link)
  • Add the resourcePrice API in the platform.ts and resourcePrice.ts files to calculate the price of the application resources based on the user's price query CRD and the source price CRD (link, link)
  • Add the getUserPrice function in the static.ts and _app.tsx files to fetch the user's price from the backend when the application is loaded and retry in case of failure (link, link)
  • Add the PriceBox component in the PriceBox.tsx and Form.tsx files to display the estimated cost of the application resources based on the user's price and the source price (link, link, link)
  • Add the type declaration for the resourcePriceResponse and the initial value for the SOURCE_PRICE variable in the static.ts file to store and access the user's price and the source price (link)
  • Fix the localization issues in the frontend labels and texts (link, link, link, link, link, link, link, link, link, link)
    • Change the labels for the deployment mode, network configuration, basic configuration, CPU value, and memory value fields to match the backend terminology, make them shorter and consistent with other labels, and remove the redundant ones (link, link, link, link, link)
    • Add the labels for the total price, day, and anticipated price fields to the common.json files in English and Chinese to support the new feature of displaying the estimated cost of the application resources (link, link)
    • Change the text for the "未开启" label in the AppMainInfo component from Chinese to English ("Not Enabled") to fix a localization issue (link)
    • Change the text for the title of the ConfigmapModal component from "添加ConfigMap" and "修改ConfigMap" to "Add" and "Update" to make it shorter and consistent with other modals (link)
    • Wrap the text for the title of the ConfigmapModal component with the t function to enable localization based on the user's language preference (link)
  • Fix the logic and linting errors in the ConfigmapModal component (link, link)
    • Remove the import statement for the FormErrorMessage component as it was unused and caused a linting error (link)
    • Fix the logic for the type variable to correctly determine whether the modal is for creating or editing a configmap based on the defaultValue prop (link)
  • Change the order of the getServiceEnv and getUserPrice functions in the useEffect hook of the App component to ensure that the user's price is fetched before the service environment is set (link)

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Jun 14, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 637
✅ Successful 302
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 334
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b8efed9) 72.97% compared to head (fcac3ea) 72.97%.

❗ Current head fcac3ea differs from pull request most recent head 2930e00. Consider uploading reports for the commit 2930e00 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3357   +/-   ##
=======================================
  Coverage   72.97%   72.97%           
=======================================
  Files           8        8           
  Lines         618      618           
=======================================
  Hits          451      451           
  Misses        132      132           
  Partials       35       35           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 21 to 22
"Application Type": "Application Type",
"Basic Information": "Basic Information",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Type
Basic

@c121914yu c121914yu force-pushed the dev-yjl branch 2 times, most recently from b01da67 to a141328 Compare June 15, 2023 03:58
@zzjin zzjin merged commit 796bbeb into labring:main Jun 16, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants