diff --git a/.storybook/main.ts b/.storybook/main.ts index 234523e2fcd..b7d39348088 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -36,6 +36,7 @@ const config: StorybookConfig = { "../bitwarden_license/bit-web/src/**/*.stories.@(js|jsx|ts|tsx)", "../bitwarden_license/bit-browser/src/**/*.mdx", "../bitwarden_license/bit-browser/src/**/*.stories.@(js|jsx|ts|tsx)", + "../libs/angular/src/**/*.mdx", "../libs/angular/src/**/*.stories.@(js|jsx|ts|tsx)", ], addons: [ diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index 47c43355a98..8e3d60d3e1e 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -17,6 +17,12 @@ import { import { LoginViaWebAuthnComponent } from "@bitwarden/angular/auth/login-via-webauthn/login-via-webauthn.component"; import { ChangePasswordComponent } from "@bitwarden/angular/auth/password-management/change-password"; import { SetInitialPasswordComponent } from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.component"; +import { + RegistrationFinishComponent, + RegistrationStartComponent, + RegistrationStartSecondaryComponent, + RegistrationStartSecondaryComponentData, +} from "@bitwarden/angular/auth/registration"; import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard"; import { featureFlaggedRoute } from "@bitwarden/angular/platform/utils/feature-flagged-route"; import { @@ -35,10 +41,6 @@ import { LoginViaAuthRequestComponent, NewDeviceVerificationComponent, PasswordHintComponent, - RegistrationFinishComponent, - RegistrationStartComponent, - RegistrationStartSecondaryComponent, - RegistrationStartSecondaryComponentData, SsoComponent, TwoFactorAuthComponent, TwoFactorAuthGuard, diff --git a/apps/desktop/src/app/app-routing.module.ts b/apps/desktop/src/app/app-routing.module.ts index 49eb3f81a5d..8f9052287c6 100644 --- a/apps/desktop/src/app/app-routing.module.ts +++ b/apps/desktop/src/app/app-routing.module.ts @@ -15,6 +15,12 @@ import { } from "@bitwarden/angular/auth/guards"; import { ChangePasswordComponent } from "@bitwarden/angular/auth/password-management/change-password"; import { SetInitialPasswordComponent } from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.component"; +import { + RegistrationFinishComponent, + RegistrationStartComponent, + RegistrationStartSecondaryComponent, + RegistrationStartSecondaryComponentData, +} from "@bitwarden/angular/auth/registration"; import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard"; import { featureFlaggedRoute } from "@bitwarden/angular/platform/utils/feature-flagged-route"; import { @@ -32,10 +38,6 @@ import { LoginSecondaryContentComponent, LoginViaAuthRequestComponent, PasswordHintComponent, - RegistrationFinishComponent, - RegistrationStartComponent, - RegistrationStartSecondaryComponent, - RegistrationStartSecondaryComponentData, LoginDecryptionOptionsComponent, SsoComponent, TwoFactorAuthComponent, diff --git a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts index 9910a80b210..80f2cc0ada4 100644 --- a/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts +++ b/apps/web/src/app/auth/core/services/registration/web-registration-finish.service.ts @@ -2,9 +2,9 @@ // @ts-strict-ignore import { DefaultRegistrationFinishService, - PasswordInputResult, RegistrationFinishService, -} from "@bitwarden/auth/angular"; +} from "@bitwarden/angular/auth/registration"; +import { PasswordInputResult } from "@bitwarden/auth/angular"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { OpenOrgInviteRequest } from "@bitwarden/common/auth/models/request/registration/open-org-invite.request"; import { RegisterFinishRequest } from "@bitwarden/common/auth/models/request/registration/register-finish.request"; diff --git a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.spec.ts b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.spec.ts index 9b37a0be084..260f0301560 100644 --- a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.spec.ts +++ b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.spec.ts @@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from "@angular/router"; import { mock, MockProxy } from "jest-mock-extended"; import { BehaviorSubject, of } from "rxjs"; -import { RegistrationFinishService } from "@bitwarden/auth/angular"; +import { RegistrationFinishService } from "@bitwarden/angular/auth/registration"; import { LoginStrategyServiceAbstraction } from "@bitwarden/auth/common"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { OrganizationBillingServiceAbstraction } from "@bitwarden/common/billing/abstractions/organization-billing.service"; diff --git a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts index 2d41e352ee7..8735ddc51cd 100644 --- a/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts +++ b/apps/web/src/app/billing/trial-initiation/complete-trial-initiation/complete-trial-initiation.component.ts @@ -5,11 +5,8 @@ import { FormBuilder, Validators } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { firstValueFrom } from "rxjs"; -import { - InputPasswordFlow, - PasswordInputResult, - RegistrationFinishService, -} from "@bitwarden/auth/angular"; +import { RegistrationFinishService } from "@bitwarden/angular/auth/registration"; +import { InputPasswordFlow, PasswordInputResult } from "@bitwarden/auth/angular"; import { LoginStrategyServiceAbstraction, PasswordLoginCredentials } from "@bitwarden/auth/common"; import { OrganizationResponse } from "@bitwarden/common/admin-console/models/response/organization.response"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; diff --git a/apps/web/src/app/core/core.module.ts b/apps/web/src/app/core/core.module.ts index 79bc80083b8..884cc11910e 100644 --- a/apps/web/src/app/core/core.module.ts +++ b/apps/web/src/app/core/core.module.ts @@ -16,6 +16,7 @@ import { DefaultLoginViaWebAuthnComponentService } from "@bitwarden/angular/auth import { LoginViaWebAuthnComponentService } from "@bitwarden/angular/auth/login-via-webauthn/login-via-webauthn-component.service"; import { ChangePasswordService } from "@bitwarden/angular/auth/password-management/change-password"; import { SetInitialPasswordService } from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.service.abstraction"; +import { RegistrationFinishService as RegistrationFinishServiceAbstraction } from "@bitwarden/angular/auth/registration"; import { PremiumInterestStateService } from "@bitwarden/angular/billing/services/premium-interest/premium-interest-state.service.abstraction"; import { SafeProvider, safeProvider } from "@bitwarden/angular/platform/utils/safe-provider"; import { @@ -36,7 +37,6 @@ import { JslibServicesModule } from "@bitwarden/angular/services/jslib-services. import { LoginComponentService, LoginDecryptionOptionsService, - RegistrationFinishService as RegistrationFinishServiceAbstraction, SsoComponentService, TwoFactorAuthDuoComponentService, } from "@bitwarden/auth/angular"; diff --git a/apps/web/src/app/oss-routing.module.ts b/apps/web/src/app/oss-routing.module.ts index c6d8959d42a..49c42286eeb 100644 --- a/apps/web/src/app/oss-routing.module.ts +++ b/apps/web/src/app/oss-routing.module.ts @@ -16,6 +16,13 @@ import { import { LoginViaWebAuthnComponent } from "@bitwarden/angular/auth/login-via-webauthn/login-via-webauthn.component"; import { ChangePasswordComponent } from "@bitwarden/angular/auth/password-management/change-password"; import { SetInitialPasswordComponent } from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.component"; +import { + RegistrationFinishComponent, + RegistrationStartComponent, + RegistrationStartSecondaryComponent, + RegistrationStartSecondaryComponentData, + RegistrationLinkExpiredComponent, +} from "@bitwarden/angular/auth/registration"; import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard"; import { DevicesIcon, @@ -36,11 +43,6 @@ import { } from "@bitwarden/assets/svg"; import { PasswordHintComponent, - RegistrationFinishComponent, - RegistrationStartComponent, - RegistrationStartSecondaryComponent, - RegistrationStartSecondaryComponentData, - RegistrationLinkExpiredComponent, LoginComponent, LoginSecondaryContentComponent, LoginViaAuthRequestComponent, diff --git a/libs/angular/src/auth/registration/index.ts b/libs/angular/src/auth/registration/index.ts new file mode 100644 index 00000000000..454a7979cd5 --- /dev/null +++ b/libs/angular/src/auth/registration/index.ts @@ -0,0 +1,7 @@ +export * from "./registration-env-selector/registration-env-selector.component"; +export * from "./registration-finish/default-registration-finish.service"; +export * from "./registration-finish/registration-finish.component"; +export * from "./registration-finish/registration-finish.service"; +export * from "./registration-link-expired/registration-link-expired.component"; +export * from "./registration-start/registration-start-secondary.component"; +export * from "./registration-start/registration-start.component"; diff --git a/libs/auth/src/angular/registration/registration-env-selector/registration-env-selector.component.html b/libs/angular/src/auth/registration/registration-env-selector/registration-env-selector.component.html similarity index 100% rename from libs/auth/src/angular/registration/registration-env-selector/registration-env-selector.component.html rename to libs/angular/src/auth/registration/registration-env-selector/registration-env-selector.component.html diff --git a/libs/auth/src/angular/registration/registration-env-selector/registration-env-selector.component.ts b/libs/angular/src/auth/registration/registration-env-selector/registration-env-selector.component.ts similarity index 95% rename from libs/auth/src/angular/registration/registration-env-selector/registration-env-selector.component.ts rename to libs/angular/src/auth/registration/registration-env-selector/registration-env-selector.component.ts index e0f18e45c2d..16eb01dbac7 100644 --- a/libs/auth/src/angular/registration/registration-env-selector/registration-env-selector.component.ts +++ b/libs/angular/src/auth/registration/registration-env-selector/registration-env-selector.component.ts @@ -16,8 +16,6 @@ import { tap, } from "rxjs"; -import { SelfHostedEnvConfigDialogComponent } from "@bitwarden/angular/auth/self-hosted-env-config-dialog"; -import { JslibModule } from "@bitwarden/angular/jslib.module"; import { ClientType } from "@bitwarden/common/enums"; import { AvailableRegionsService } from "@bitwarden/common/platform/abstractions/available-regions.service"; import { @@ -27,10 +25,11 @@ import { } from "@bitwarden/common/platform/abstractions/environment.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { DialogService, FormFieldModule, SelectModule, ToastService } from "@bitwarden/components"; +import { JslibModule } from "../../../jslib.module"; +import { SelfHostedEnvConfigDialogComponent } from "../../self-hosted-env-config-dialog"; + /** * Component for selecting the environment to register with in the email verification registration flow. * Outputs the selected region to the parent component so it can respond as necessary. diff --git a/libs/auth/src/angular/registration/registration-finish/__snapshots__/default-registration-finish.service.spec.ts.snap b/libs/angular/src/auth/registration/registration-finish/__snapshots__/default-registration-finish.service.spec.ts.snap similarity index 100% rename from libs/auth/src/angular/registration/registration-finish/__snapshots__/default-registration-finish.service.spec.ts.snap rename to libs/angular/src/auth/registration/registration-finish/__snapshots__/default-registration-finish.service.spec.ts.snap diff --git a/libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.spec.ts b/libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.spec.ts similarity index 98% rename from libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.spec.ts rename to libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.spec.ts index 13e68ecb994..ade608c4ef4 100644 --- a/libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.spec.ts +++ b/libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.spec.ts @@ -1,6 +1,9 @@ import { MockProxy, mock } from "jest-mock-extended"; import { of } from "rxjs"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { PasswordInputResult } from "@bitwarden/auth/angular"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { RegisterFinishRequest } from "@bitwarden/common/auth/models/request/registration/register-finish.request"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; @@ -23,8 +26,6 @@ import { SymmetricCryptoKey, } from "@bitwarden/legacy-crypto"; -import { PasswordInputResult } from "../../input-password/password-input-result"; - import { DefaultRegistrationFinishService } from "./default-registration-finish.service"; describe("DefaultRegistrationFinishService", () => { diff --git a/libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.ts b/libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.ts similarity index 97% rename from libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.ts rename to libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.ts index 0243dc8f3c7..84ab9a7aa17 100644 --- a/libs/auth/src/angular/registration/registration-finish/default-registration-finish.service.ts +++ b/libs/angular/src/auth/registration/registration-finish/default-registration-finish.service.ts @@ -2,6 +2,9 @@ // @ts-strict-ignore import { firstValueFrom } from "rxjs"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { PasswordInputResult } from "@bitwarden/auth/angular"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { RegisterFinishRequest } from "@bitwarden/common/auth/models/request/registration/register-finish.request"; import { assertNonNullish, assertTruthy } from "@bitwarden/common/auth/utils"; @@ -19,8 +22,6 @@ import { UserMasterPasswordRegistrationRequest, } from "@bitwarden/sdk-internal"; -import { PasswordInputResult } from "../../input-password/password-input-result"; - import { RegistrationFinishService } from "./registration-finish.service"; export class DefaultRegistrationFinishService implements RegistrationFinishService { diff --git a/libs/auth/src/angular/registration/registration-finish/registration-finish.component.html b/libs/angular/src/auth/registration/registration-finish/registration-finish.component.html similarity index 100% rename from libs/auth/src/angular/registration/registration-finish/registration-finish.component.html rename to libs/angular/src/auth/registration/registration-finish/registration-finish.component.html diff --git a/libs/auth/src/angular/registration/registration-finish/registration-finish.component.ts b/libs/angular/src/auth/registration/registration-finish/registration-finish.component.ts similarity index 97% rename from libs/auth/src/angular/registration/registration-finish/registration-finish.component.ts rename to libs/angular/src/auth/registration/registration-finish/registration-finish.component.ts index b9710f9ee10..51a4ec0b575 100644 --- a/libs/auth/src/angular/registration/registration-finish/registration-finish.component.ts +++ b/libs/angular/src/auth/registration/registration-finish/registration-finish.component.ts @@ -5,11 +5,21 @@ import { Component, OnDestroy, OnInit, signal } from "@angular/core"; import { ActivatedRoute, Params, Router, RouterModule } from "@angular/router"; import { Subject, firstValueFrom } from "rxjs"; -import { AuthRoute } from "@bitwarden/angular/auth/constants"; -import { getOpenOrgInviteStatusErrorUi } from "@bitwarden/angular/auth/organization-invite"; -import { PremiumInterestStateService } from "@bitwarden/angular/billing/services/premium-interest/premium-interest-state.service.abstraction"; -import { JslibModule } from "@bitwarden/angular/jslib.module"; import { ExpiredIcon } from "@bitwarden/assets/svg"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { + InputPasswordComponent, + InputPasswordFlow, + PasswordInputResult, +} from "@bitwarden/auth/angular"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { + LoginStrategyServiceAbstraction, + LoginSuccessHandlerService, + PasswordLoginCredentials, +} from "@bitwarden/auth/common"; import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { DeepLinkRedirectService } from "@bitwarden/common/auth/deep-link-redirect"; @@ -25,8 +35,6 @@ import { ErrorResponse } from "@bitwarden/common/models/response/error.response" import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { AnonLayoutWrapperDataService, ButtonModule, @@ -34,16 +42,10 @@ import { IconModule, } from "@bitwarden/components"; -import { - LoginStrategyServiceAbstraction, - LoginSuccessHandlerService, - PasswordLoginCredentials, -} from "../../../common"; -import { - InputPasswordComponent, - InputPasswordFlow, -} from "../../input-password/input-password.component"; -import { PasswordInputResult } from "../../input-password/password-input-result"; +import { PremiumInterestStateService } from "../../../billing/services/premium-interest/premium-interest-state.service.abstraction"; +import { JslibModule } from "../../../jslib.module"; +import { AuthRoute } from "../../constants"; +import { getOpenOrgInviteStatusErrorUi } from "../../organization-invite"; import { RegistrationFinishService } from "./registration-finish.service"; diff --git a/libs/auth/src/angular/registration/registration-finish/registration-finish.service.ts b/libs/angular/src/auth/registration/registration-finish/registration-finish.service.ts similarity index 86% rename from libs/auth/src/angular/registration/registration-finish/registration-finish.service.ts rename to libs/angular/src/auth/registration/registration-finish/registration-finish.service.ts index edcf363930f..ecdc08053fc 100644 --- a/libs/auth/src/angular/registration/registration-finish/registration-finish.service.ts +++ b/libs/angular/src/auth/registration/registration-finish/registration-finish.service.ts @@ -1,4 +1,6 @@ -import { PasswordInputResult } from "../../input-password/password-input-result"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { PasswordInputResult } from "@bitwarden/auth/angular"; export abstract class RegistrationFinishService { /** diff --git a/libs/auth/src/angular/registration/registration-link-expired/registration-link-expired.component.html b/libs/angular/src/auth/registration/registration-link-expired/registration-link-expired.component.html similarity index 100% rename from libs/auth/src/angular/registration/registration-link-expired/registration-link-expired.component.html rename to libs/angular/src/auth/registration/registration-link-expired/registration-link-expired.component.html diff --git a/libs/auth/src/angular/registration/registration-link-expired/registration-link-expired.component.ts b/libs/angular/src/auth/registration/registration-link-expired/registration-link-expired.component.ts similarity index 87% rename from libs/auth/src/angular/registration/registration-link-expired/registration-link-expired.component.ts rename to libs/angular/src/auth/registration/registration-link-expired/registration-link-expired.component.ts index 257142f769f..9a2ff7ef8ed 100644 --- a/libs/auth/src/angular/registration/registration-link-expired/registration-link-expired.component.ts +++ b/libs/angular/src/auth/registration/registration-link-expired/registration-link-expired.component.ts @@ -5,12 +5,11 @@ import { Component, OnDestroy, OnInit } from "@angular/core"; import { ActivatedRoute, RouterModule } from "@angular/router"; import { Subject, firstValueFrom } from "rxjs"; -import { JslibModule } from "@bitwarden/angular/jslib.module"; import { ExpiredIcon } from "@bitwarden/assets/svg"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { ButtonModule, SvgModule } from "@bitwarden/components"; +import { JslibModule } from "../../../jslib.module"; + /** * RegistrationLinkExpiredComponentData * @loginRoute: string - The client specific route to the login page - configured at the app-routing.module level. diff --git a/libs/auth/src/angular/registration/registration-start/registration-start-secondary.component.html b/libs/angular/src/auth/registration/registration-start/registration-start-secondary.component.html similarity index 100% rename from libs/auth/src/angular/registration/registration-start/registration-start-secondary.component.html rename to libs/angular/src/auth/registration/registration-start/registration-start-secondary.component.html diff --git a/libs/auth/src/angular/registration/registration-start/registration-start-secondary.component.ts b/libs/angular/src/auth/registration/registration-start/registration-start-secondary.component.ts similarity index 84% rename from libs/auth/src/angular/registration/registration-start/registration-start-secondary.component.ts rename to libs/angular/src/auth/registration/registration-start/registration-start-secondary.component.ts index 31e9cbc6316..df6e89fe4f8 100644 --- a/libs/auth/src/angular/registration/registration-start/registration-start-secondary.component.ts +++ b/libs/angular/src/auth/registration/registration-start/registration-start-secondary.component.ts @@ -5,11 +5,10 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute, RouterModule } from "@angular/router"; import { firstValueFrom } from "rxjs"; -import { JslibModule } from "@bitwarden/angular/jslib.module"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { LinkModule } from "@bitwarden/components"; +import { JslibModule } from "../../../jslib.module"; + /** * RegistrationStartSecondaryComponentData * @loginRoute: string - The client specific route to the login page - configured at the app-routing.module level. diff --git a/libs/auth/src/angular/registration/registration-start/registration-start.component.html b/libs/angular/src/auth/registration/registration-start/registration-start.component.html similarity index 100% rename from libs/auth/src/angular/registration/registration-start/registration-start.component.html rename to libs/angular/src/auth/registration/registration-start/registration-start.component.html diff --git a/libs/auth/src/angular/registration/registration-start/registration-start.component.ts b/libs/angular/src/auth/registration/registration-start/registration-start.component.ts similarity index 99% rename from libs/auth/src/angular/registration/registration-start/registration-start.component.ts rename to libs/angular/src/auth/registration/registration-start/registration-start.component.ts index 2d1e20837c5..7c9b2a29cce 100644 --- a/libs/auth/src/angular/registration/registration-start/registration-start.component.ts +++ b/libs/angular/src/auth/registration/registration-start/registration-start.component.ts @@ -6,8 +6,10 @@ import { FormBuilder, ReactiveFormsModule, Validators } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { Subject, takeUntil } from "rxjs"; -import { JslibModule } from "@bitwarden/angular/jslib.module"; import { RegistrationCheckEmailIcon } from "@bitwarden/assets/svg"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { LoginEmailService } from "@bitwarden/auth/common"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { RegisterSendVerificationEmailRequest } from "@bitwarden/common/auth/models/request/registration/register-send-verification-email.request"; import { RegisterStartOpenOrgInviteRequest } from "@bitwarden/common/auth/models/request/registration/register-start-open-org-invite.request"; @@ -16,8 +18,6 @@ import { RegionConfig, Region } from "@bitwarden/common/platform/abstractions/en import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { ANON_LAYOUT_DEFAULTS, AnonLayoutWrapperDataService, @@ -29,7 +29,7 @@ import { LinkModule, } from "@bitwarden/components"; -import { LoginEmailService } from "../../../common"; +import { JslibModule } from "../../../jslib.module"; import { RegistrationEnvSelectorComponent } from "../registration-env-selector/registration-env-selector.component"; // FIXME: update to use a const object instead of a typescript enum diff --git a/libs/auth/src/angular/registration/registration-start/registration-start.mdx b/libs/angular/src/auth/registration/registration-start/registration-start.mdx similarity index 100% rename from libs/auth/src/angular/registration/registration-start/registration-start.mdx rename to libs/angular/src/auth/registration/registration-start/registration-start.mdx diff --git a/libs/auth/src/angular/registration/registration-start/registration-start.stories.ts b/libs/angular/src/auth/registration/registration-start/registration-start.stories.ts similarity index 99% rename from libs/auth/src/angular/registration/registration-start/registration-start.stories.ts rename to libs/angular/src/auth/registration/registration-start/registration-start.stories.ts index fdc6c2e95c0..96b7a502dac 100644 --- a/libs/auth/src/angular/registration/registration-start/registration-start.stories.ts +++ b/libs/angular/src/auth/registration/registration-start/registration-start.stories.ts @@ -6,6 +6,9 @@ import { RouterTestingModule } from "@angular/router/testing"; import { Meta, StoryObj, applicationConfig, moduleMetadata } from "@storybook/angular"; import { of, BehaviorSubject } from "rxjs"; +// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. +// eslint-disable-next-line no-restricted-imports +import { LoginEmailService } from "@bitwarden/auth/common"; import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service"; import { OrganizationInviteService } from "@bitwarden/common/auth/organization-invite"; import { ClientType } from "@bitwarden/common/enums"; @@ -19,8 +22,6 @@ import { } from "@bitwarden/common/platform/abstractions/environment.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; -// This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. -// eslint-disable-next-line no-restricted-imports import { AnonLayoutWrapperData, AnonLayoutWrapperDataService, @@ -39,7 +40,6 @@ import { // FIXME: remove `src` and fix import // eslint-disable-next-line import/no-restricted-paths, no-restricted-imports import { PreloadedEnglishI18nModule } from "../../../../../../apps/web/src/app/core/tests"; -import { LoginEmailService } from "../../../common"; import { RegistrationStartComponent } from "./registration-start.component"; diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index 0f9660a8d4a..adf9a1ca25d 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -22,13 +22,11 @@ import { DefaultLoginComponentService, DefaultLoginDecryptionOptionsService, DefaultNewDeviceVerificationComponentService, - DefaultRegistrationFinishService, DefaultTwoFactorAuthComponentService, DefaultTwoFactorAuthWebAuthnComponentService, LoginComponentService, LoginDecryptionOptionsService, NewDeviceVerificationComponentService, - RegistrationFinishService as RegistrationFinishServiceAbstraction, TwoFactorAuthComponentService, TwoFactorAuthWebAuthnComponentService, } from "@bitwarden/auth/angular"; @@ -473,6 +471,10 @@ import { } from "../auth/password-management/change-password"; import { DefaultSetInitialPasswordService } from "../auth/password-management/set-initial-password/default-set-initial-password.service.implementation"; import { SetInitialPasswordService } from "../auth/password-management/set-initial-password/set-initial-password.service.abstraction"; +import { + DefaultRegistrationFinishService, + RegistrationFinishService as RegistrationFinishServiceAbstraction, +} from "../auth/registration"; import { DeviceTrustToastService as DeviceTrustToastServiceAbstraction } from "../auth/services/device-trust-toast.service.abstraction"; import { DeviceTrustToastService } from "../auth/services/device-trust-toast.service.implementation"; import { NoopPremiumInterestStateService } from "../billing/services/premium-interest/noop-premium-interest-state.service"; diff --git a/libs/auth/src/angular/index.ts b/libs/auth/src/angular/index.ts index 9f4109b56ef..0fa4cb0370b 100644 --- a/libs/auth/src/angular/index.ts +++ b/libs/auth/src/angular/index.ts @@ -27,15 +27,6 @@ export * from "./password-callout/password-callout.component"; // password hint export * from "./password-hint/password-hint.component"; -// registration -export * from "./registration/registration-start/registration-start.component"; -export * from "./registration/registration-finish/registration-finish.component"; -export * from "./registration/registration-link-expired/registration-link-expired.component"; -export * from "./registration/registration-start/registration-start-secondary.component"; -export * from "./registration/registration-env-selector/registration-env-selector.component"; -export * from "./registration/registration-finish/registration-finish.service"; -export * from "./registration/registration-finish/default-registration-finish.service"; - // user verification export * from "./user-verification/user-verification-dialog.component"; export * from "./user-verification/user-verification-dialog.types";