mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
[SM-487] Fix lock and logout (#4683)
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { Subject, takeUntil } from "rxjs";
|
||||
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import {
|
||||
ProjectDialogComponent,
|
||||
ProjectOperation,
|
||||
} from "../projects/dialog/project-dialog.component";
|
||||
import {
|
||||
OperationType,
|
||||
SecretDialogComponent,
|
||||
SecretOperation,
|
||||
} from "../secrets/dialog/secret-dialog.component";
|
||||
import {
|
||||
ServiceAccountDialogComponent,
|
||||
ServiceAccountOperation,
|
||||
} from "../service-accounts/dialog/service-account-dialog.component";
|
||||
|
||||
@Component({
|
||||
selector: "sm-new-menu",
|
||||
templateUrl: "./new-menu.component.html",
|
||||
})
|
||||
export class NewMenuComponent implements OnInit, OnDestroy {
|
||||
private organizationId: string;
|
||||
private destroy$: Subject<void> = new Subject<void>();
|
||||
|
||||
constructor(private route: ActivatedRoute, private dialogService: DialogService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.pipe(takeUntil(this.destroy$)).subscribe((params: any) => {
|
||||
this.organizationId = params.organizationId;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
openSecretDialog() {
|
||||
this.dialogService.open<unknown, SecretOperation>(SecretDialogComponent, {
|
||||
data: {
|
||||
organizationId: this.organizationId,
|
||||
operation: OperationType.Add,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
openProjectDialog() {
|
||||
this.dialogService.open<unknown, ProjectOperation>(ProjectDialogComponent, {
|
||||
data: {
|
||||
organizationId: this.organizationId,
|
||||
operation: OperationType.Add,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
openServiceAccountDialog() {
|
||||
this.dialogService.open<unknown, ServiceAccountOperation>(ServiceAccountDialogComponent, {
|
||||
data: {
|
||||
organizationId: this.organizationId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user