mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-21 21:11:35 +01:00
[SM-487] Fix lock and logout (#4683)
This commit is contained in:
parent
4438ab9e3a
commit
c3dfb7735f
@ -12,12 +12,12 @@ import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { ProjectListView } from "../../models/view/project-list.view";
|
||||
import {
|
||||
BulkOperationStatus,
|
||||
BulkStatusDetails,
|
||||
BulkStatusDialogComponent,
|
||||
} from "../../layout/dialogs/bulk-status-dialog.component";
|
||||
import { ProjectListView } from "../../models/view/project-list.view";
|
||||
} from "../../shared/dialogs/bulk-status-dialog.component";
|
||||
import { ProjectService } from "../project.service";
|
||||
|
||||
export interface ProjectDeleteOperation {
|
||||
|
@ -8,9 +8,9 @@ import { EncString } from "@bitwarden/common/models/domain/enc-string";
|
||||
import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetric-crypto-key";
|
||||
import { ListResponse } from "@bitwarden/common/models/response/list.response";
|
||||
|
||||
import { BulkOperationStatus } from "../layout/dialogs/bulk-status-dialog.component";
|
||||
import { ProjectListView } from "../models/view/project-list.view";
|
||||
import { ProjectView } from "../models/view/project.view";
|
||||
import { BulkOperationStatus } from "../shared/dialogs/bulk-status-dialog.component";
|
||||
|
||||
import { ProjectRequest } from "./models/requests/project.request";
|
||||
import { ProjectListItemResponse } from "./models/responses/project-list-item.response";
|
||||
|
@ -67,11 +67,11 @@
|
||||
|
||||
<bit-menu-divider></bit-menu-divider>
|
||||
|
||||
<button bitMenuItem type="button">
|
||||
<button bitMenuItem type="button" (click)="lock()">
|
||||
<i class="bwi bwi-fw bwi-lock" aria-hidden="true"></i>
|
||||
{{ "lockNow" | i18n }}
|
||||
</button>
|
||||
<button bitMenuItem type="button">
|
||||
<button bitMenuItem type="button" (click)="logout()">
|
||||
<i class="bwi bwi-fw bwi-sign-out" aria-hidden="true"></i>
|
||||
{{ "logOut" | i18n }}
|
||||
</button>
|
@ -2,6 +2,7 @@ import { Component, Input } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { combineLatest, map, Observable } from "rxjs";
|
||||
|
||||
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
|
||||
import { StateService } from "@bitwarden/common/abstractions/state.service";
|
||||
import { AccountProfile } from "@bitwarden/common/models/domain/account";
|
||||
|
||||
@ -23,7 +24,11 @@ export class HeaderComponent {
|
||||
protected routeData$: Observable<{ titleId: string }>;
|
||||
protected account$: Observable<AccountProfile>;
|
||||
|
||||
constructor(private route: ActivatedRoute, private stateService: StateService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private stateService: StateService,
|
||||
private messagingService: MessagingService
|
||||
) {
|
||||
this.routeData$ = this.route.data.pipe(
|
||||
map((params) => {
|
||||
return {
|
||||
@ -41,4 +46,12 @@ export class HeaderComponent {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
protected lock() {
|
||||
this.messagingService.send("lockVault");
|
||||
}
|
||||
|
||||
protected logout() {
|
||||
this.messagingService.send("logout");
|
||||
}
|
||||
}
|
@ -5,12 +5,11 @@ import { ProductSwitcherModule } from "@bitwarden/web-vault/app/layouts/product-
|
||||
import { CoreOrganizationModule } from "@bitwarden/web-vault/app/organizations/core";
|
||||
import { SharedModule } from "@bitwarden/web-vault/app/shared";
|
||||
|
||||
import { BulkStatusDialogComponent } from "../layout/dialogs/bulk-status-dialog.component";
|
||||
import { HeaderComponent } from "../layout/header.component";
|
||||
import { NewMenuComponent } from "../layout/new-menu.component";
|
||||
import { NoItemsComponent } from "../layout/no-items.component";
|
||||
|
||||
import { AccessSelectorComponent } from "./access-policies/access-selector.component";
|
||||
import { BulkStatusDialogComponent } from "./dialogs/bulk-status-dialog.component";
|
||||
import { HeaderComponent } from "./header.component";
|
||||
import { NewMenuComponent } from "./new-menu.component";
|
||||
import { NoItemsComponent } from "./no-items.component";
|
||||
import { SecretsListComponent } from "./secrets-list.component";
|
||||
|
||||
@NgModule({
|
||||
|
Loading…
Reference in New Issue
Block a user