mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-11 13:30:39 +01:00
[PM-7100] Remove conditional routing for extension refresh (#12485)
* 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 <djsmith85@users.noreply.github.com>
This commit is contained in:
parent
a728331ec1
commit
acd3ab05f6
@ -105,10 +105,8 @@ import { clearVaultStateGuard } from "../vault/guards/clear-vault-state.guard";
|
|||||||
import { AddEditComponent } from "../vault/popup/components/vault/add-edit.component";
|
import { AddEditComponent } from "../vault/popup/components/vault/add-edit.component";
|
||||||
import { AttachmentsComponent } from "../vault/popup/components/vault/attachments.component";
|
import { AttachmentsComponent } from "../vault/popup/components/vault/attachments.component";
|
||||||
import { CollectionsComponent } from "../vault/popup/components/vault/collections.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 { PasswordHistoryComponent } from "../vault/popup/components/vault/password-history.component";
|
||||||
import { ShareComponent } from "../vault/popup/components/vault/share.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 { VaultItemsComponent } from "../vault/popup/components/vault/vault-items.component";
|
||||||
import { VaultV2Component } from "../vault/popup/components/vault/vault-v2.component";
|
import { VaultV2Component } from "../vault/popup/components/vault/vault-v2.component";
|
||||||
import { ViewComponent } from "../vault/popup/components/vault/view.component";
|
import { ViewComponent } from "../vault/popup/components/vault/view.component";
|
||||||
@ -130,7 +128,6 @@ import { VaultSettingsComponent } from "../vault/popup/settings/vault-settings.c
|
|||||||
import { RouteElevation } from "./app-routing.animations";
|
import { RouteElevation } from "./app-routing.animations";
|
||||||
import { debounceNavigationGuard } from "./services/debounce-navigation.service";
|
import { debounceNavigationGuard } from "./services/debounce-navigation.service";
|
||||||
import { TabsV2Component } from "./tabs-v2.component";
|
import { TabsV2Component } from "./tabs-v2.component";
|
||||||
import { TabsComponent } from "./tabs.component";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data properties acceptable for use in extension route objects
|
* Data properties acceptable for use in extension route objects
|
||||||
@ -748,8 +745,9 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
...extensionRefreshSwap(TabsComponent, TabsV2Component, {
|
{
|
||||||
path: "tabs",
|
path: "tabs",
|
||||||
|
component: TabsV2Component,
|
||||||
data: { elevation: 0 } satisfies RouteDataProperties,
|
data: { elevation: 0 } satisfies RouteDataProperties,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@ -759,18 +757,15 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "current",
|
path: "current",
|
||||||
component: CurrentTabComponent,
|
redirectTo: "/tabs/vault",
|
||||||
canActivate: [authGuard],
|
|
||||||
canMatch: [extensionRefreshRedirect("/tabs/vault")],
|
|
||||||
data: { elevation: 0 } satisfies RouteDataProperties,
|
|
||||||
runGuardsAndResolvers: "always",
|
|
||||||
},
|
},
|
||||||
...extensionRefreshSwap(VaultFilterComponent, VaultV2Component, {
|
{
|
||||||
path: "vault",
|
path: "vault",
|
||||||
|
component: VaultV2Component,
|
||||||
canActivate: [authGuard, NewDeviceVerificationNoticeGuard],
|
canActivate: [authGuard, NewDeviceVerificationNoticeGuard],
|
||||||
canDeactivate: [clearVaultStateGuard],
|
canDeactivate: [clearVaultStateGuard],
|
||||||
data: { elevation: 0 } satisfies RouteDataProperties,
|
data: { elevation: 0 } satisfies RouteDataProperties,
|
||||||
}),
|
},
|
||||||
...extensionRefreshSwap(GeneratorComponent, CredentialGeneratorComponent, {
|
...extensionRefreshSwap(GeneratorComponent, CredentialGeneratorComponent, {
|
||||||
path: "generator",
|
path: "generator",
|
||||||
canActivate: [authGuard],
|
canActivate: [authGuard],
|
||||||
@ -788,7 +783,7 @@ const routes: Routes = [
|
|||||||
data: { elevation: 0 } satisfies RouteDataProperties,
|
data: { elevation: 0 } satisfies RouteDataProperties,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
},
|
||||||
{
|
{
|
||||||
path: "account-switcher",
|
path: "account-switcher",
|
||||||
component: AccountSwitcherComponent,
|
component: AccountSwitcherComponent,
|
||||||
|
@ -88,7 +88,6 @@ import { AppComponent } from "./app.component";
|
|||||||
import { UserVerificationComponent } from "./components/user-verification.component";
|
import { UserVerificationComponent } from "./components/user-verification.component";
|
||||||
import { ServicesModule } from "./services/services.module";
|
import { ServicesModule } from "./services/services.module";
|
||||||
import { TabsV2Component } from "./tabs-v2.component";
|
import { TabsV2Component } from "./tabs-v2.component";
|
||||||
import { TabsComponent } from "./tabs.component";
|
|
||||||
|
|
||||||
// Register the locales for the application
|
// Register the locales for the application
|
||||||
import "../platform/popup/locales";
|
import "../platform/popup/locales";
|
||||||
@ -177,7 +176,6 @@ import "../platform/popup/locales";
|
|||||||
ShareComponent,
|
ShareComponent,
|
||||||
SsoComponentV1,
|
SsoComponentV1,
|
||||||
SyncComponent,
|
SyncComponent,
|
||||||
TabsComponent,
|
|
||||||
TabsV2Component,
|
TabsV2Component,
|
||||||
TwoFactorComponent,
|
TwoFactorComponent,
|
||||||
TwoFactorOptionsComponent,
|
TwoFactorOptionsComponent,
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
<div class="tab-page">
|
|
||||||
<router-outlet></router-outlet>
|
|
||||||
<nav class="tabs">
|
|
||||||
<ul>
|
|
||||||
<li routerLinkActive="active" #rlaCurrentTab="routerLinkActive" *ngIf="showCurrentTab">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
routerLink="current"
|
|
||||||
appA11yTitle="{{ 'currentTab' | i18n }}"
|
|
||||||
[attr.aria-pressed]="rlaCurrentTab.isActive"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-folder-closed-f bwi-2x" aria-hidden="true"></i>{{ "tab" | i18n }}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li routerLinkActive="active" #rlaMyVault="routerLinkActive">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
routerLink="vault"
|
|
||||||
appA11yTitle="{{ 'myVault' | i18n }}"
|
|
||||||
[attr.aria-pressed]="rlaMyVault.isActive"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-lock-f bwi-2x" aria-hidden="true"></i>{{ "vault" | i18n }}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li routerLinkActive="active" #rlaSend="routerLinkActive">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
routerLink="send"
|
|
||||||
appA11yTitle="{{ 'send' | i18n }}"
|
|
||||||
[attr.aria-pressed]="rlaSend.isActive"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-send-f bwi-2x" aria-hidden="true"></i>{{ "send" | i18n }}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li routerLinkActive="active" #rlaGenerator="routerLinkActive">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
routerLink="generator"
|
|
||||||
appA11yTitle="{{ 'passGen' | i18n }}"
|
|
||||||
[attr.aria-pressed]="rlaGenerator.isActive"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-generate-f bwi-2x" aria-hidden="true"></i>{{ "generator" | i18n }}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
<li routerLinkActive="active" #rlaSettings="routerLinkActive">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
routerLink="settings"
|
|
||||||
appA11yTitle="{{ 'settings' | i18n }}"
|
|
||||||
[attr.aria-pressed]="rlaSettings.isActive"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-cog-f bwi-2x" aria-hidden="true"></i>{{ "settings" | i18n }}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
@ -1,15 +0,0 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
|
||||||
|
|
||||||
import BrowserPopupUtils from "../platform/popup/browser-popup-utils";
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: "app-tabs",
|
|
||||||
templateUrl: "tabs.component.html",
|
|
||||||
})
|
|
||||||
export class TabsComponent implements OnInit {
|
|
||||||
showCurrentTab = true;
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.showCurrentTab = !BrowserPopupUtils.inPopout(window);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user