mirror of
https://github.com/bitwarden/web
synced 2025-12-18 09:13:17 +00:00
Add premium badge component (#1525)
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 744649573a...f7375e9064
19
src/app/components/premium-badge.component.ts
Normal file
19
src/app/components/premium-badge.component.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "app-premium-badge",
|
||||||
|
template: `
|
||||||
|
<a href="#" appStopClick *appNotPremium (click)="premiumRequired()">
|
||||||
|
<bit-badge type="success">{{ "premium" | i18n }}</bit-badge>
|
||||||
|
</a>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
export class PremiumBadgeComponent {
|
||||||
|
constructor(private messagingService: MessagingService) {}
|
||||||
|
|
||||||
|
premiumRequired() {
|
||||||
|
this.messagingService.send("premiumRequired");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,6 +53,7 @@ import localeZhTw from "@angular/common/locales/zh-Hant";
|
|||||||
import { NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||||
import { RouterModule } from "@angular/router";
|
import { RouterModule } from "@angular/router";
|
||||||
|
import { BadgeModule } from "@bitwarden/components";
|
||||||
import { InfiniteScrollModule } from "ngx-infinite-scroll";
|
import { InfiniteScrollModule } from "ngx-infinite-scroll";
|
||||||
import { ToastrModule } from "ngx-toastr";
|
import { ToastrModule } from "ngx-toastr";
|
||||||
|
|
||||||
@@ -70,6 +71,7 @@ import { BoxRowDirective } from "jslib-angular/directives/box-row.directive";
|
|||||||
import { FallbackSrcDirective } from "jslib-angular/directives/fallback-src.directive";
|
import { FallbackSrcDirective } from "jslib-angular/directives/fallback-src.directive";
|
||||||
import { InputStripSpacesDirective } from "jslib-angular/directives/input-strip-spaces.directive";
|
import { InputStripSpacesDirective } from "jslib-angular/directives/input-strip-spaces.directive";
|
||||||
import { InputVerbatimDirective } from "jslib-angular/directives/input-verbatim.directive";
|
import { InputVerbatimDirective } from "jslib-angular/directives/input-verbatim.directive";
|
||||||
|
import { NotPremiumDirective } from "jslib-angular/directives/not-premium.directive";
|
||||||
import { SelectCopyDirective } from "jslib-angular/directives/select-copy.directive";
|
import { SelectCopyDirective } from "jslib-angular/directives/select-copy.directive";
|
||||||
import { StopClickDirective } from "jslib-angular/directives/stop-click.directive";
|
import { StopClickDirective } from "jslib-angular/directives/stop-click.directive";
|
||||||
import { StopPropDirective } from "jslib-angular/directives/stop-prop.directive";
|
import { StopPropDirective } from "jslib-angular/directives/stop-prop.directive";
|
||||||
@@ -100,6 +102,7 @@ import { VerifyRecoverDeleteComponent } from "./accounts/verify-recover-delete.c
|
|||||||
import { NestedCheckboxComponent } from "./components/nested-checkbox.component";
|
import { NestedCheckboxComponent } from "./components/nested-checkbox.component";
|
||||||
import { PasswordRepromptComponent } from "./components/password-reprompt.component";
|
import { PasswordRepromptComponent } from "./components/password-reprompt.component";
|
||||||
import { PasswordStrengthComponent } from "./components/password-strength.component";
|
import { PasswordStrengthComponent } from "./components/password-strength.component";
|
||||||
|
import { PremiumBadgeComponent } from "./components/premium-badge.component";
|
||||||
import { FooterComponent } from "./layouts/footer.component";
|
import { FooterComponent } from "./layouts/footer.component";
|
||||||
import { FrontendLayoutComponent } from "./layouts/frontend-layout.component";
|
import { FrontendLayoutComponent } from "./layouts/frontend-layout.component";
|
||||||
import { NavbarComponent } from "./layouts/navbar.component";
|
import { NavbarComponent } from "./layouts/navbar.component";
|
||||||
@@ -292,10 +295,11 @@ registerLocaleData(localeZhTw, "zh-TW");
|
|||||||
ToastrModule,
|
ToastrModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
|
BadgeModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
A11yTitleDirective,
|
|
||||||
A11yInvalidDirective,
|
A11yInvalidDirective,
|
||||||
|
A11yTitleDirective,
|
||||||
AcceptEmergencyComponent,
|
AcceptEmergencyComponent,
|
||||||
AcceptOrganizationComponent,
|
AcceptOrganizationComponent,
|
||||||
AccessComponent,
|
AccessComponent,
|
||||||
@@ -364,6 +368,7 @@ registerLocaleData(localeZhTw, "zh-TW");
|
|||||||
MasterPasswordPolicyComponent,
|
MasterPasswordPolicyComponent,
|
||||||
NavbarComponent,
|
NavbarComponent,
|
||||||
NestedCheckboxComponent,
|
NestedCheckboxComponent,
|
||||||
|
NotPremiumDirective,
|
||||||
OptionsComponent,
|
OptionsComponent,
|
||||||
OrgAccountComponent,
|
OrgAccountComponent,
|
||||||
OrgAddEditComponent,
|
OrgAddEditComponent,
|
||||||
@@ -412,6 +417,7 @@ registerLocaleData(localeZhTw, "zh-TW");
|
|||||||
PasswordStrengthComponent,
|
PasswordStrengthComponent,
|
||||||
PaymentComponent,
|
PaymentComponent,
|
||||||
PersonalOwnershipPolicyComponent,
|
PersonalOwnershipPolicyComponent,
|
||||||
|
PremiumBadgeComponent,
|
||||||
PremiumComponent,
|
PremiumComponent,
|
||||||
ProfileComponent,
|
ProfileComponent,
|
||||||
ProvidersComponent,
|
ProvidersComponent,
|
||||||
@@ -456,8 +462,8 @@ registerLocaleData(localeZhTw, "zh-TW");
|
|||||||
UnsecuredWebsitesReportComponent,
|
UnsecuredWebsitesReportComponent,
|
||||||
UpdateKeyComponent,
|
UpdateKeyComponent,
|
||||||
UpdateLicenseComponent,
|
UpdateLicenseComponent,
|
||||||
UpdateTempPasswordComponent,
|
|
||||||
UpdatePasswordComponent,
|
UpdatePasswordComponent,
|
||||||
|
UpdateTempPasswordComponent,
|
||||||
UserBillingComponent,
|
UserBillingComponent,
|
||||||
UserLayoutComponent,
|
UserLayoutComponent,
|
||||||
UserNamePipe,
|
UserNamePipe,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
>
|
>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h2 class="modal-title" id="userAddEditTitle">
|
<h2 class="modal-title" id="userAddEditTitle">
|
||||||
<span class="badge badge-primary" *ngIf="readOnly">{{ "premium" | i18n }}</span>
|
<app-premium-badge *ngIf="readOnly"></app-premium-badge>
|
||||||
{{ title }}
|
{{ title }}
|
||||||
<small class="text-muted" *ngIf="name">{{ name }}</small>
|
<small class="text-muted" *ngIf="name">{{ name }}</small>
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -15,15 +15,7 @@
|
|||||||
<div class="page-header d-flex">
|
<div class="page-header d-flex">
|
||||||
<h2>
|
<h2>
|
||||||
{{ "trustedEmergencyContacts" | i18n }}
|
{{ "trustedEmergencyContacts" | i18n }}
|
||||||
<a
|
<app-premium-badge></app-premium-badge>
|
||||||
href="#"
|
|
||||||
appStopClick
|
|
||||||
class="badge badge-primary"
|
|
||||||
*ngIf="!canAccessPremium"
|
|
||||||
(click)="premiumRequired()"
|
|
||||||
>
|
|
||||||
{{ "premium" | i18n }}
|
|
||||||
</a>
|
|
||||||
</h2>
|
</h2>
|
||||||
<div class="ml-auto d-flex">
|
<div class="ml-auto d-flex">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -39,15 +39,7 @@
|
|||||||
></i>
|
></i>
|
||||||
<span class="sr-only">{{ "enabled" | i18n }}</span>
|
<span class="sr-only">{{ "enabled" | i18n }}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<a
|
<app-premium-badge *ngIf="p.premium"></app-premium-badge>
|
||||||
href="#"
|
|
||||||
appStopClick
|
|
||||||
class="badge badge-primary"
|
|
||||||
*ngIf="!canAccessPremium && p.premium"
|
|
||||||
(click)="premiumRequired()"
|
|
||||||
>
|
|
||||||
{{ "premium" | i18n }}
|
|
||||||
</a>
|
|
||||||
</h3>
|
</h3>
|
||||||
{{ p.description }}
|
{{ p.description }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,15 +19,7 @@
|
|||||||
<div class="card-header d-flex">
|
<div class="card-header d-flex">
|
||||||
{{ "reports" | i18n }}
|
{{ "reports" | i18n }}
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
<a
|
<app-premium-badge></app-premium-badge>
|
||||||
href="#"
|
|
||||||
appStopClick
|
|
||||||
class="badge badge-primary"
|
|
||||||
*ngIf="!canAccessPremium"
|
|
||||||
(click)="premiumRequired()"
|
|
||||||
>
|
|
||||||
{{ "premium" | i18n }}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-group list-group-flush">
|
<div class="list-group list-group-flush">
|
||||||
|
|||||||
@@ -187,15 +187,10 @@
|
|||||||
title="{{ 'verificationCodeTotp' | i18n }}"
|
title="{{ 'verificationCodeTotp' | i18n }}"
|
||||||
class="ml-2"
|
class="ml-2"
|
||||||
/>
|
/>
|
||||||
<a
|
<app-premium-badge
|
||||||
href="#"
|
*ngIf="!organization && !cipher.organizationId"
|
||||||
appStopClick
|
class="ml-3"
|
||||||
class="badge badge-primary ml-3"
|
></app-premium-badge>
|
||||||
(click)="premiumRequired()"
|
|
||||||
*ngIf="!organization && !cipher.organizationId && !canAccessPremium"
|
|
||||||
>
|
|
||||||
{{ "premium" | i18n }}
|
|
||||||
</a>
|
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
appStopClick
|
appStopClick
|
||||||
|
|||||||
Reference in New Issue
Block a user