Skip to content

Commit

Permalink
Merge branch 'main' into renovate/eslint-plugin-tailwindcss-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton authored Jan 20, 2025
2 parents ebecbbe + c6a3055 commit 1b61b0f
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 40 deletions.
8 changes: 4 additions & 4 deletions libs/angular/src/jslib.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import {
TableModule,
ToastModule,
TypographyModule,
CopyClickDirective,
A11yTitleDirective,
} from "@bitwarden/components";

import { TwoFactorIconComponent } from "./auth/components/two-factor-icon.component";
import { DeprecatedCalloutComponent } from "./components/callout.component";
import { A11yInvalidDirective } from "./directives/a11y-invalid.directive";
import { A11yTitleDirective } from "./directives/a11y-title.directive";
import { ApiActionDirective } from "./directives/api-action.directive";
import { BoxRowDirective } from "./directives/box-row.directive";
import { CopyClickDirective } from "./directives/copy-click.directive";
import { CopyTextDirective } from "./directives/copy-text.directive";
import { FallbackSrcDirective } from "./directives/fallback-src.directive";
import { IfFeatureDirective } from "./directives/if-feature.directive";
Expand Down Expand Up @@ -83,10 +83,11 @@ import { IconComponent } from "./vault/components/icon.component";
LinkModule,
IconModule,
TextDragDirective,
CopyClickDirective,
A11yTitleDirective,
],
declarations: [
A11yInvalidDirective,
A11yTitleDirective,
ApiActionDirective,
AutofocusDirective,
BoxRowDirective,
Expand All @@ -105,7 +106,6 @@ import { IconComponent } from "./vault/components/icon.component";
StopClickDirective,
StopPropDirective,
TrueFalseValueDirective,
CopyClickDirective,
LaunchClickDirective,
UserNamePipe,
PasswordStrengthComponent,
Expand Down
2 changes: 0 additions & 2 deletions libs/common/src/abstractions/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ import { PaymentResponse } from "../billing/models/response/payment.response";
import { PlanResponse } from "../billing/models/response/plan.response";
import { SubscriptionResponse } from "../billing/models/response/subscription.response";
import { TaxInfoResponse } from "../billing/models/response/tax-info.response";
import { TaxRateResponse } from "../billing/models/response/tax-rate.response";
import { DeleteRecoverRequest } from "../models/request/delete-recover.request";
import { EventRequest } from "../models/request/event.request";
import { KdfRequest } from "../models/request/kdf.request";
Expand Down Expand Up @@ -376,7 +375,6 @@ export abstract class ApiService {
): Promise<OrganizationConnectionResponse<TConfig>>;
deleteOrganizationConnection: (id: string) => Promise<void>;
getPlans: () => Promise<ListResponse<PlanResponse>>;
getTaxRates: () => Promise<ListResponse<TaxRateResponse>>;

getProviderUsers: (providerId: string) => Promise<ListResponse<ProviderUserUserDetailsResponse>>;
getProviderUser: (providerId: string, id: string) => Promise<ProviderUserResponse>;
Expand Down
18 changes: 0 additions & 18 deletions libs/common/src/billing/models/response/tax-rate.response.ts

This file was deleted.

6 changes: 0 additions & 6 deletions libs/common/src/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import { PaymentResponse } from "../billing/models/response/payment.response";
import { PlanResponse } from "../billing/models/response/plan.response";
import { SubscriptionResponse } from "../billing/models/response/subscription.response";
import { TaxInfoResponse } from "../billing/models/response/tax-info.response";
import { TaxRateResponse } from "../billing/models/response/tax-rate.response";
import { DeviceType } from "../enums";
import { VaultTimeoutAction } from "../enums/vault-timeout-action.enum";
import { CollectionBulkDeleteRequest } from "../models/request/collection-bulk-delete.request";
Expand Down Expand Up @@ -897,11 +896,6 @@ export class ApiService implements ApiServiceAbstraction {
return new ListResponse(r, PlanResponse);
}

async getTaxRates(): Promise<ListResponse<TaxRateResponse>> {
const r = await this.send("GET", "/plans/sales-tax-rates/", null, true, true);
return new ListResponse(r, TaxRateResponse);
}

// Settings APIs

async getSettingsDomains(): Promise<DomainsResponse> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Directive, ElementRef, Input, OnInit, Renderer2 } from "@angular/core";

@Directive({
selector: "[appA11yTitle]",
standalone: true,
})
export class A11yTitleDirective implements OnInit {
@Input() set appA11yTitle(title: string) {
Expand Down
1 change: 1 addition & 0 deletions libs/components/src/a11y/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./a11y-title.directive";
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing";

import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { ToastService } from "@bitwarden/components";

import { ToastService } from "../";

import { CopyClickDirective } from "./copy-click.directive";

Expand All @@ -20,12 +21,14 @@ import { CopyClickDirective } from "./copy-click.directive";
#toastWithLabel
></button>
`,
standalone: true,
imports: [CopyClickDirective],
})
class TestCopyClickComponent {
@ViewChild("noToast") noToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("infoToast") infoToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("successToast") successToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("toastWithLabel") toastWithLabelButton: ElementRef<HTMLButtonElement>;
@ViewChild("noToast") noToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("infoToast") infoToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("successToast") successToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("toastWithLabel") toastWithLabelButton!: ElementRef<HTMLButtonElement>;
}

describe("CopyClickDirective", () => {
Expand All @@ -38,7 +41,7 @@ describe("CopyClickDirective", () => {
showToast.mockClear();

await TestBed.configureTestingModule({
declarations: [CopyClickDirective, TestCopyClickComponent],
imports: [TestCopyClickComponent],
providers: [
{
provide: I18nService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { Directive, HostListener, Input } from "@angular/core";

import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { ToastService, ToastVariant } from "@bitwarden/components";

import { ToastService, ToastVariant } from "../";

@Directive({
selector: "[appCopyClick]",
standalone: true,
})
export class CopyClickDirective {
private _showToast = false;
Expand Down
1 change: 1 addition & 0 deletions libs/components/src/copy-click/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./copy-click.directive";
4 changes: 3 additions & 1 deletion libs/components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
export { ButtonType } from "./shared/button-like.abstraction";
export * from "./a11y";
export * from "./async-actions";
export * from "./avatar";
export * from "./badge-list";
export * from "./badge";
export * from "./banner";
export * from "./breadcrumbs";
export * from "./button";
export { ButtonType } from "./shared/button-like.abstraction";
export * from "./callout";
export * from "./card";
export * from "./checkbox";
export * from "./chip-select";
export * from "./color-password";
export * from "./container";
export * from "./copy-click";
export * from "./dialog";
export * from "./disclosure";
export * from "./drawer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { By } from "@angular/platform-browser";
import { mock } from "jest-mock-extended";
import { BehaviorSubject } from "rxjs";

import { CopyClickDirective } from "@bitwarden/angular/directives/copy-click.directive";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
Expand All @@ -17,7 +16,7 @@ import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { Fido2CredentialView } from "@bitwarden/common/vault/models/view/fido2-credential.view";
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
import { BitFormFieldComponent, ToastService } from "@bitwarden/components";
import { CopyClickDirective, BitFormFieldComponent, ToastService } from "@bitwarden/components";
// FIXME: remove `src` and fix import
// eslint-disable-next-line no-restricted-imports
import { ColorPasswordComponent } from "@bitwarden/components/src/color-password/color-password.component";
Expand Down

0 comments on commit 1b61b0f

Please sign in to comment.