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

🪟 🎉 Display "Credits" in sidebar and add info when user is running out of credits #20595

Merged
merged 3 commits into from
Jan 3, 2023

Conversation

letiescanciano
Copy link
Contributor

Closes #19571

Demo: https://www.loom.com/share/ca43d6b72dcc42208add0bd91e1b1efc

What

  • Add "Credits" in credits sidebar menu button
  • Add Info boxes in <CreditsPage /> to inform users about low/zero balance

@letiescanciano letiescanciano requested a review from a team as a code owner December 16, 2022 18:59
@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Dec 16, 2022
@@ -21,7 +21,7 @@ export const InfoBox: React.FC<React.PropsWithChildren<Props>> = ({ children, cl
return (
<Box className={className}>
{icon && <FontAwesomeIcon size="lg" icon={icon} />}
<div>{children}</div>
Copy link
Contributor Author

@letiescanciano letiescanciano Dec 16, 2022

Choose a reason for hiding this comment

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

Shouldn't this be the responsibility of the children?
I remove it in order to be able to have full control on the children node.
I double check that it won't impact any other places where <InfoBox /> is used

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess the only reason might have been vertical alignment issues why this was here. But if it works in all places without it, no reason to keep it around.

Comment on lines +135 to +157
<Block>
<CreditView>
<FormattedMessage id="credits.remainingCredits" />
<Count>
<FormattedNumber value={cloudWorkspace.remainingCredits} />
</Count>
</CreditView>
<Actions>
<Button
disabled={!selfServiceCheckoutEnabled}
type="button"
size="xs"
onClick={startStripeCheckout}
isLoading={isLoading || isWaitingForCredits}
icon={<FontAwesomeIcon icon={faPlus} />}
>
<FormattedMessage id="credits.buyCredits" />
</Button>
<Button size="xs" onClick={() => window.open(links.contactSales, "_blank")}>
<FormattedMessage id="credits.talkToSales" />
</Button>
</Actions>
</Block>
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 snippet remains the same.

Comment on lines +89 to +91
{cloudWorkspace.remainingCredits <= LOW_BALANCE_CREDIT_TRESHOLD && (
<Indicator className={styles.lowBalanceIndicator} />
)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Show indicator only when credits <= 20

@letiescanciano letiescanciano force-pushed the leti/display-credits-in-sidebar branch from aaf1ddc to a9ce58b Compare December 27, 2022 16:55
Copy link
Contributor

@josephkmh josephkmh left a comment

Choose a reason for hiding this comment

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

Just a couple minor comments!

Copy link
Contributor

@josephkmh josephkmh 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!

@nataliekwong
Copy link
Contributor

@timroes It looks like the notification button (red or yellow) is no longer showing up in the lef-thand sidebar. Do you know if that was intentional?

@timroes
Copy link
Collaborator

timroes commented Apr 3, 2023

Yes that is indeed a bug in the current code, it's somehow mixed up checking for connector updates with the indicator for low credits. Could you maybe fill a new issue for this and cc Joey and Teal on it? This broke with https://github.com/airbytehq/airbyte-platform-internal/commit/b735183a0481675b1f07145bb7efc6b0ad2395db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform team/growth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display "Credits" in the left hand sidebar
5 participants