From 38d8fbdb5a7498b77d445bded30be00b9661a054 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 23 Feb 2024 18:22:45 +0100 Subject: [PATCH] Vertical Vault Navigation (#6957) * WIP admin console layout * Update icons * Migrate more things * Migrate the last pages * Move header to web * Fix story not working * Convert header component to standalone * Migrate org layout to standalone * Enable org switcher * Add AC to product switcher * Migrate provider portal to vertical nav * Migrate PM * Prettier fixes * Change AC and PP to use secondary variant layout & update logos * Remove full width setting * Remove commented code * Add header to report pages * Add provider portal banner * Fix banner for billing pages * Move vault title to header * Prevent scrollbar jumping * Move send button to header * Replace search input with bit-search * Remove unused files and css * Add banner * Tweak storage option * Fix duplicate nav item after merge * Migrate banner state to state provider framework * [AC-2078] Fix device approvals header * [PM-5861] Hide AC from product switcher for users that do not have access * [PM-5860] Fix Vault and Send page headers * [AC-2075] Fix missing link on reporting nav group * [AC-2079] Hide Payment Method and Billing History pages for self-hosted instances * [AC-2090] Hide reports/event log nav items for users that do not have permission * [AC-2092] Fix missing provider portal option in product switcher on page load * Add null check for organization in org layout component * [AC-2094] Fix missing page header for new client orgs page * [AC-2093] Update New client button styling * Fix failing test after merge * [PM-2087] Use disk-local for web layout banner * [PM-6041] Update banner copy to read "web app" * [PM-6094] Update banner link to marketing URL * [PM-6114] add CL container component to VVR pages (#7802) * create bit-container component * add container to all page components * Fix linting errors after merge with main * Fix product switcher stories * Fix web-header stories * mock org state properly in product switcher stories (#7956) * refactor: move web layout migration banner logic into a service (#7958) * make CL codeowner of web header files * move migration banner logic to service; update stories * [PM-5862] Ensure a sync has run before hiding navigation links * Remove leftover banner global state * Re-add dropped selfHosted ngIf * Add rel noreferrer * Remove comment --------- Co-authored-by: Shane Melton Co-authored-by: Will Martin --- .github/CODEOWNERS | 1 + .../organization-switcher.component.html | 67 -- .../organization-switcher.component.ts | 35 - .../admin-console/icons/admin-console-logo.ts | 5 + .../icons/provider-portal-logo.ts | 5 + .../organization-layout.component.html | 166 +++- .../layouts/organization-layout.component.ts | 37 +- .../manage/events.component.html | 3 +- .../manage/groups.component.html | 230 +++-- .../members/people.component.html | 637 +++++++------ .../organizations/organization.module.ts | 3 + .../policies/policies.component.html | 51 +- .../organization-reporting-routing.module.ts | 2 - .../organization-reporting.module.ts | 11 +- .../reporting/reporting.component.html | 30 - .../reporting/reports-home.component.html | 4 +- .../settings/account.component.html | 225 ++--- .../settings/org-import.component.html | 21 + .../settings/org-import.component.ts | 56 ++ .../organization-settings-routing.module.ts | 9 +- .../settings/organization-settings.module.ts | 3 +- .../organizations/tools/tools.component.html | 79 -- .../providers/providers.component.html | 11 +- .../create-organization.component.html | 17 +- .../settings/create-organization.component.ts | 3 +- .../sponsored-families.component.html | 207 ++-- apps/web/src/app/app.component.ts | 18 - .../web/src/app/auth/login/login.component.ts | 3 - .../settings/account/account.component.html | 49 +- .../emergency-access.component.html | 470 ++++----- .../settings/security/security.component.html | 33 +- .../settings/two-factor-setup.component.html | 157 +-- .../trial-initiation.component.spec.ts | 2 + .../individual/individual-billing.module.ts | 3 +- .../individual/subscription.component.html | 31 +- ...zation-billing-history-view.component.html | 32 +- .../organization-billing-routing.module.ts | 2 - .../organization-billing-tab.component.html | 33 - .../organization-billing.module.ts | 4 +- ...nization-subscription-cloud.component.html | 489 +++++----- ...ation-subscription-selfhost.component.html | 252 +++-- .../billing/shared/billing-shared.module.ts | 3 +- .../shared/payment-method.component.html | 249 ++--- .../payment-method-banners.component.ts | 2 +- .../web/src/app/layouts/footer.component.html | 9 - apps/web/src/app/layouts/footer.component.ts | 19 - .../src/app/layouts/header/header.module.ts | 4 +- .../layouts/header/web-header.component.html | 15 + .../layouts/header/web-header.component.ts | 3 + .../app/layouts/header/web-header.stories.ts | 27 +- .../web-layout-migration-banner.service.ts | 29 + .../web/src/app/layouts/navbar.component.html | 100 -- apps/web/src/app/layouts/navbar.component.ts | 75 -- .../org-switcher}/org-switcher.component.html | 0 .../org-switcher}/org-switcher.component.ts | 5 + .../src/app/layouts/password-manager-logo.ts | 5 + .../product-switcher-content.component.ts | 48 +- .../product-switcher.stories.ts | 58 +- .../app/layouts/user-layout.component.html | 45 +- .../src/app/layouts/user-layout.component.ts | 81 +- apps/web/src/app/oss-routing.module.ts | 6 +- .../app/settings/domain-rules.component.html | 207 ++-- .../app/settings/preferences.component.html | 256 +++-- .../src/app/settings/preferences.component.ts | 4 - .../src/app/settings/settings.component.html | 45 - .../src/app/shared/loose-components.module.ts | 28 +- apps/web/src/app/shared/shared.module.ts | 3 + .../src/app/tools/generator.component.html | 891 +++++++++--------- .../tools/import/admin-import.component.ts | 24 - .../tools/import/import-web.component.html | 38 +- .../app/tools/import/import-web.component.ts | 39 +- .../pages/breach-report.component.html | 123 +-- .../exposed-passwords-report.component.html | 145 +-- .../inactive-two-factor-report.component.html | 163 ++-- .../reports/pages/reports-home.component.html | 10 +- .../reused-passwords-report.component.html | 165 ++-- .../unsecured-websites-report.component.html | 141 ++- .../weak-passwords-report.component.html | 165 ++-- .../reports/reports-layout.component.html | 16 +- .../tools/reports/reports-routing.module.ts | 7 +- .../src/app/tools/reports/reports.module.ts | 2 + .../src/app/tools/send/send.component.html | 397 ++++---- apps/web/src/app/tools/send/send.component.ts | 3 +- apps/web/src/app/tools/tools.component.html | 23 - .../tools/vault-export/export.component.html | 193 ++-- .../vault-filter/vault-filter.module.ts | 4 +- .../vault-header/vault-header.component.html | 132 ++- .../vault-header/vault-header.component.ts | 4 + .../individual-vault/vault.component.html | 235 +++-- .../vault-filter/vault-filter.module.ts | 4 +- .../vault-header/vault-header.component.html | 143 ++- .../vault-header/vault-header.component.ts | 4 + .../app/vault/org-vault/vault.component.html | 238 +++-- apps/web/src/locales/en/messages.json | 16 +- apps/web/src/scss/base.scss | 8 - apps/web/src/scss/buttons.scss | 14 - apps/web/src/scss/navigation.scss | 104 -- apps/web/src/scss/styles.scss | 3 +- apps/web/src/scss/tailwind.css | 5 + apps/web/src/scss/variables.scss | 20 - .../device-approvals.component.html | 21 +- .../domain-verification.component.html | 6 +- .../organizations/manage/scim.component.html | 4 +- .../organizations-routing.module.ts | 5 +- .../organizations/organizations.module.ts | 9 +- .../providers/clients/clients.component.html | 45 +- .../create-organization.component.html | 4 +- .../providers/manage/events.component.html | 106 +-- .../providers/manage/manage.component.html | 30 - .../providers/manage/people.component.html | 145 ++- .../providers/providers-layout.component.html | 75 +- .../providers/providers-layout.component.ts | 19 +- .../providers/providers-routing.module.ts | 15 +- .../providers/providers.module.ts | 6 +- .../providers/settings/account.component.html | 5 +- .../settings/settings.component.html | 17 - .../providers/setup/setup.component.html | 2 - .../src/app/auth/sso/sso.component.html | 4 +- .../secrets-manager/layout/layout.module.ts | 6 +- .../platform/abstractions/state.service.ts | 2 - .../src/platform/models/domain/account.ts | 1 - .../src/platform/services/state.service.ts | 21 - .../src/platform/state/state-definitions.ts | 4 + .../src/vault/services/sync/sync.service.ts | 4 +- .../src/container/container.component.html | 3 + .../src/container/container.component.ts | 13 + libs/components/src/container/index.ts | 1 + libs/components/src/index.ts | 1 + 128 files changed, 4228 insertions(+), 4647 deletions(-) delete mode 100644 apps/web/src/app/admin-console/components/organization-switcher.component.html delete mode 100644 apps/web/src/app/admin-console/components/organization-switcher.component.ts create mode 100644 apps/web/src/app/admin-console/icons/admin-console-logo.ts create mode 100644 apps/web/src/app/admin-console/icons/provider-portal-logo.ts delete mode 100644 apps/web/src/app/admin-console/organizations/reporting/reporting.component.html create mode 100644 apps/web/src/app/admin-console/organizations/settings/org-import.component.html create mode 100644 apps/web/src/app/admin-console/organizations/settings/org-import.component.ts delete mode 100644 apps/web/src/app/admin-console/organizations/tools/tools.component.html delete mode 100644 apps/web/src/app/billing/organizations/organization-billing-tab.component.html delete mode 100644 apps/web/src/app/layouts/footer.component.html delete mode 100644 apps/web/src/app/layouts/footer.component.ts create mode 100644 apps/web/src/app/layouts/header/web-layout-migration-banner.service.ts delete mode 100644 apps/web/src/app/layouts/navbar.component.ts rename {bitwarden_license/bit-web/src/app/secrets-manager/layout => apps/web/src/app/layouts/org-switcher}/org-switcher.component.html (100%) rename {bitwarden_license/bit-web/src/app/secrets-manager/layout => apps/web/src/app/layouts/org-switcher}/org-switcher.component.ts (88%) create mode 100644 apps/web/src/app/layouts/password-manager-logo.ts delete mode 100644 apps/web/src/app/settings/settings.component.html delete mode 100644 apps/web/src/app/tools/import/admin-import.component.ts delete mode 100644 apps/web/src/app/tools/tools.component.html delete mode 100644 apps/web/src/scss/navigation.scss delete mode 100644 bitwarden_license/bit-web/src/app/admin-console/providers/manage/manage.component.html delete mode 100644 bitwarden_license/bit-web/src/app/admin-console/providers/settings/settings.component.html create mode 100644 libs/components/src/container/container.component.html create mode 100644 libs/components/src/container/container.component.ts create mode 100644 libs/components/src/container/index.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4de02e2fcb0..bfce3c15477 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -88,6 +88,7 @@ libs/common/src/autofill @bitwarden/team-autofill-dev ## Component Library ## .storybook @bitwarden/team-component-library libs/components @bitwarden/team-component-library +apps/web/src/app/layouts/header ## Desktop native module ## apps/desktop/desktop_native @bitwarden/team-platform-dev diff --git a/apps/web/src/app/admin-console/components/organization-switcher.component.html b/apps/web/src/app/admin-console/components/organization-switcher.component.html deleted file mode 100644 index 53a4077db69..00000000000 --- a/apps/web/src/app/admin-console/components/organization-switcher.component.html +++ /dev/null @@ -1,67 +0,0 @@ -
- -
-
-
- - {{ "organizationIsDisabled" | i18n }} -
-
-
-
- - {{ "accessingUsingProvider" | i18n: activeOrganization.providerName }} -
-
-
- - - - -
diff --git a/apps/web/src/app/admin-console/components/organization-switcher.component.ts b/apps/web/src/app/admin-console/components/organization-switcher.component.ts deleted file mode 100644 index 97f81412665..00000000000 --- a/apps/web/src/app/admin-console/components/organization-switcher.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, Input, OnInit } from "@angular/core"; -import { map, Observable } from "rxjs"; - -import { - canAccessAdmin, - OrganizationService, -} from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { Utils } from "@bitwarden/common/platform/misc/utils"; - -@Component({ - selector: "app-organization-switcher", - templateUrl: "organization-switcher.component.html", -}) -export class OrganizationSwitcherComponent implements OnInit { - constructor( - private organizationService: OrganizationService, - private i18nService: I18nService, - ) {} - - @Input() activeOrganization: Organization = null; - organizations$: Observable; - - loaded = false; - - async ngOnInit() { - this.organizations$ = this.organizationService.memberOrganizations$.pipe( - canAccessAdmin(this.i18nService), - map((orgs) => orgs.sort(Utils.getSortFunction(this.i18nService, "name"))), - ); - - this.loaded = true; - } -} diff --git a/apps/web/src/app/admin-console/icons/admin-console-logo.ts b/apps/web/src/app/admin-console/icons/admin-console-logo.ts new file mode 100644 index 00000000000..32b2b7a13a5 --- /dev/null +++ b/apps/web/src/app/admin-console/icons/admin-console-logo.ts @@ -0,0 +1,5 @@ +import { svgIcon } from "@bitwarden/components"; + +export const AdminConsoleLogo = svgIcon` + +`; diff --git a/apps/web/src/app/admin-console/icons/provider-portal-logo.ts b/apps/web/src/app/admin-console/icons/provider-portal-logo.ts new file mode 100644 index 00000000000..16f7b05d671 --- /dev/null +++ b/apps/web/src/app/admin-console/icons/provider-portal-logo.ts @@ -0,0 +1,5 @@ +import { svgIcon } from "@bitwarden/components"; + +export const ProviderPortalLogo = svgIcon` + +`; diff --git a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html index a2c0f9a9041..c548e528ab7 100644 --- a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html +++ b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.html @@ -1,41 +1,125 @@ - - -
-
-
- - - {{ "collections" | i18n }} - - {{ - "vault" | i18n - }} - - {{ - "members" | i18n - }} - {{ - "groups" | i18n - }} - - {{ getReportTabLabel(organization) | i18n }} - - {{ - "billing" | i18n - }} - {{ - "settings" | i18n - }} - -
-
-
- - + + + + + + {{ "accessingUsingProvider" | i18n: organization.providerName }} + + + + + + diff --git a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts index f43a9edbdc5..efbcaf292dd 100644 --- a/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts +++ b/apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts @@ -1,7 +1,9 @@ +import { CommonModule } from "@angular/common"; import { Component, OnDestroy, OnInit } from "@angular/core"; -import { ActivatedRoute } from "@angular/router"; +import { ActivatedRoute, RouterModule } from "@angular/router"; import { map, mergeMap, Observable, Subject, takeUntil } from "rxjs"; +import { JslibModule } from "@bitwarden/angular/jslib.module"; import { canAccessBillingTab, canAccessGroupsTab, @@ -13,19 +15,43 @@ import { OrganizationService, } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; +import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +import { BannerModule, IconModule, LayoutComponent, NavigationModule } from "@bitwarden/components"; + +import { PaymentMethodBannersComponent } from "../../../components/payment-method-banners/payment-method-banners.component"; +import { OrgSwitcherComponent } from "../../../layouts/org-switcher/org-switcher.component"; +import { AdminConsoleLogo } from "../../icons/admin-console-logo"; @Component({ selector: "app-organization-layout", templateUrl: "organization-layout.component.html", + standalone: true, + imports: [ + CommonModule, + RouterModule, + JslibModule, + LayoutComponent, + IconModule, + NavigationModule, + OrgSwitcherComponent, + BannerModule, + PaymentMethodBannersComponent, + ], }) export class OrganizationLayoutComponent implements OnInit, OnDestroy { + protected readonly logo = AdminConsoleLogo; + + protected orgFilter = (org: Organization) => org.isAdmin; + organization$: Observable; + showPaymentAndHistory$: Observable; private _destroy = new Subject(); constructor( private route: ActivatedRoute, private organizationService: OrganizationService, + private platformUtilsService: PlatformUtilsService, ) {} async ngOnInit() { @@ -41,6 +67,15 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy { .pipe(getOrganizationById(id)); }), ); + + this.showPaymentAndHistory$ = this.organization$.pipe( + map( + (org) => + !this.platformUtilsService.isSelfHost() && + org?.canViewBillingHistory && + org?.canEditPaymentMethods, + ), + ); } ngOnDestroy() { diff --git a/apps/web/src/app/admin-console/organizations/manage/events.component.html b/apps/web/src/app/admin-console/organizations/manage/events.component.html index f936cc7a863..e5a848aaccf 100644 --- a/apps/web/src/app/admin-console/organizations/manage/events.component.html +++ b/apps/web/src/app/admin-console/organizations/manage/events.component.html @@ -1,5 +1,6 @@ + +
-

{{ "eventLogs" | i18n }}

{{ "from" | i18n }} diff --git a/apps/web/src/app/admin-console/organizations/manage/groups.component.html b/apps/web/src/app/admin-console/organizations/manage/groups.component.html index 0c65c2812dd..f256c29b057 100644 --- a/apps/web/src/app/admin-console/organizations/manage/groups.component.html +++ b/apps/web/src/app/admin-console/organizations/manage/groups.component.html @@ -1,126 +1,114 @@ -
-
-

{{ "groups" | i18n }}

-
-
- -
- + + + + + + + + {{ "loading" | i18n }} + + +

{{ "noGroupsInList" | i18n }}

+ + + + -
-
- -
-
- - - {{ "loading" | i18n }} - - -

{{ "noGroupsInList" | i18n }}

- - - - - - - - {{ "name" | i18n }} - {{ "collections" | i18n }} - - + + + {{ "name" | i18n }} + {{ "collections" | i18n }} + + - - - - - - - - - - - - - - - - - {{ "all" | i18n }} - - - + + + +
+ + + + + + + + + + + {{ "all" | i18n }} + + + - - - - - - - - - - - - -
+ + + + + + + + + + + + diff --git a/apps/web/src/app/admin-console/organizations/members/people.component.html b/apps/web/src/app/admin-console/organizations/members/people.component.html index c99056dbbca..6e8410011b3 100644 --- a/apps/web/src/app/admin-console/organizations/members/people.component.html +++ b/apps/web/src/app/admin-console/organizations/members/people.component.html @@ -1,331 +1,326 @@ -
-
-

{{ "members" | i18n }}

-
- - - {{ "all" | i18n }} {{ allCount }} - + + - - {{ "invited" | i18n }} - {{ invitedCount }} - + + - - {{ "needsConfirmation" | i18n }} - {{ acceptedCount }} - - - - {{ "revoked" | i18n }} - {{ revokedCount }} - - - - - - -
-
- - - {{ "loading" | i18n }} - - + -

{{ "noMembersInList" | i18n }}

- - - {{ "usersNeedConfirmed" | i18n }} - - - - - - - - - {{ "name" | i18n }} - {{ (organization.useGroups ? "groups" : "collections") | i18n }} - {{ "role" | i18n }} - {{ "policies" | i18n }} - - + + {{ "all" | i18n }} {{ allCount }} + - - - - - - - - - - - - - - - - - - - - -
- -
-
- - {{ "invited" | i18n }} - {{ "needsConfirmation" | i18n }} - {{ "revoked" | i18n }} -
-
- {{ u.email }} -
-
-
- + + {{ "invited" | i18n }} + {{ invitedCount }} + - - - {{ "all" | i18n }} - + + {{ "needsConfirmation" | i18n }} + {{ acceptedCount }} + - - {{ u.type | userType }} - + + {{ "revoked" | i18n }} + {{ revokedCount }} + +
+
+ + + {{ "loading" | i18n }} + + +

{{ "noMembersInList" | i18n }}

+ + + {{ "usersNeedConfirmed" | i18n }} + + + + + + + + + {{ "name" | i18n }} + {{ (organization.useGroups ? "groups" : "collections") | i18n }} + {{ "role" | i18n }} + {{ "policies" | i18n }} + + - - - - {{ "userUsingTwoStep" | i18n }} - - - - {{ "enrolledAccountRecovery" | i18n }} - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + +
+ +
+
+ + {{ "invited" | i18n }} + {{ "needsConfirmation" | i18n }} + {{ "revoked" | i18n }} +
+
+ {{ u.email }} +
+
+
+ + + + + {{ "all" | i18n }} + + + + {{ u.type | userType }} + + + + + + {{ "userUsingTwoStep" | i18n }} + + + + {{ "enrolledAccountRecovery" | i18n }} + + + + + + + + + + + + + + + + + + + + + +
+ - - - - - - - -
+ + + + + + + + diff --git a/apps/web/src/app/admin-console/organizations/organization.module.ts b/apps/web/src/app/admin-console/organizations/organization.module.ts index 32b1df16609..29a7139231e 100644 --- a/apps/web/src/app/admin-console/organizations/organization.module.ts +++ b/apps/web/src/app/admin-console/organizations/organization.module.ts @@ -1,5 +1,7 @@ import { NgModule } from "@angular/core"; +import { LooseComponentsModule } from "../../shared"; + import { CoreOrganizationModule } from "./core"; import { GroupAddEditComponent } from "./manage/group-add-edit.component"; import { GroupsComponent } from "./manage/groups.component"; @@ -13,6 +15,7 @@ import { AccessSelectorModule } from "./shared/components/access-selector"; AccessSelectorModule, CoreOrganizationModule, OrganizationsRoutingModule, + LooseComponentsModule, ], declarations: [GroupsComponent, GroupAddEditComponent], }) diff --git a/apps/web/src/app/admin-console/organizations/policies/policies.component.html b/apps/web/src/app/admin-console/organizations/policies/policies.component.html index 8f2c0760bd1..d4533b59b16 100644 --- a/apps/web/src/app/admin-console/organizations/policies/policies.component.html +++ b/apps/web/src/app/admin-console/organizations/policies/policies.component.html @@ -1,25 +1,26 @@ - - - - {{ "loading" | i18n }} - - - - - - - -
- {{ p.name | i18n }} - {{ - "on" | i18n - }} - {{ p.description | i18n }} -
- + + + + + + {{ "loading" | i18n }} + + + + + + + +
+ {{ p.name | i18n }} + {{ + "on" | i18n + }} + {{ p.description | i18n }} +
+ +
diff --git a/apps/web/src/app/admin-console/organizations/reporting/organization-reporting-routing.module.ts b/apps/web/src/app/admin-console/organizations/reporting/organization-reporting-routing.module.ts index 1d86332a188..1ab386298c3 100644 --- a/apps/web/src/app/admin-console/organizations/reporting/organization-reporting-routing.module.ts +++ b/apps/web/src/app/admin-console/organizations/reporting/organization-reporting-routing.module.ts @@ -14,13 +14,11 @@ import { OrganizationPermissionsGuard } from "../guards/org-permissions.guard"; import { OrganizationRedirectGuard } from "../guards/org-redirect.guard"; import { EventsComponent } from "../manage/events.component"; -import { ReportingComponent } from "./reporting.component"; import { ReportsHomeComponent } from "./reports-home.component"; const routes: Routes = [ { path: "", - component: ReportingComponent, canActivate: [OrganizationPermissionsGuard], data: { organizationPermissions: canAccessReportingTab }, children: [ diff --git a/apps/web/src/app/admin-console/organizations/reporting/organization-reporting.module.ts b/apps/web/src/app/admin-console/organizations/reporting/organization-reporting.module.ts index f47cff22653..d17bb0c5995 100644 --- a/apps/web/src/app/admin-console/organizations/reporting/organization-reporting.module.ts +++ b/apps/web/src/app/admin-console/organizations/reporting/organization-reporting.module.ts @@ -1,14 +1,19 @@ import { NgModule } from "@angular/core"; +import { LooseComponentsModule } from "../../../shared"; import { SharedModule } from "../../../shared/shared.module"; import { ReportsSharedModule } from "../../../tools/reports"; import { OrganizationReportingRoutingModule } from "./organization-reporting-routing.module"; -import { ReportingComponent } from "./reporting.component"; import { ReportsHomeComponent } from "./reports-home.component"; @NgModule({ - imports: [SharedModule, ReportsSharedModule, OrganizationReportingRoutingModule], - declarations: [ReportsHomeComponent, ReportingComponent], + imports: [ + SharedModule, + ReportsSharedModule, + OrganizationReportingRoutingModule, + LooseComponentsModule, + ], + declarations: [ReportsHomeComponent], }) export class OrganizationReportingModule {} diff --git a/apps/web/src/app/admin-console/organizations/reporting/reporting.component.html b/apps/web/src/app/admin-console/organizations/reporting/reporting.component.html deleted file mode 100644 index 1e807b98dba..00000000000 --- a/apps/web/src/app/admin-console/organizations/reporting/reporting.component.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
-
- -
-
- -
-
-
diff --git a/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.html b/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.html index 941788459f4..801106c001f 100644 --- a/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.html +++ b/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.html @@ -1,7 +1,5 @@ - +

{{ "orgsReportsDesc" | i18n }}

diff --git a/apps/web/src/app/admin-console/organizations/settings/account.component.html b/apps/web/src/app/admin-console/organizations/settings/account.component.html index 464a7ae850a..7035b976ca8 100644 --- a/apps/web/src/app/admin-console/organizations/settings/account.component.html +++ b/apps/web/src/app/admin-console/organizations/settings/account.component.html @@ -1,116 +1,119 @@ -

{{ "organizationInfo" | i18n }}

-
- - {{ "loading" | i18n }} -
-
-
-
- - {{ "organizationName" | i18n }} - - - - {{ "billingEmail" | i18n }} - - - - {{ "businessName" | i18n }} - - -
-
- - - -
+ + + +
+ + {{ "loading" | i18n }}
- - - -

{{ "apiKey" | i18n }}

-

- {{ "apiKeyDesc" | i18n }} - - {{ "learnMore" | i18n }} - -

- - -
-
-

- {{ "collectionManagement" | i18n }} -

-

- {{ "collectionEnhancementsDesc" | i18n }} - - {{ "collectionEnhancementsLearnMore" | i18n }} - -

- +
+ +

{{ "apiKey" | i18n }}

+

+ {{ "apiKeyDesc" | i18n }} + + {{ "learnMore" | i18n }} + +

+ + +
+
- {{ "enable" | i18n }} - -
-
-

{{ "collectionManagement" | i18n }}

-

{{ "collectionManagementDesc" | i18n }}

- - {{ "allowAdminAccessToAllCollectionItemsDesc" | i18n }} - - - - {{ "limitCollectionCreationDeletionDesc" | i18n }} - - - +
+
- {{ "save" | i18n }} - -
+

{{ "collectionManagement" | i18n }}

+

{{ "collectionManagementDesc" | i18n }}

+ + {{ "allowAdminAccessToAllCollectionItemsDesc" | i18n }} + + + + {{ "limitCollectionCreationDeletionDesc" | i18n }} + + + + - - - - + + + + - - - + + + +
diff --git a/apps/web/src/app/admin-console/organizations/settings/org-import.component.html b/apps/web/src/app/admin-console/organizations/settings/org-import.component.html new file mode 100644 index 00000000000..25efa9ec0c7 --- /dev/null +++ b/apps/web/src/app/admin-console/organizations/settings/org-import.component.html @@ -0,0 +1,21 @@ + + + + + + diff --git a/apps/web/src/app/admin-console/organizations/settings/org-import.component.ts b/apps/web/src/app/admin-console/organizations/settings/org-import.component.ts new file mode 100644 index 00000000000..36cfd4230c7 --- /dev/null +++ b/apps/web/src/app/admin-console/organizations/settings/org-import.component.ts @@ -0,0 +1,56 @@ +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute, Router } from "@angular/router"; +import { firstValueFrom } from "rxjs"; + +import { + canAccessVaultTab, + OrganizationService, +} from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; +import { ImportCollectionServiceAbstraction } from "@bitwarden/importer/core"; +import { ImportComponent } from "@bitwarden/importer/ui"; + +import { LooseComponentsModule, SharedModule } from "../../../shared"; +import { ImportCollectionAdminService } from "../../../tools/import/import-collection-admin.service"; +import { CollectionAdminService } from "../../../vault/core/collection-admin.service"; + +@Component({ + templateUrl: "org-import.component.html", + standalone: true, + imports: [SharedModule, ImportComponent, LooseComponentsModule], + providers: [ + { + provide: ImportCollectionServiceAbstraction, + useClass: ImportCollectionAdminService, + deps: [CollectionAdminService], + }, + ], +}) +export class OrgImportComponent implements OnInit { + protected routeOrgId: string = null; + protected loading = false; + protected disabled = false; + + constructor( + private route: ActivatedRoute, + private organizationService: OrganizationService, + private router: Router, + ) {} + + ngOnInit(): void { + this.routeOrgId = this.route.snapshot.paramMap.get("organizationId"); + } + + /** + * Callback that is called after a successful import. + */ + protected async onSuccessfulImport(organizationId: string): Promise { + const organization = await firstValueFrom(this.organizationService.get$(organizationId)); + if (organization == null) { + return; + } + + if (canAccessVaultTab(organization)) { + await this.router.navigate(["organizations", organizationId, "vault"]); + } + } +} diff --git a/apps/web/src/app/admin-console/organizations/settings/organization-settings-routing.module.ts b/apps/web/src/app/admin-console/organizations/settings/organization-settings-routing.module.ts index e2870669658..772e70fc127 100644 --- a/apps/web/src/app/admin-console/organizations/settings/organization-settings-routing.module.ts +++ b/apps/web/src/app/admin-console/organizations/settings/organization-settings-routing.module.ts @@ -9,13 +9,11 @@ import { OrganizationRedirectGuard } from "../../organizations/guards/org-redire import { PoliciesComponent } from "../../organizations/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: [ @@ -49,9 +47,7 @@ const routes: Routes = [ { path: "import", loadComponent: () => - import("../../../tools/import/admin-import.component").then( - (mod) => mod.AdminImportComponent, - ), + import("./org-import.component").then((mod) => mod.OrgImportComponent), canActivate: [OrganizationPermissionsGuard], data: { titleId: "importData", @@ -64,6 +60,9 @@ const routes: Routes = [ import("../tools/vault-export/org-vault-export.module").then( (m) => m.OrganizationVaultExportModule, ), + data: { + titleId: "exportVault", + }, }, ], }, diff --git a/apps/web/src/app/admin-console/organizations/settings/organization-settings.module.ts b/apps/web/src/app/admin-console/organizations/settings/organization-settings.module.ts index 9eaec0a068e..2a2068d581f 100644 --- a/apps/web/src/app/admin-console/organizations/settings/organization-settings.module.ts +++ b/apps/web/src/app/admin-console/organizations/settings/organization-settings.module.ts @@ -6,7 +6,6 @@ import { PoliciesModule } from "../../organizations/policies"; import { AccountComponent } from "./account.component"; import { OrganizationSettingsRoutingModule } from "./organization-settings-routing.module"; -import { SettingsComponent } from "./settings.component"; import { TwoFactorSetupComponent } from "./two-factor-setup.component"; @NgModule({ @@ -17,6 +16,6 @@ import { TwoFactorSetupComponent } from "./two-factor-setup.component"; OrganizationSettingsRoutingModule, AccountFingerprintComponent, ], - declarations: [SettingsComponent, AccountComponent, TwoFactorSetupComponent], + declarations: [AccountComponent, TwoFactorSetupComponent], }) export class OrganizationSettingsModule {} diff --git a/apps/web/src/app/admin-console/organizations/tools/tools.component.html b/apps/web/src/app/admin-console/organizations/tools/tools.component.html deleted file mode 100644 index de83652b463..00000000000 --- a/apps/web/src/app/admin-console/organizations/tools/tools.component.html +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/apps/web/src/app/admin-console/providers/providers.component.html b/apps/web/src/app/admin-console/providers/providers.component.html index 967ef54ce84..d07342c85c2 100644 --- a/apps/web/src/app/admin-console/providers/providers.component.html +++ b/apps/web/src/app/admin-console/providers/providers.component.html @@ -1,8 +1,6 @@ - -
- + + +

{{ "loading" | i18n }} @@ -29,5 +27,4 @@ -

- + diff --git a/apps/web/src/app/admin-console/settings/create-organization.component.html b/apps/web/src/app/admin-console/settings/create-organization.component.html index f5b4219aa61..105a3e6a251 100644 --- a/apps/web/src/app/admin-console/settings/create-organization.component.html +++ b/apps/web/src/app/admin-console/settings/create-organization.component.html @@ -1,11 +1,6 @@ -
-
-
- -

{{ "newOrganizationDesc" | i18n }}

- -
-
-
+ + + +

{{ "newOrganizationDesc" | i18n }}

+ +
diff --git a/apps/web/src/app/admin-console/settings/create-organization.component.ts b/apps/web/src/app/admin-console/settings/create-organization.component.ts index 5e8aaf8684e..2a060d6d565 100644 --- a/apps/web/src/app/admin-console/settings/create-organization.component.ts +++ b/apps/web/src/app/admin-console/settings/create-organization.component.ts @@ -6,12 +6,13 @@ import { PlanType } from "@bitwarden/common/billing/enums"; import { ProductType } from "@bitwarden/common/enums"; import { OrganizationPlansComponent } from "../../billing"; +import { HeaderModule } from "../../layouts/header/header.module"; import { SharedModule } from "../../shared"; @Component({ templateUrl: "create-organization.component.html", standalone: true, - imports: [SharedModule, OrganizationPlansComponent], + imports: [SharedModule, OrganizationPlansComponent, HeaderModule], }) // eslint-disable-next-line rxjs-angular/prefer-takeuntil export class CreateOrganizationComponent implements OnInit { diff --git a/apps/web/src/app/admin-console/settings/sponsored-families.component.html b/apps/web/src/app/admin-console/settings/sponsored-families.component.html index f0151dfddd0..63fa370797a 100644 --- a/apps/web/src/app/admin-console/settings/sponsored-families.component.html +++ b/apps/web/src/app/admin-console/settings/sponsored-families.component.html @@ -1,104 +1,105 @@ - - - - {{ "loading" | i18n }} - - -

- {{ "sponsoredFamiliesEligible" | i18n }} -

-
- {{ "sponsoredFamiliesInclude" | i18n }}: -
    -
  • {{ "sponsoredFamiliesPremiumAccess" | i18n }}
  • -
  • {{ "sponsoredFamiliesSharedCollections" | i18n }}
  • -
-
-
-
- - -
-
- - - - - {{ "cannotSponsorSelf" | i18n }} - - - - {{ "invalidEmail" | i18n }} - -
-
- -
-
- -
- - - - - - - - - - - - - - -
{{ "recipient" | i18n }}{{ "sponsoringOrg" | i18n }}{{ "status" | i18n }}
-
- {{ "sponsoredFamiliesLeaveCopy" | i18n }} + + + + + + {{ "loading" | i18n }} -
+ +

+ {{ "sponsoredFamiliesEligible" | i18n }} +

+
+ {{ "sponsoredFamiliesInclude" | i18n }}: +
    +
  • {{ "sponsoredFamiliesPremiumAccess" | i18n }}
  • +
  • {{ "sponsoredFamiliesSharedCollections" | i18n }}
  • +
+
+
+
+ + +
+
+ + + + + {{ "cannotSponsorSelf" | i18n }} + + + + {{ "invalidEmail" | i18n }} + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + +
{{ "recipient" | i18n }}{{ "sponsoringOrg" | i18n }}{{ "status" | i18n }}
+
+ {{ "sponsoredFamiliesLeaveCopy" | i18n }} +
+
+ diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index 1a81ce555b7..f9479a92ce3 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -207,11 +207,6 @@ export class AppComponent implements OnDestroy, OnInit { case "showToast": this.showToast(message); break; - case "setFullWidth": - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.setFullWidth(); - break; case "convertAccountToKeyConnector": // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. // eslint-disable-next-line @typescript-eslint/no-floating-promises @@ -243,10 +238,6 @@ export class AppComponent implements OnDestroy, OnInit { new DisableSendPolicy(), new SendOptionsPolicy(), ]); - - // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. - // eslint-disable-next-line @typescript-eslint/no-floating-promises - this.setFullWidth(); } ngOnDestroy() { @@ -356,13 +347,4 @@ export class AppComponent implements OnDestroy, OnInit { this.notificationsService.reconnectFromActivity(); } } - - private async setFullWidth() { - const enableFullWidth = await this.stateService.getEnableFullWidth(); - if (enableFullWidth) { - document.body.classList.add("full-width"); - } else { - document.body.classList.remove("full-width"); - } - } } diff --git a/apps/web/src/app/auth/login/login.component.ts b/apps/web/src/app/auth/login/login.component.ts index bdf9f20032f..4440575cd66 100644 --- a/apps/web/src/app/auth/login/login.component.ts +++ b/apps/web/src/app/auth/login/login.component.ts @@ -88,9 +88,6 @@ export class LoginComponent extends BaseLoginComponent implements OnInit { ssoLoginService, webAuthnLoginService, ); - this.onSuccessfulLogin = async () => { - this.messagingService.send("setFullWidth"); - }; this.onSuccessfulLoginNavigate = this.goAfterLogIn; this.showPasswordless = flagEnabled("showPasswordless"); } diff --git a/apps/web/src/app/auth/settings/account/account.component.html b/apps/web/src/app/auth/settings/account/account.component.html index 84c0507e1ad..deb2f0ef301 100644 --- a/apps/web/src/app/auth/settings/account/account.component.html +++ b/apps/web/src/app/auth/settings/account/account.component.html @@ -1,27 +1,28 @@ - - + -
-

{{ "changeEmail" | i18n }}

- -
+ + - - - - - +
+

{{ "changeEmail" | i18n }}

+ +
- - - - - + + + + + + + + + + + +
diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.html b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.html index 48360621043..27bfc673ec4 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.html +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.html @@ -1,249 +1,265 @@ - -

- {{ "emergencyAccessDesc" | i18n }} - - {{ "learnMore" | i18n }}. - -

+ -

- {{ "warning" | i18n }}: {{ "emergencyAccessOwnerWarning" | i18n }} -

+ +

+ {{ "emergencyAccessDesc" | i18n }} + + {{ "learnMore" | i18n }}. + +

-