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: show failed payment banner and block the workspace integration #6560

Merged
merged 10 commits into from
Dec 2, 2024

Conversation

vikrantgupta25
Copy link
Collaborator

@vikrantgupta25 vikrantgupta25 commented Nov 29, 2024

Summary

  • added a new endpoint for query service to serve the active license rather than frontend writing searches on arrays to find the same -> v3/licenses/active
  • added AppContext to only fetch the required details once rather than fetching them multiple times across multiple components. the AppContext will be later used to migrate everything from store.
  • added a new route workspace-suspended to handle all the suspensions based on events. the current route is not made scalable.
  • when the event queue contains the FAILED_PAYMENT event then show the warning banner.
  • when the status of license is SUSPENDED and state is PAYMENT_FAILED then suspend the workspace

Related Issues / PR's

image

image

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Introduces a new feature to handle failed payments by adding an endpoint, context, and UI components, including a new route for workspace suspension.

  • Behavior:
    • New endpoint v3/licenses/active in api.go to fetch active license.
    • Added AppContext to fetch required details once, reducing multiple fetches.
    • New route workspace-suspended for handling workspace suspensions.
  • Frontend:
    • Added WorkspaceSuspended component in WorkspaceSuspended.tsx with styles in WorkspaceSuspended.styles.scss.
    • Updated AppLayout to show payment failed banner and handle billing.
    • Added translations for failed payment messages in failedPayment.json.
  • API:
    • Added getActiveLicenseV3 function in license.go to fetch active license data.
    • Created getActive function in getActive.ts to call the new API endpoint.
  • Routes and Context:
    • Updated routes.ts and pageComponents.ts to include WorkspaceSuspended.
    • Added useActiveLicenseV3 hook and AppProvider for context management.

This description was created by Ellipsis for 016f6ba. It will automatically update as commits are pushed.

@vikrantgupta25
Copy link
Collaborator Author

contributes to - https://github.com/SigNoz/platform-pod/issues/306

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added docs required enhancement New feature or request labels Nov 29, 2024
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@vikrantgupta25 vikrantgupta25 force-pushed the frontend-ui-block-failed-payment branch from 916698d to 6e1064c Compare November 30, 2024 16:41
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@vikrantgupta25 vikrantgupta25 marked this pull request as ready for review November 30, 2024 19:40
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 69654ac in 1 minute and 44 seconds

More details
  • Looked at 1066 lines of code in 22 files
  • Skipped 1 files when reviewing.
  • Skipped posting 10 drafted comments based on config settings.
1. ee/query-service/app/api/license.go:139
  • Draft comment:
    Ensure activeLicense is not nil before accessing activeLicense.Data to avoid potential nil pointer dereference.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. frontend/src/AppRoutes/Private.tsx:256
  • Draft comment:
    The navigateToWorkSpaceSuspended function is defined but not used. Consider using it or removing it if unnecessary.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. frontend/src/container/AppLayout/index.tsx:280
  • Draft comment:
    The handleFailedPayment function is defined but not used. Consider using it or removing it if unnecessary.
  • Reason this comment was not posted:
    Marked as duplicate.
4. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx:55
  • Draft comment:
    The handleUpdateCreditCard function is defined but not used. Consider using it or removing it if unnecessary.
  • Reason this comment was not posted:
    Marked as duplicate.
5. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:114
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.
6. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:126
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.
7. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:139
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.
8. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:140
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.
9. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:141
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.
10. frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.styles.scss:142
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_JowE0fPad1UXSCTN


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@YounixM
Copy link
Member

YounixM commented Dec 2, 2024

  • 1. Create a ticket to show timezone in workspace locked message.
  • 2. Create a ticket to show timezone in workspace suspended message.
  • 3. Add Error Boundary for the AppContext

Copy link

github-actions bot commented Dec 2, 2024

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 8405bdd in 55 seconds

More details
  • Looked at 129 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. frontend/src/utils/timeUtils.ts:26
  • Draft comment:
    // Format the date as "18 Nov 2013 HH:mm"
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/src/container/AppLayout/index.tsx:360
  • Draft comment:
    Ensure getFormattedDateWithMinutes is correctly formatting the date and time as expected. This function is used in multiple places, including here and in WorkspaceSuspended.tsx.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. frontend/src/container/AppLayout/index.tsx:357
  • Draft comment:
    Avoid using inline styles. Consider using CSS classes or styled components instead.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.
4. frontend/src/container/AppLayout/index.tsx:379
  • Draft comment:
    Avoid using inline styles. Consider using CSS classes or styled components instead.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_6oEoRTDCvE4ScHiD


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

frontend/src/api/licensesV3/getActive.ts Show resolved Hide resolved
YounixM
YounixM previously approved these changes Dec 2, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 016f6ba in 14 seconds

More details
  • Looked at 25 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/public/locales/en-GB/titles.json:40
  • Draft comment:
    Ensure that the order of keys in this file matches the order in en/titles.json for consistency and easier maintenance.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of the "WORKSPACE_SUSPENDED" key is consistent across both files, which is correct. However, the order of keys is slightly different between the two files, which might lead to confusion or maintenance issues in the future.
2. frontend/public/locales/en-GB/titles.json:40
  • Draft comment:
    Ensure that the addition of "WORKSPACE_SUSPENDED" is used consistently across the application where needed.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The addition of the "WORKSPACE_SUSPENDED" title in both files is consistent and follows the existing pattern.

Workflow ID: wflow_9oZE1E57ddQnNsoU


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

github-actions bot commented Dec 2, 2024

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@vikrantgupta25 vikrantgupta25 merged commit 6384b25 into develop Dec 2, 2024
13 of 15 checks passed
@vikrantgupta25 vikrantgupta25 deleted the frontend-ui-block-failed-payment branch December 2, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs not required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants