Add overdue invoices check (#31290)
- Rename current_user_account_too_young to account_too_young for consistency - Add has_overdue_invoices field to track billing status - Block edit predictions when user has overdue invoices - Add overdue invoice warning to inline completion menu Release Notes: - N/A --------- Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
parent
cb112a4012
commit
ca72efe701
7 changed files with 65 additions and 7 deletions
|
@ -745,7 +745,7 @@ impl InlineCompletionButton {
|
|||
})
|
||||
})
|
||||
.separator();
|
||||
} else if self.user_store.read(cx).current_user_account_too_young() {
|
||||
} else if self.user_store.read(cx).account_too_young() {
|
||||
menu = menu
|
||||
.custom_entry(
|
||||
|_window, _cx| {
|
||||
|
@ -785,6 +785,46 @@ impl InlineCompletionButton {
|
|||
},
|
||||
)
|
||||
.separator();
|
||||
} else if self.user_store.read(cx).has_overdue_invoices() {
|
||||
menu = menu
|
||||
.custom_entry(
|
||||
|_window, _cx| {
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::Warning)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Warning),
|
||||
)
|
||||
.child(
|
||||
Label::new("You have an outstanding invoice")
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Warning),
|
||||
)
|
||||
.into_any_element()
|
||||
},
|
||||
|window, cx| {
|
||||
window.dispatch_action(
|
||||
Box::new(OpenZedUrl {
|
||||
url: zed_urls::account_url(cx),
|
||||
}),
|
||||
cx,
|
||||
);
|
||||
},
|
||||
)
|
||||
.entry(
|
||||
"Check your payment status or contact us at billing-support@zed.dev to continue using this feature.",
|
||||
None,
|
||||
|window, cx| {
|
||||
window.dispatch_action(
|
||||
Box::new(OpenZedUrl {
|
||||
url: zed_urls::account_url(cx),
|
||||
}),
|
||||
cx,
|
||||
);
|
||||
},
|
||||
)
|
||||
.separator();
|
||||
}
|
||||
|
||||
self.build_language_settings_menu(menu, window, cx).when(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue