mirror of
https://github.com/bitwarden/browser
synced 2026-01-03 17:13:47 +00:00
[Account Switching] [Feature] Add the ability to maintain state for up to 5 accounts at once (#1079)
* [refactor] Remove references to deprecated services * [feature] Implement account switching * [bug] Fix state handling for authentication dependent system menu items * [bug] Enable the account switcher to fucntion properly when switching to a locked accounts * [feature] Enable locking any account from the menu * [bug] Ensure the avatar instance used in the account switcher updates on account change * [style] Fix lint complaints * [bug] Ensure the logout command callback can handle any user in state * [style] Fix lint complaints * rollup * [style] Fix lint complaints * [bug] Don't clean up state until everything else is done on logout * [bug] Navigate to vault on a succesful account switch * [bug] Init the state service on start * [feature] Limit account switching to 5 account maximum * [bug] Resolve app lock state with 5 logged out accounts * [chore] Update account refrences to match recent jslib restructuring * [bug] Add missing awaits * [bug] Update app menu on logout * [bug] Hide the switcher if there are no authed accounts * [bug] Move authenticationStatus display information out of jslib * [bug] Remove unused active style from scss * [refactor] Rewrite the menu bar * [style] Fix lint complaints * [bug] Clean state of loggout out user after redirect * [bug] Redirect on logout if not explicity provided a userId that isn't active * [bug] Relocated several settings items to persistant storage * [bug] Correct account switcher styles on all themes * [chore] Include state migration service in services * [bug] Swap to next account on logout * [bug] Correct DI service * [bug] fix loginGuard deps in services.module * [chore] update jslib * [bug] Remove badly merged scss * [chore] update jslib * [review] Code review cleanup * [review] Code review cleanup Co-authored-by: Hinton <oscar@oscarhinton.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { SendService } from 'jslib-common/abstractions/send.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
|
||||
import { AddEditComponent as BaseAddEditComponent } from 'jslib-angular/components/send/add-edit.component';
|
||||
|
||||
@@ -20,12 +20,12 @@ import { AddEditComponent as BaseAddEditComponent } from 'jslib-angular/componen
|
||||
export class AddEditComponent extends BaseAddEditComponent {
|
||||
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||
environmentService: EnvironmentService, datePipe: DatePipe,
|
||||
sendService: SendService, userService: UserService,
|
||||
sendService: SendService, stateService: StateService,
|
||||
messagingService: MessagingService, policyService: PolicyService,
|
||||
logService: LogService) {
|
||||
super(i18nService, platformUtilsService, environmentService,
|
||||
datePipe, sendService, userService, messagingService, policyService,
|
||||
logService);
|
||||
datePipe, sendService, messagingService, policyService,
|
||||
logService, stateService);
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { DatePipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
OnChanges,
|
||||
SimpleChanges,
|
||||
} from '@angular/core';
|
||||
|
||||
import { ControlContainer, NgForm } from '@angular/forms';
|
||||
|
||||
@@ -31,13 +31,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="items" class="items">
|
||||
<div class="header header-search">
|
||||
<div class="search">
|
||||
<input type="search" placeholder="{{'searchSends' | i18n}}" id="search"
|
||||
[(ngModel)]="searchText" (input)="searchTextChanged()" autocomplete="off" appAutofocus>
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="list" *ngIf="filteredSends.length">
|
||||
<a *ngFor="let s of filteredSends" appStopClick (click)="selectSend(s.id)"
|
||||
|
||||
@@ -14,7 +14,6 @@ import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.se
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
import { SendService } from 'jslib-common/abstractions/send.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { SendComponent as BaseSendComponent } from 'jslib-angular/components/send/send.component';
|
||||
|
||||
@@ -22,6 +21,7 @@ import { invokeMenu, RendererMenuItem } from 'jslib-electron/utils';
|
||||
|
||||
import { SendView } from 'jslib-common/models/view/sendView';
|
||||
|
||||
import { SearchBarService } from '../layout/search/search-bar.service';
|
||||
import { AddEditComponent } from './add-edit.component';
|
||||
|
||||
enum Action {
|
||||
@@ -46,13 +46,20 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
|
||||
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
||||
private broadcasterService: BroadcasterService, ngZone: NgZone,
|
||||
searchService: SearchService, policyService: PolicyService,
|
||||
userService: UserService, logService: LogService) {
|
||||
private searchBarService: SearchBarService, logService: LogService) {
|
||||
super(sendService, i18nService, platformUtilsService,
|
||||
environmentService, ngZone, searchService,
|
||||
policyService, userService, logService);
|
||||
policyService, logService);
|
||||
this.searchBarService.searchText.subscribe(searchText => {
|
||||
this.searchText = searchText;
|
||||
this.searchTextChanged();
|
||||
});
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.searchBarService.setEnabled(true);
|
||||
this.searchBarService.setPlaceholderText(this.i18nService.t('searchSends'));
|
||||
|
||||
super.ngOnInit();
|
||||
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {
|
||||
this.ngZone.run(async () => {
|
||||
@@ -68,6 +75,7 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro
|
||||
|
||||
ngOnDestroy() {
|
||||
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||
this.searchBarService.setEnabled(false);
|
||||
}
|
||||
|
||||
addSend() {
|
||||
|
||||
Reference in New Issue
Block a user