From 75965b080f1fd9f9a1ecb88262f17043713742df Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Tue, 27 Sep 2022 14:40:04 -0700 Subject: [PATCH] [EC-19] Update Organization Settings Page (#3251) * [EC-19] Refactor existing organization settings components to its own module * [EC-19] Move SSO page to settings tab * [EC-19] Move Policies page to Settings tab Refactor Policy components into its own module * [EC-19] Move ImageSubscriptionHiddenComponent * [EC-19] Lazy load org settings module * [EC-19] Add SSO Id to SSO config view * [EC-19] Remove SSO identfier from org info page * [EC-19] Update org settings/policies to follow ADR-0011 * [EC-19] Update two-step login setup description * [EC-19] Revert nested policy components folder * [EC-19] Revert nested org setting components folder * [EC-19] Remove left over image component * [EC-19] Prettier * [EC-19] Fix missing i18n * [EC-19] Update SSO form to use CL * [EC-19] Remove unused SSO input components * [EC-19] Fix bad SSO locale identifier * [EC-19] Fix import order linting * [EC-19] Add explicit whitespace check for launch click directive * [EC-19] Add restricted import paths to eslint config * [EC-19] Tag deprecated field with Jira issue to cleanup in future release * [EC-19] Remove out of date comment * [EC-19] Move policy components to policies module * [EC-19] Remove dityRequired validator * [EC-19] Use explicit type for SSO config form * [EC-19] Fix rxjs linter errors * [EC-19] Fix RxJS eslint comments in org settings component * [EC-19] Use explicit ControlsOf helper for nested SSO form groups. * [EC-19] Attribute source of ControlsOf helper * [EC-19] Fix missing settings side nav links * [EC-19] Fix member/user language for policy modals --- apps/web/.eslintrc.json | 8 +- apps/web/src/app/app.component.ts | 20 +- apps/web/src/app/core/policy-list.service.ts | 2 +- .../image-subscription-hidden.component.svg | 0 .../image-subscription-hidden.component.ts | 0 .../billing/organization-billing.module.ts | 2 + .../organization-routing.module.ts | 17 +- .../src/app/organizations/policies/index.ts | 12 + .../policies.component.html | 0 .../policies.component.ts | 2 +- .../organizations/policies/policies.module.ts | 46 ++ .../policy-edit.component.html | 0 .../policy-edit.component.ts | 2 +- .../settings/account.component.html | 10 - .../src/app/organizations/settings/index.ts | 2 + .../organization-settings-routing.module.ts | 52 ++ .../settings/organization-settings.module.ts | 27 + .../settings/settings.component.html | 42 +- .../settings/settings.component.ts | 38 +- ...families-for-enterprise-setup.component.ts | 2 +- .../settings/two-factor-setup.component.html | 21 +- .../src/app/shared/loose-components.module.ts | 56 -- apps/web/src/locales/en/messages.json | 44 +- .../components/base-cva.component.ts | 7 +- .../input-text-readonly.component.html | 26 - .../input-text-readonly.component.ts | 25 - .../components/input-text.component.html | 33 -- .../components/input-text.component.ts | 48 -- .../components/select.component.html | 19 - .../components/select.component.ts | 14 - .../organizations/manage/sso.component.html | 535 ++++++++++-------- .../app/organizations/manage/sso.component.ts | 157 ++--- .../organizations-routing.module.ts | 11 +- .../app/organizations/organizations.module.ts | 14 +- ...disable-personal-vault-export.component.ts | 5 +- .../maximum-vault-timeout.component.ts | 5 +- .../src/directives/copy-click.directive.ts | 16 + .../src/directives/launch-click.directive.ts | 19 + libs/angular/src/jslib.module.ts | 6 + libs/angular/src/types/controls-of.ts | 20 + .../angular/src/validators/dirty.validator.ts | 9 - libs/common/src/models/api/ssoConfigApi.ts | 2 +- .../organization/organizationSsoRequest.ts | 1 + .../request/organizationUpdateRequest.ts | 4 + .../organization/organizationSsoResponse.ts | 2 + libs/common/src/models/view/ssoConfigView.ts | 2 +- .../src/form-field/error-summary.component.ts | 4 + .../src/form-field/error.component.ts | 2 + 48 files changed, 750 insertions(+), 641 deletions(-) rename apps/web/src/app/organizations/{settings => billing}/image-subscription-hidden.component.svg (100%) rename apps/web/src/app/organizations/{settings => billing}/image-subscription-hidden.component.ts (100%) create mode 100644 apps/web/src/app/organizations/policies/index.ts rename apps/web/src/app/organizations/{manage => policies}/policies.component.html (100%) rename apps/web/src/app/organizations/{manage => policies}/policies.component.ts (98%) create mode 100644 apps/web/src/app/organizations/policies/policies.module.ts rename apps/web/src/app/organizations/{manage => policies}/policy-edit.component.html (100%) rename apps/web/src/app/organizations/{manage => policies}/policy-edit.component.ts (97%) create mode 100644 apps/web/src/app/organizations/settings/index.ts create mode 100644 apps/web/src/app/organizations/settings/organization-settings-routing.module.ts create mode 100644 apps/web/src/app/organizations/settings/organization-settings.module.ts delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/input-text-readonly.component.html delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/input-text-readonly.component.ts delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/input-text.component.html delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/input-text.component.ts delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/select.component.html delete mode 100644 bitwarden_license/bit-web/src/app/organizations/components/select.component.ts create mode 100644 libs/angular/src/directives/copy-click.directive.ts create mode 100644 libs/angular/src/directives/launch-click.directive.ts create mode 100644 libs/angular/src/types/controls-of.ts delete mode 100644 libs/angular/src/validators/dirty.validator.ts diff --git a/apps/web/.eslintrc.json b/apps/web/.eslintrc.json index 0cc672cc6e6..dd037910028 100644 --- a/apps/web/.eslintrc.json +++ b/apps/web/.eslintrc.json @@ -6,7 +6,13 @@ "no-restricted-imports": [ "error", { - "patterns": ["**/app/core/*", "**/reports/*", "**/app/shared/*"] + "patterns": [ + "**/app/core/*", + "**/reports/*", + "**/app/shared/*", + "**/organizations/settings/*", + "**/organizations/policies/*" + ] } ] } diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index b1700a85513..9bd0fda6fcb 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -27,15 +27,17 @@ import { SyncService } from "@bitwarden/common/abstractions/sync/sync.service.ab import { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout/vaultTimeout.service"; import { PolicyListService, RouterService } from "./core"; -import { DisableSendPolicy } from "./organizations/policies/disable-send.component"; -import { MasterPasswordPolicy } from "./organizations/policies/master-password.component"; -import { PasswordGeneratorPolicy } from "./organizations/policies/password-generator.component"; -import { PersonalOwnershipPolicy } from "./organizations/policies/personal-ownership.component"; -import { RequireSsoPolicy } from "./organizations/policies/require-sso.component"; -import { ResetPasswordPolicy } from "./organizations/policies/reset-password.component"; -import { SendOptionsPolicy } from "./organizations/policies/send-options.component"; -import { SingleOrgPolicy } from "./organizations/policies/single-org.component"; -import { TwoFactorAuthenticationPolicy } from "./organizations/policies/two-factor-authentication.component"; +import { + DisableSendPolicy, + MasterPasswordPolicy, + PasswordGeneratorPolicy, + PersonalOwnershipPolicy, + RequireSsoPolicy, + ResetPasswordPolicy, + SendOptionsPolicy, + SingleOrgPolicy, + TwoFactorAuthenticationPolicy, +} from "./organizations/policies"; const BroadcasterSubscriptionId = "AppComponent"; const IdleTimeout = 60000 * 10; // 10 minutes diff --git a/apps/web/src/app/core/policy-list.service.ts b/apps/web/src/app/core/policy-list.service.ts index 70857ef8196..bb207006906 100644 --- a/apps/web/src/app/core/policy-list.service.ts +++ b/apps/web/src/app/core/policy-list.service.ts @@ -1,4 +1,4 @@ -import { BasePolicy } from "../organizations/policies/base-policy.component"; +import { BasePolicy } from "../organizations/policies"; export class PolicyListService { private policies: BasePolicy[] = []; diff --git a/apps/web/src/app/organizations/settings/image-subscription-hidden.component.svg b/apps/web/src/app/organizations/billing/image-subscription-hidden.component.svg similarity index 100% rename from apps/web/src/app/organizations/settings/image-subscription-hidden.component.svg rename to apps/web/src/app/organizations/billing/image-subscription-hidden.component.svg diff --git a/apps/web/src/app/organizations/settings/image-subscription-hidden.component.ts b/apps/web/src/app/organizations/billing/image-subscription-hidden.component.ts similarity index 100% rename from apps/web/src/app/organizations/settings/image-subscription-hidden.component.ts rename to apps/web/src/app/organizations/billing/image-subscription-hidden.component.ts diff --git a/apps/web/src/app/organizations/billing/organization-billing.module.ts b/apps/web/src/app/organizations/billing/organization-billing.module.ts index 7e2dcf534e9..7e58c3b65cc 100644 --- a/apps/web/src/app/organizations/billing/organization-billing.module.ts +++ b/apps/web/src/app/organizations/billing/organization-billing.module.ts @@ -4,6 +4,7 @@ import { LooseComponentsModule } from "../../shared/loose-components.module"; import { SharedModule } from "../../shared/shared.module"; import { BillingSyncApiKeyComponent } from "./billing-sync-api-key.component"; +import { ImageSubscriptionHiddenComponent } from "./image-subscription-hidden.component"; import { OrgBillingHistoryViewComponent } from "./organization-billing-history-view.component"; import { OrganizationBillingRoutingModule } from "./organization-billing-routing.module"; import { OrganizationBillingTabComponent } from "./organization-billing-tab.component"; @@ -14,6 +15,7 @@ import { OrganizationSubscriptionComponent } from "./organization-subscription.c declarations: [ BillingSyncApiKeyComponent, OrganizationBillingTabComponent, + ImageSubscriptionHiddenComponent, OrganizationSubscriptionComponent, OrgBillingHistoryViewComponent, ], diff --git a/apps/web/src/app/organizations/organization-routing.module.ts b/apps/web/src/app/organizations/organization-routing.module.ts index 3466ae28a7b..33ff52e9826 100644 --- a/apps/web/src/app/organizations/organization-routing.module.ts +++ b/apps/web/src/app/organizations/organization-routing.module.ts @@ -11,11 +11,7 @@ import { canAccessGroupsTab, canAccessMembersTab, canAccessOrgAdmin, - canAccessSettingsTab, } from "./navigation-permissions"; -import { AccountComponent } from "./settings/account.component"; -import { SettingsComponent } from "./settings/settings.component"; -import { TwoFactorSetupComponent } from "./settings/two-factor-setup.component"; import { VaultModule } from "./vault/vault.module"; const routes: Routes = [ @@ -34,18 +30,7 @@ const routes: Routes = [ }, { path: "settings", - component: SettingsComponent, - canActivate: [OrganizationPermissionsGuard], - data: { organizationPermissions: canAccessSettingsTab }, - children: [ - { path: "", pathMatch: "full", redirectTo: "account" }, - { path: "account", component: AccountComponent, data: { titleId: "organizationInfo" } }, - { - path: "two-factor", - component: TwoFactorSetupComponent, - data: { titleId: "twoStepLogin" }, - }, - ], + loadChildren: () => import("./settings").then((m) => m.OrganizationSettingsModule), }, { path: "members", diff --git a/apps/web/src/app/organizations/policies/index.ts b/apps/web/src/app/organizations/policies/index.ts new file mode 100644 index 00000000000..1fb554d55a1 --- /dev/null +++ b/apps/web/src/app/organizations/policies/index.ts @@ -0,0 +1,12 @@ +export * from "./policies.module"; +export { BasePolicy, BasePolicyComponent } from "./base-policy.component"; +export { DisableSendPolicy } from "./disable-send.component"; +export { MasterPasswordPolicy } from "./master-password.component"; +export { PasswordGeneratorPolicy } from "./password-generator.component"; +export { PersonalOwnershipPolicy } from "./personal-ownership.component"; +export { RequireSsoPolicy } from "./require-sso.component"; +export { ResetPasswordPolicy } from "./reset-password.component"; +export { SendOptionsPolicy } from "./send-options.component"; +export { SingleOrgPolicy } from "./single-org.component"; +export { TwoFactorAuthenticationPolicy } from "./two-factor-authentication.component"; +export { PoliciesComponent } from "./policies.component"; diff --git a/apps/web/src/app/organizations/manage/policies.component.html b/apps/web/src/app/organizations/policies/policies.component.html similarity index 100% rename from apps/web/src/app/organizations/manage/policies.component.html rename to apps/web/src/app/organizations/policies/policies.component.html diff --git a/apps/web/src/app/organizations/manage/policies.component.ts b/apps/web/src/app/organizations/policies/policies.component.ts similarity index 98% rename from apps/web/src/app/organizations/manage/policies.component.ts rename to apps/web/src/app/organizations/policies/policies.component.ts index b9f11322de5..b4e11a46ba0 100644 --- a/apps/web/src/app/organizations/manage/policies.component.ts +++ b/apps/web/src/app/organizations/policies/policies.component.ts @@ -10,7 +10,7 @@ import { Organization } from "@bitwarden/common/models/domain/organization"; import { PolicyResponse } from "@bitwarden/common/models/response/policyResponse"; import { PolicyListService } from "../../core"; -import { BasePolicy } from "../policies/base-policy.component"; +import { BasePolicy } from "../policies"; import { PolicyEditComponent } from "./policy-edit.component"; diff --git a/apps/web/src/app/organizations/policies/policies.module.ts b/apps/web/src/app/organizations/policies/policies.module.ts new file mode 100644 index 00000000000..37b4d63c333 --- /dev/null +++ b/apps/web/src/app/organizations/policies/policies.module.ts @@ -0,0 +1,46 @@ +import { NgModule } from "@angular/core"; + +import { LooseComponentsModule, SharedModule } from "../../shared"; + +import { DisableSendPolicyComponent } from "./disable-send.component"; +import { MasterPasswordPolicyComponent } from "./master-password.component"; +import { PasswordGeneratorPolicyComponent } from "./password-generator.component"; +import { PersonalOwnershipPolicyComponent } from "./personal-ownership.component"; +import { PoliciesComponent } from "./policies.component"; +import { PolicyEditComponent } from "./policy-edit.component"; +import { RequireSsoPolicyComponent } from "./require-sso.component"; +import { ResetPasswordPolicyComponent } from "./reset-password.component"; +import { SendOptionsPolicyComponent } from "./send-options.component"; +import { SingleOrgPolicyComponent } from "./single-org.component"; +import { TwoFactorAuthenticationPolicyComponent } from "./two-factor-authentication.component"; + +@NgModule({ + imports: [SharedModule, LooseComponentsModule], + declarations: [ + DisableSendPolicyComponent, + MasterPasswordPolicyComponent, + PasswordGeneratorPolicyComponent, + PersonalOwnershipPolicyComponent, + RequireSsoPolicyComponent, + ResetPasswordPolicyComponent, + SendOptionsPolicyComponent, + SingleOrgPolicyComponent, + TwoFactorAuthenticationPolicyComponent, + PoliciesComponent, + PolicyEditComponent, + ], + exports: [ + DisableSendPolicyComponent, + MasterPasswordPolicyComponent, + PasswordGeneratorPolicyComponent, + PersonalOwnershipPolicyComponent, + RequireSsoPolicyComponent, + ResetPasswordPolicyComponent, + SendOptionsPolicyComponent, + SingleOrgPolicyComponent, + TwoFactorAuthenticationPolicyComponent, + PoliciesComponent, + PolicyEditComponent, + ], +}) +export class PoliciesModule {} diff --git a/apps/web/src/app/organizations/manage/policy-edit.component.html b/apps/web/src/app/organizations/policies/policy-edit.component.html similarity index 100% rename from apps/web/src/app/organizations/manage/policy-edit.component.html rename to apps/web/src/app/organizations/policies/policy-edit.component.html diff --git a/apps/web/src/app/organizations/manage/policy-edit.component.ts b/apps/web/src/app/organizations/policies/policy-edit.component.ts similarity index 97% rename from apps/web/src/app/organizations/manage/policy-edit.component.ts rename to apps/web/src/app/organizations/policies/policy-edit.component.ts index 4efb35cba37..6528cdda348 100644 --- a/apps/web/src/app/organizations/manage/policy-edit.component.ts +++ b/apps/web/src/app/organizations/policies/policy-edit.component.ts @@ -17,7 +17,7 @@ import { PolicyType } from "@bitwarden/common/enums/policyType"; import { PolicyRequest } from "@bitwarden/common/models/request/policyRequest"; import { PolicyResponse } from "@bitwarden/common/models/response/policyResponse"; -import { BasePolicy, BasePolicyComponent } from "../policies/base-policy.component"; +import { BasePolicy, BasePolicyComponent } from "../policies"; @Component({ selector: "app-policy-edit", diff --git a/apps/web/src/app/organizations/settings/account.component.html b/apps/web/src/app/organizations/settings/account.component.html index d4c8e71bc51..680cb2badd8 100644 --- a/apps/web/src/app/organizations/settings/account.component.html +++ b/apps/web/src/app/organizations/settings/account.component.html @@ -51,16 +51,6 @@ [disabled]="selfHosted || !canManageBilling" /> -
- - -
diff --git a/apps/web/src/app/organizations/settings/index.ts b/apps/web/src/app/organizations/settings/index.ts new file mode 100644 index 00000000000..289bf3d6323 --- /dev/null +++ b/apps/web/src/app/organizations/settings/index.ts @@ -0,0 +1,2 @@ +export * from "./organization-settings.module"; +export { DeleteOrganizationComponent } from "./delete-organization.component"; diff --git a/apps/web/src/app/organizations/settings/organization-settings-routing.module.ts b/apps/web/src/app/organizations/settings/organization-settings-routing.module.ts new file mode 100644 index 00000000000..c05954dfaac --- /dev/null +++ b/apps/web/src/app/organizations/settings/organization-settings-routing.module.ts @@ -0,0 +1,52 @@ +import { NgModule } from "@angular/core"; +import { RouterModule, Routes } from "@angular/router"; + +import { Organization } from "@bitwarden/common/models/domain/organization"; + +import { OrganizationPermissionsGuard } from "../guards/org-permissions.guard"; +import { canAccessSettingsTab } from "../navigation-permissions"; +import { PoliciesComponent } from "../policies"; + +import { AccountComponent } from "./account.component"; +import { SettingsComponent } from "./settings.component"; +import { TwoFactorSetupComponent } from "./two-factor-setup.component"; + +const routes: Routes = [ + { + path: "", + component: SettingsComponent, + canActivate: [OrganizationPermissionsGuard], + data: { organizationPermissions: canAccessSettingsTab }, + children: [ + { path: "", pathMatch: "full", redirectTo: "account" }, + { path: "account", component: AccountComponent, data: { titleId: "organizationInfo" } }, + { + path: "two-factor", + component: TwoFactorSetupComponent, + data: { titleId: "twoStepLogin" }, + }, + { + path: "policies", + component: PoliciesComponent, + canActivate: [OrganizationPermissionsGuard], + data: { + organizationPermissions: (org: Organization) => org.canManagePolicies, + titleId: "policies", + }, + }, + { + path: "tools", + loadChildren: () => + import("../tools/import-export/org-import-export.module").then( + (m) => m.OrganizationImportExportModule + ), + }, + ], + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class OrganizationSettingsRoutingModule {} diff --git a/apps/web/src/app/organizations/settings/organization-settings.module.ts b/apps/web/src/app/organizations/settings/organization-settings.module.ts new file mode 100644 index 00000000000..f121bfbc7aa --- /dev/null +++ b/apps/web/src/app/organizations/settings/organization-settings.module.ts @@ -0,0 +1,27 @@ +import { NgModule } from "@angular/core"; + +import { LooseComponentsModule, SharedModule } from "../../shared"; +import { PoliciesModule } from "../policies"; + +import { AccountComponent } from "./account.component"; +import { AdjustSubscription } from "./adjust-subscription.component"; +import { ChangePlanComponent } from "./change-plan.component"; +import { DeleteOrganizationComponent } from "./delete-organization.component"; +import { DownloadLicenseComponent } from "./download-license.component"; +import { OrganizationSettingsRoutingModule } from "./organization-settings-routing.module"; +import { SettingsComponent } from "./settings.component"; +import { TwoFactorSetupComponent } from "./two-factor-setup.component"; + +@NgModule({ + imports: [SharedModule, LooseComponentsModule, PoliciesModule, OrganizationSettingsRoutingModule], + declarations: [ + SettingsComponent, + AccountComponent, + AdjustSubscription, + ChangePlanComponent, + DeleteOrganizationComponent, + DownloadLicenseComponent, + TwoFactorSetupComponent, + ], +}) +export class OrganizationSettingsModule {} diff --git a/apps/web/src/app/organizations/settings/settings.component.html b/apps/web/src/app/organizations/settings/settings.component.html index 4134e4391d4..d81d7553dcd 100644 --- a/apps/web/src/app/organizations/settings/settings.component.html +++ b/apps/web/src/app/organizations/settings/settings.component.html @@ -7,14 +7,54 @@ {{ "organizationInfo" | i18n }} + + {{ "policies" | i18n }} + {{ "twoStepLogin" | i18n }} + + {{ "importData" | i18n }} + + + {{ "exportVault" | i18n }} + + + {{ "singleSignOn" | i18n }} + + + {{ "scim" | i18n }} +
diff --git a/apps/web/src/app/organizations/settings/settings.component.ts b/apps/web/src/app/organizations/settings/settings.component.ts index 318608524b3..770661ffcf7 100644 --- a/apps/web/src/app/organizations/settings/settings.component.ts +++ b/apps/web/src/app/organizations/settings/settings.component.ts @@ -1,30 +1,34 @@ -import { Component } from "@angular/core"; +import { Component, OnDestroy, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; +import { Subject, switchMap, takeUntil } from "rxjs"; import { OrganizationService } from "@bitwarden/common/abstractions/organization.service"; -import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service"; +import { Organization } from "@bitwarden/common/models/domain/organization"; @Component({ selector: "app-org-settings", templateUrl: "settings.component.html", }) -// eslint-disable-next-line rxjs-angular/prefer-takeuntil -export class SettingsComponent { - access2fa = false; - showBilling: boolean; +export class SettingsComponent implements OnInit, OnDestroy { + organization: Organization; - constructor( - private route: ActivatedRoute, - private organizationService: OrganizationService, - private platformUtilsService: PlatformUtilsService - ) {} + private destroy$ = new Subject(); + + constructor(private route: ActivatedRoute, private organizationService: OrganizationService) {} ngOnInit() { - // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe - this.route.parent.params.subscribe(async (params) => { - const organization = await this.organizationService.get(params.organizationId); - this.showBilling = !this.platformUtilsService.isSelfHost() && organization.canManageBilling; - this.access2fa = organization.use2fa; - }); + this.route.params + .pipe( + switchMap(async (params) => await this.organizationService.get(params.organizationId)), + takeUntil(this.destroy$) + ) + .subscribe((organization) => { + this.organization = organization; + }); + } + + ngOnDestroy(): void { + this.destroy$.next(); + this.destroy$.complete(); } } diff --git a/apps/web/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts b/apps/web/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts index 673ffa586d6..3821a1e3722 100644 --- a/apps/web/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts +++ b/apps/web/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts @@ -15,8 +15,8 @@ import { ProductType } from "@bitwarden/common/enums/productType"; import { Organization } from "@bitwarden/common/models/domain/organization"; import { OrganizationSponsorshipRedeemRequest } from "@bitwarden/common/models/request/organization/organizationSponsorshipRedeemRequest"; +import { DeleteOrganizationComponent } from "../../organizations/settings"; import { OrganizationPlansComponent } from "../../settings/organization-plans.component"; -import { DeleteOrganizationComponent } from "../settings/delete-organization.component"; @Component({ selector: "families-for-enterprise-setup", diff --git a/apps/web/src/app/settings/two-factor-setup.component.html b/apps/web/src/app/settings/two-factor-setup.component.html index 698e7fd9c07..931296bdbdf 100644 --- a/apps/web/src/app/settings/two-factor-setup.component.html +++ b/apps/web/src/app/settings/two-factor-setup.component.html @@ -1,8 +1,17 @@
-

{{ "twoStepLogin" | i18n }}

+

{{ "twoStepLogin" | i18n }}

+

{{ "twoStepLoginEnforcement" | i18n }}

{{ "twoStepLoginDesc" | i18n }}

-

{{ "twoStepLoginOrganizationDesc" | i18n }}

+ +

+ {{ "twoStepLoginOrganizationDescStart" | i18n }} + {{ "twoStepLoginPolicy" | i18n }}. +
+ {{ "twoStepLoginOrganizationDuoDesc" | i18n }} +

+

{{ "twoStepLoginOrganizationSsoDesc" | i18n }}

+

{{ "twoStepLoginRecoveryWarning" | i18n }}

- -
- -
- - diff --git a/bitwarden_license/bit-web/src/app/organizations/components/input-text-readonly.component.ts b/bitwarden_license/bit-web/src/app/organizations/components/input-text-readonly.component.ts deleted file mode 100644 index 4b9a675b087..00000000000 --- a/bitwarden_license/bit-web/src/app/organizations/components/input-text-readonly.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, Input } from "@angular/core"; - -import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service"; - -/** For use in the SSO Config Form only - will be deprecated by the Component Library */ -@Component({ - selector: "app-input-text-readonly", - templateUrl: "input-text-readonly.component.html", -}) -export class InputTextReadOnlyComponent { - @Input() controlValue: string; - @Input() label: string; - @Input() showCopy = true; - @Input() showLaunch = false; - - constructor(private platformUtilsService: PlatformUtilsService) {} - - copy(value: string) { - this.platformUtilsService.copyToClipboard(value); - } - - launchUri(url: string) { - this.platformUtilsService.launchUri(url); - } -} diff --git a/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.html b/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.html deleted file mode 100644 index e19963474ca..00000000000 --- a/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.html +++ /dev/null @@ -1,33 +0,0 @@ -
- - -
- - {{ helperText }} - - - - {{ "error" | i18n }}: - {{ - controlDir.control.hasError(helperTextSameAsError) - ? helperText - : ("fieldRequiredError" | i18n: label) - }} - -
-
diff --git a/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.ts b/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.ts deleted file mode 100644 index a8810e38068..00000000000 --- a/bitwarden_license/bit-web/src/app/organizations/components/input-text.component.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Component, Input, OnInit } from "@angular/core"; - -import { BaseCvaComponent } from "./base-cva.component"; - -/** For use in the SSO Config Form only - will be deprecated by the Component Library */ -@Component({ - selector: "app-input-text[label][controlId]", - templateUrl: "input-text.component.html", -}) -export class InputTextComponent extends BaseCvaComponent implements OnInit { - @Input() helperTextSameAsError: string; - @Input() requiredErrorMessage: string; - @Input() stripSpaces = false; - - transformValue: (value: string) => string = null; - - ngOnInit() { - super.ngOnInit(); - if (this.stripSpaces) { - this.transformValue = this.doStripSpaces; - } - } - - writeValue(value: string) { - this.internalControl.setValue(value == null ? "" : value); - } - - protected onValueChangesInternal: any = (value: string) => { - let newValue = value; - if (this.transformValue != null) { - newValue = this.transformValue(value); - this.internalControl.setValue(newValue, { emitEvent: false }); - } - this.onChange(newValue); - }; - - protected onValueChangeInternal(value: string) { - let newValue = value; - if (this.transformValue != null) { - newValue = this.transformValue(value); - this.internalControl.setValue(newValue, { emitEvent: false }); - } - } - - private doStripSpaces(value: string) { - return value.replace(/ /g, ""); - } -} diff --git a/bitwarden_license/bit-web/src/app/organizations/components/select.component.html b/bitwarden_license/bit-web/src/app/organizations/components/select.component.html deleted file mode 100644 index bc2108e8afe..00000000000 --- a/bitwarden_license/bit-web/src/app/organizations/components/select.component.html +++ /dev/null @@ -1,19 +0,0 @@ -
- - -
diff --git a/bitwarden_license/bit-web/src/app/organizations/components/select.component.ts b/bitwarden_license/bit-web/src/app/organizations/components/select.component.ts deleted file mode 100644 index 5c2ab308672..00000000000 --- a/bitwarden_license/bit-web/src/app/organizations/components/select.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, Input } from "@angular/core"; - -import { SelectOptions } from "@bitwarden/angular/interfaces/selectOptions"; - -import { BaseCvaComponent } from "./base-cva.component"; - -/** For use in the SSO Config Form only - will be deprecated by the Component Library */ -@Component({ - selector: "app-select", - templateUrl: "select.component.html", -}) -export class SelectComponent extends BaseCvaComponent { - @Input() selectOptions: SelectOptions[]; -} diff --git a/bitwarden_license/bit-web/src/app/organizations/manage/sso.component.html b/bitwarden_license/bit-web/src/app/organizations/manage/sso.component.html index 525dc22b8ed..fdb613d44f2 100644 --- a/bitwarden_license/bit-web/src/app/organizations/manage/sso.component.html +++ b/bitwarden_license/bit-web/src/app/organizations/manage/sso.component.html @@ -35,6 +35,14 @@ [helperText]="'allowSsoDesc' | i18n" > + + {{ "ssoIdentifier" | i18n }} + + {{ "ssoIdentifierHint" | i18n }} + + +
+
@@ -80,66 +88,55 @@ {{ "keyConnectorWarning" | i18n }} -
- -
- -
- -
-
-
- - - {{ "error" | i18n }}: - {{ "keyConnectorTestFail" | i18n }} + + {{ "keyConnectorUrl" | i18n }} + + + + + + {{ "keyConnectorTestSuccess" | i18n }} - - - - {{ "keyConnectorTestSuccess" | i18n }} - - -
-
+ + - - +
+ + + {{ "type" | i18n }} + + @@ -150,52 +147,67 @@

{{ "openIdConnectConfig" | i18n }}

- + + {{ "callbackPath" | i18n }} + + + - + + {{ "signedOutCallbackPath" | i18n }} + + + - + + {{ "authority" | i18n }} + + - + + {{ "clientId" | i18n }} + + - + + {{ "clientSecret" | i18n }} + + - + + {{ "metadataAddress" | i18n }} + + {{ "openIdAuthorityRequired" | i18n }} + - - + + {{ "oidcRedirectBehavior" | i18n }} + +
- + + {{ "additionalScopes" | i18n }} + + {{ "separateMultipleWithComma" | i18n }} + - + + {{ "additionalUserIdClaimTypes" | i18n }} + + {{ "separateMultipleWithComma" | i18n }} + - + + {{ "additionalEmailClaimTypes" | i18n }} + + {{ "separateMultipleWithComma" | i18n }} + - + + {{ "additionalNameClaimTypes" | i18n }} + + {{ "separateMultipleWithComma" | i18n }} + - + + {{ "acrValues" | i18n }} + + acr_values + - + + {{ "expectedReturnAcrValue" | i18n }} + + acr_validaton +
@@ -282,53 +288,108 @@

{{ "samlSpConfig" | i18n }}

- + + {{ "spEntityId" | i18n }} + + + - + + {{ "spMetadataUrl" | i18n }} + + + + - + + {{ "spAcsUrl" | i18n }} + + + - - + + {{ "spNameIdFormat" | i18n }} + + - - + + {{ "spOutboundSigningAlgorithm" | i18n }} + + - - + + {{ "spSigningBehavior" | i18n }} + + - - + + {{ "spMinIncomingSigningAlgorithm" | i18n }} + +

{{ "samlIdpConfig" | i18n }}

- + + {{ "idpEntityId" | i18n }} + + - - + + {{ "idpBindingType" | i18n }} + + - + + {{ "idpSingleSignOnServiceUrl" | i18n }} + + {{ "idpSingleSignOnServiceUrlRequired" | i18n }} + - + + {{ "idpSingleLogoutServiceUrl" | i18n }} + + -
- - - - - {{ "error" | i18n }}: - {{ "fieldRequiredError" | i18n: ("idpX509PublicCert" | i18n) }} - -
+ + {{ "idpX509PublicCert" | i18n }} + + - - + + {{ "idpOutboundSigningAlgorithm" | i18n }} + +