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