Skip to content

Commit

Permalink
[PM-7100] Remove conditional routing for extension refresh (#12485)
Browse files Browse the repository at this point in the history
* Remove conditional routing for new vault page (header/footer)

Redirect tabs/current to tabs/vault (new home)

* Remove unused TabsComponent

---------

Co-authored-by: Daniel James Smith <[email protected]>
  • Loading branch information
djsmith85 and djsmith85 authored Dec 20, 2024
1 parent a728331 commit acd3ab0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 86 deletions.
19 changes: 7 additions & 12 deletions apps/browser/src/popup/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ import { clearVaultStateGuard } from "../vault/guards/clear-vault-state.guard";
import { AddEditComponent } from "../vault/popup/components/vault/add-edit.component";
import { AttachmentsComponent } from "../vault/popup/components/vault/attachments.component";
import { CollectionsComponent } from "../vault/popup/components/vault/collections.component";
import { CurrentTabComponent } from "../vault/popup/components/vault/current-tab.component";
import { PasswordHistoryComponent } from "../vault/popup/components/vault/password-history.component";
import { ShareComponent } from "../vault/popup/components/vault/share.component";
import { VaultFilterComponent } from "../vault/popup/components/vault/vault-filter.component";
import { VaultItemsComponent } from "../vault/popup/components/vault/vault-items.component";
import { VaultV2Component } from "../vault/popup/components/vault/vault-v2.component";
import { ViewComponent } from "../vault/popup/components/vault/view.component";
Expand All @@ -130,7 +128,6 @@ import { VaultSettingsComponent } from "../vault/popup/settings/vault-settings.c
import { RouteElevation } from "./app-routing.animations";
import { debounceNavigationGuard } from "./services/debounce-navigation.service";
import { TabsV2Component } from "./tabs-v2.component";
import { TabsComponent } from "./tabs.component";

/**
* Data properties acceptable for use in extension route objects
Expand Down Expand Up @@ -748,8 +745,9 @@ const routes: Routes = [
},
],
},
...extensionRefreshSwap(TabsComponent, TabsV2Component, {
{
path: "tabs",
component: TabsV2Component,
data: { elevation: 0 } satisfies RouteDataProperties,
children: [
{
Expand All @@ -759,18 +757,15 @@ const routes: Routes = [
},
{
path: "current",
component: CurrentTabComponent,
canActivate: [authGuard],
canMatch: [extensionRefreshRedirect("/tabs/vault")],
data: { elevation: 0 } satisfies RouteDataProperties,
runGuardsAndResolvers: "always",
redirectTo: "/tabs/vault",
},
...extensionRefreshSwap(VaultFilterComponent, VaultV2Component, {
{
path: "vault",
component: VaultV2Component,
canActivate: [authGuard, NewDeviceVerificationNoticeGuard],
canDeactivate: [clearVaultStateGuard],
data: { elevation: 0 } satisfies RouteDataProperties,
}),
},
...extensionRefreshSwap(GeneratorComponent, CredentialGeneratorComponent, {
path: "generator",
canActivate: [authGuard],
Expand All @@ -788,7 +783,7 @@ const routes: Routes = [
data: { elevation: 0 } satisfies RouteDataProperties,
}),
],
}),
},
{
path: "account-switcher",
component: AccountSwitcherComponent,
Expand Down
2 changes: 0 additions & 2 deletions apps/browser/src/popup/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ import { AppComponent } from "./app.component";
import { UserVerificationComponent } from "./components/user-verification.component";
import { ServicesModule } from "./services/services.module";
import { TabsV2Component } from "./tabs-v2.component";
import { TabsComponent } from "./tabs.component";

// Register the locales for the application
import "../platform/popup/locales";
Expand Down Expand Up @@ -177,7 +176,6 @@ import "../platform/popup/locales";
ShareComponent,
SsoComponentV1,
SyncComponent,
TabsComponent,
TabsV2Component,
TwoFactorComponent,
TwoFactorOptionsComponent,
Expand Down
57 changes: 0 additions & 57 deletions apps/browser/src/popup/tabs.component.html

This file was deleted.

15 changes: 0 additions & 15 deletions apps/browser/src/popup/tabs.component.ts

This file was deleted.

0 comments on commit acd3ab0

Please sign in to comment.