mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[PM-25879][PM-25881] - [Defect] Premium badges missing reusable component (#16461)
* clean up premium badge component
* add provider to desktop settings
* rename prop.
* add provider to send component
* fix storybook
* fix test
* move dependency to new send dropdown component
* Revert "move dependency to new send dropdown component"
This reverts commit f134526279.
* remove hasPremium
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Component, input, output } from "@angular/core";
|
||||
import { Component, input } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstractions/premium-upgrade-prompt.service";
|
||||
import { BadgeModule } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
@@ -15,17 +15,11 @@ import { BadgeModule } from "@bitwarden/components";
|
||||
imports: [BadgeModule, JslibModule],
|
||||
})
|
||||
export class PremiumBadgeComponent {
|
||||
/** Skip sending the premiumRequired message (default: false). */
|
||||
skipMessaging = input(false);
|
||||
onClick = output();
|
||||
organizationId = input<string>();
|
||||
|
||||
constructor(private messagingService: MessagingService) {}
|
||||
constructor(private premiumUpgradePromptService: PremiumUpgradePromptService) {}
|
||||
|
||||
async promptForPremium() {
|
||||
this.onClick.emit();
|
||||
if (this.skipMessaging()) {
|
||||
return;
|
||||
}
|
||||
this.messagingService.send("premiumRequired");
|
||||
await this.premiumUpgradePromptService.promptForPremium(this.organizationId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user