Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/src/app/layouts/user-layout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[spotlight]="true"
></bit-nav-item>
<app-coachmark #importCoachmark stepId="importData" />
<bit-nav-item [text]="'exportNoun' | i18n" route="tools/export"></bit-nav-item>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for VFO1? Should it be feature-flagged?

@itsadrago itsadrago Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe so. Good point. Do we need to create a FF or is there an existing one that should be used?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vault already made one! VFO1Foundation = "vfo1-foundation"

<bit-nav-item [text]="'exportNoun' | i18n" [route]="exportRoute()"></bit-nav-item>
</bit-nav-group>
<bit-nav-item
icon="bwi-sliders"
Expand Down
12 changes: 12 additions & 0 deletions apps/web/src/app/layouts/user-layout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { canAccessEmergencyAccess } from "@bitwarden/common/admin-console/abstra
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { SyncService } from "@bitwarden/common/platform/sync";
import { PopoverModule, SideNavService, SvgModule } from "@bitwarden/components";
import { SendPolicyService } from "@bitwarden/send-ui";
Expand Down Expand Up @@ -48,6 +50,16 @@ export class UserLayoutComponent implements OnInit {

protected readonly coachmarkService = inject(CoachmarkService);
protected readonly sideNavService = inject(SideNavService);
private readonly configService = inject(ConfigService);

protected readonly exportRoute = computed(() => {
const vfo1Enabled = this.vfo1Enabled();
return vfo1Enabled ? "/settings/export" : "/tools/export";
});

protected readonly vfo1Enabled = toSignal(
this.configService.getFeatureFlag$(FeatureFlag.VFO1Foundation),
);

protected readonly importCoachmarkOpen = computed(
() => this.coachmarkService.activeStepId() === "importData",
Expand Down
25 changes: 23 additions & 2 deletions apps/web/src/app/oss-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NgModule } from "@angular/core";
import { Route, RouterModule, Routes } from "@angular/router";
import { NgModule, inject } from "@angular/core";
import { Route, Router, RouterModule, Routes } from "@angular/router";
import { map, switchMap } from "rxjs";

import { organizationPolicyGuard } from "@bitwarden/angular/admin-console/guards";
Expand Down Expand Up @@ -53,6 +53,7 @@ import {
import { canAccessEmergencyAccess } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { PolicyType } from "@bitwarden/common/admin-console/enums";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { AnonLayoutWrapperComponent, AnonLayoutWrapperData } from "@bitwarden/components";
import { LockComponent, RemovePasswordComponent } from "@bitwarden/key-management-ui";
import { premiumInterestRedirectGuard } from "@bitwarden/web-vault/app/vault/guards/premium-interest-redirect/premium-interest-redirect.guard";
Expand Down Expand Up @@ -773,6 +774,17 @@ const routes: Routes = [
component: SponsoredFamiliesComponent,
data: { titleId: "sponsoredFamilies" } satisfies RouteDataProperties,
},
{
path: "export",
loadComponent: () =>
import("./tools/vault-export/export-web.component").then(
(mod) => mod.ExportWebComponent,
),
canActivate: [canAccessFeature(FeatureFlag.VFO1Foundation)],
data: {
titleId: "exportNoun",
} satisfies RouteDataProperties,
},
],
},
{
Expand All @@ -794,6 +806,7 @@ const routes: Routes = [
import("./tools/vault-export/export-web.component").then(
(mod) => mod.ExportWebComponent,
),
canActivate: [vfo1ConditionalRedirect],
data: {
titleId: "exportNoun",
} satisfies RouteDataProperties,
Expand All @@ -819,6 +832,14 @@ const routes: Routes = [
},
];

function vfo1ConditionalRedirect() {
const configService = inject(ConfigService);
const router = inject(Router);
return configService
.getFeatureFlag$(FeatureFlag.VFO1Foundation)
.pipe(map((isEnabled) => (isEnabled ? router.parseUrl("/settings/export") : true)));
}

@NgModule({
imports: [
RouterModule.forRoot(routes, {
Expand Down
Loading