From 7ce3c1717c6ff9483ff500bc9c88f86c101c75d5 Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Tue, 29 Nov 2022 14:00:08 -0500 Subject: [PATCH] remove overlay to center dialogs again (#4146) --- .../src/app/organizations/manage/collections.component.ts | 6 ++---- .../app/organizations/manage/group-add-edit.component.ts | 8 +------- apps/web/src/app/organizations/manage/groups.component.ts | 6 ++---- .../collection-dialog/collection-dialog.component.ts | 7 +------ 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/apps/web/src/app/organizations/manage/collections.component.ts b/apps/web/src/app/organizations/manage/collections.component.ts index 1d1562796cd..f9e4675448a 100644 --- a/apps/web/src/app/organizations/manage/collections.component.ts +++ b/apps/web/src/app/organizations/manage/collections.component.ts @@ -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 }, }); diff --git a/apps/web/src/app/organizations/manage/group-add-edit.component.ts b/apps/web/src/app/organizations/manage/group-add-edit.component.ts index e9348fda72d..ccf42cdc477 100644 --- a/apps/web/src/app/organizations/manage/group-add-edit.component.ts +++ b/apps/web/src/app/organizations/manage/group-add-edit.component.ts @@ -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 ) => { return dialogService.open( GroupAddEditComponent, - { - positionStrategy: overlay.position().global().centerHorizontally().top(), - ...config, - } + config ); }; diff --git a/apps/web/src/app/organizations/manage/groups.component.ts b/apps/web/src/app/organizations/manage/groups.component.ts index 65025b8b367..29827961c83 100644 --- a/apps/web/src/app/organizations/manage/groups.component.ts +++ b/apps/web/src/app/organizations/manage/groups.component.ts @@ -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, diff --git a/apps/web/src/app/organizations/shared/components/collection-dialog/collection-dialog.component.ts b/apps/web/src/app/organizations/shared/components/collection-dialog/collection-dialog.component.ts index 5e92674aa0f..1b41ba8bcae 100644 --- a/apps/web/src/app/organizations/shared/components/collection-dialog/collection-dialog.component.ts +++ b/apps/web/src/app/organizations/shared/components/collection-dialog/collection-dialog.component.ts @@ -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 ) { return dialogService.open( CollectionDialogComponent, - { - positionStrategy: overlay.position().global().centerHorizontally().top(), - ...config, - } + config ); }