mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
remove overlay to center dialogs again (#4146)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Overlay } from "@angular/cdk/overlay";
|
||||
import { Component, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { lastValueFrom } from "rxjs";
|
||||
@@ -61,8 +60,7 @@ export class CollectionsComponent implements OnInit {
|
||||
private searchService: SearchService,
|
||||
private logService: LogService,
|
||||
private organizationService: OrganizationService,
|
||||
private dialogService: DialogService,
|
||||
private overlay: Overlay
|
||||
private dialogService: DialogService
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -132,7 +130,7 @@ export class CollectionsComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
const dialog = openCollectionDialog(this.dialogService, this.overlay, {
|
||||
const dialog = openCollectionDialog(this.dialogService, {
|
||||
data: { collectionId: collection?.id, organizationId: this.organizationId },
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog";
|
||||
import { Overlay } from "@angular/cdk/overlay";
|
||||
import { ChangeDetectorRef, Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||
import { FormBuilder, FormControl, Validators } from "@angular/forms";
|
||||
import { catchError, combineLatest, from, map, of, Subject, switchMap, takeUntil } from "rxjs";
|
||||
@@ -62,20 +61,15 @@ export enum GroupAddEditDialogResultType {
|
||||
/**
|
||||
* Strongly typed helper to open a groupAddEditDialog
|
||||
* @param dialogService Instance of the dialog service that will be used to open the dialog
|
||||
* @param overlay Instance of the CDK Overlay service
|
||||
* @param config Configuration for the dialog
|
||||
*/
|
||||
export const openGroupAddEditDialog = (
|
||||
dialogService: DialogService,
|
||||
overlay: Overlay,
|
||||
config: DialogConfig<GroupAddEditDialogParams>
|
||||
) => {
|
||||
return dialogService.open<GroupAddEditDialogResultType, GroupAddEditDialogParams>(
|
||||
GroupAddEditComponent,
|
||||
{
|
||||
positionStrategy: overlay.position().global().centerHorizontally().top(),
|
||||
...config,
|
||||
}
|
||||
config
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Overlay } from "@angular/cdk/overlay";
|
||||
import { Component, OnDestroy, OnInit, ViewChild, ViewContainerRef } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import {
|
||||
@@ -134,8 +133,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||
private searchService: SearchService,
|
||||
private logService: LogService,
|
||||
private collectionService: CollectionService,
|
||||
private searchPipe: SearchPipe,
|
||||
private overlay: Overlay
|
||||
private searchPipe: SearchPipe
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -214,7 +212,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||
group: GroupDetailsRow,
|
||||
startingTabIndex: GroupAddEditTabType = GroupAddEditTabType.Info
|
||||
) {
|
||||
const dialogRef = openGroupAddEditDialog(this.dialogService, this.overlay, {
|
||||
const dialogRef = openGroupAddEditDialog(this.dialogService, {
|
||||
data: {
|
||||
initialTab: startingTabIndex,
|
||||
organizationId: this.organizationId,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog";
|
||||
import { Overlay } from "@angular/cdk/overlay";
|
||||
import { Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
import { combineLatest, of, shareReplay, Subject, switchMap, takeUntil } from "rxjs";
|
||||
@@ -253,14 +252,10 @@ function mapToAccessSelections(collectionDetails: CollectionAdminView): AccessIt
|
||||
*/
|
||||
export function openCollectionDialog(
|
||||
dialogService: DialogService,
|
||||
overlay: Overlay,
|
||||
config: DialogConfig<CollectionDialogParams>
|
||||
) {
|
||||
return dialogService.open<CollectionDialogResult, CollectionDialogParams>(
|
||||
CollectionDialogComponent,
|
||||
{
|
||||
positionStrategy: overlay.position().global().centerHorizontally().top(),
|
||||
...config,
|
||||
}
|
||||
config
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user