mirror of
https://github.com/bitwarden/browser
synced 2026-03-01 19:11:22 +00:00
approach 1 of handling dialog close from menu item trigger
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
FormFieldModule,
|
||||
IconButtonModule,
|
||||
ToastService,
|
||||
DialogConfig,
|
||||
} from "@bitwarden/components";
|
||||
import { KeyService } from "@bitwarden/key-management";
|
||||
|
||||
@@ -175,10 +176,17 @@ export class AddEditFolderDialogComponent implements AfterViewInit, OnInit {
|
||||
this.dialogRef.close(result);
|
||||
}
|
||||
|
||||
static open(dialogService: DialogService, data?: AddEditFolderDialogData) {
|
||||
static open(
|
||||
dialogService: DialogService,
|
||||
data?: AddEditFolderDialogData,
|
||||
dialogConfig?: DialogConfig,
|
||||
) {
|
||||
return dialogService.open<AddEditFolderDialogResult, AddEditFolderDialogData>(
|
||||
AddEditFolderDialogComponent,
|
||||
{ data },
|
||||
{
|
||||
...dialogConfig,
|
||||
data,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
[bitMenuTriggerFor]="addOptions"
|
||||
id="newItemDropdown"
|
||||
[appA11yTitle]="'new' | i18n"
|
||||
#newItemDropdown
|
||||
>
|
||||
<i class="bwi bwi-plus" aria-hidden="true"></i>
|
||||
{{ "new" | i18n }}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, input, output } from "@angular/core";
|
||||
import { Component, input, output, viewChild } from "@angular/core";
|
||||
import { map, shareReplay } from "rxjs";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
import { RestrictedItemTypesService } from "@bitwarden/common/vault/services/restricted-item-types.service";
|
||||
import { CIPHER_MENU_ITEMS } from "@bitwarden/common/vault/types/cipher-menu-items";
|
||||
import { ButtonModule, MenuModule } from "@bitwarden/components";
|
||||
import { ButtonComponent, ButtonModule, MenuModule } from "@bitwarden/components";
|
||||
import { I18nPipe } from "@bitwarden/ui-common";
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
@@ -33,6 +33,8 @@ export class NewCipherMenuComponent {
|
||||
collectionAdded = output();
|
||||
cipherAdded = output<CipherType>();
|
||||
|
||||
readonly newCipherButton = viewChild<ButtonComponent>("newItemDropdown");
|
||||
|
||||
constructor(private restrictedItemTypesService: RestrictedItemTypesService) {}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user