From bd03300ee0aed51fb8305bfaa4485c9c90d32345 Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Tue, 30 Jul 2019 10:30:19 +0200 Subject: [PATCH] Exports the settings for the dialogs to a separate file. - Includes a constant for small, medium and large dialogs. --- .../app/core/ui-services/choice.service.ts | 5 ++- .../attachment-control.component.ts | 7 ++--- .../copyright-sign.component.ts | 6 ++-- .../src/app/shared/utils/dialog-settings.ts | 31 +++++++++++++++++++ .../agenda-list/agenda-list.component.ts | 7 ++--- .../assignment-poll.component.ts | 6 ++-- .../mediafile-list.component.ts | 16 +++------- .../category-detail.component.ts | 8 ++--- .../motion-block-detail.component.ts | 8 ++--- .../motion-detail-diff.component.ts | 17 +++------- .../motion-detail/motion-detail.component.ts | 16 +++------- .../motion-poll/motion-poll.component.ts | 5 ++- .../motion-list/motion-list.component.ts | 12 ++----- .../workflow-detail.component.ts | 7 ++--- .../workflow-list/workflow-list.component.ts | 5 ++- .../projector-detail.component.ts | 11 ++----- .../group-list/group-list.component.ts | 8 ++--- .../user-list/user-list.component.ts | 8 ++--- 18 files changed, 75 insertions(+), 108 deletions(-) create mode 100644 client/src/app/shared/utils/dialog-settings.ts diff --git a/client/src/app/core/ui-services/choice.service.ts b/client/src/app/core/ui-services/choice.service.ts index c9622a846..9dcf2586a 100644 --- a/client/src/app/core/ui-services/choice.service.ts +++ b/client/src/app/core/ui-services/choice.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; +import { mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { ChoiceAnswer, ChoiceDialogComponent, @@ -42,9 +43,7 @@ export class ChoiceService { clearChoice?: string ): Promise { const dialogRef = this.dialog.open(ChoiceDialogComponent, { - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true, + ...mediumDialogSettings, data: { title: title, choices: choices, diff --git a/client/src/app/shared/components/attachment-control/attachment-control.component.ts b/client/src/app/shared/components/attachment-control/attachment-control.component.ts index 250ab54f4..5df19c9b4 100644 --- a/client/src/app/shared/components/attachment-control/attachment-control.component.ts +++ b/client/src/app/shared/components/attachment-control/attachment-control.component.ts @@ -5,6 +5,7 @@ import { MatDialog } from '@angular/material'; import { BehaviorSubject } from 'rxjs'; import { MediafileRepositoryService } from 'app/core/repositories/mediafiles/mediafile-repository.service'; +import { mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile'; @Component({ @@ -51,11 +52,7 @@ export class AttachmentControlComponent implements OnInit, ControlValueAccessor * @param dialog the dialog to open */ public openUploadDialog(dialog: TemplateRef): void { - this.dialogService.open(dialog, { - width: '750px', - maxWidth: '90vw', - maxHeight: '90vh' - }); + this.dialogService.open(dialog, mediumDialogSettings); } /** diff --git a/client/src/app/shared/components/copyright-sign/copyright-sign.component.ts b/client/src/app/shared/components/copyright-sign/copyright-sign.component.ts index 8c03dee36..996262ec9 100644 --- a/client/src/app/shared/components/copyright-sign/copyright-sign.component.ts +++ b/client/src/app/shared/components/copyright-sign/copyright-sign.component.ts @@ -9,6 +9,7 @@ import { Subscription } from 'rxjs'; import { NotifyResponse, NotifyService } from 'app/core/core-services/notify.service'; import { OperatorService } from 'app/core/core-services/operator.service'; +import { mediumDialogSettings } from 'app/shared/utils/dialog-settings'; /** * All player types. @@ -602,10 +603,7 @@ export class CopyrightSignComponent { if (this.clickCounter === 5) { this.clickCounter = 0; - this.dialog.open(C4DialogComponent, { - width: '550px', - disableClose: true - }); + this.dialog.open(C4DialogComponent, mediumDialogSettings); } else { this.clickTimeout = setTimeout(() => { this.clickCounter = 0; diff --git a/client/src/app/shared/utils/dialog-settings.ts b/client/src/app/shared/utils/dialog-settings.ts new file mode 100644 index 000000000..01674b7be --- /dev/null +++ b/client/src/app/shared/utils/dialog-settings.ts @@ -0,0 +1,31 @@ +/** + * General settings all dialogs are using. + */ +const generalSettings = { disableClose: true, maxWidth: '90vw', maxHeight: '90vh' }; + +/** + * Settings to display a large (wide) dialog. + * `width='1100px'` + */ +export const largeDialogSettings = { + width: '1100px', + ...generalSettings +}; + +/** + * Settings to display a medium dialog. + * `width='750px'` + */ +export const mediumDialogSettings = { + width: '750px', + ...generalSettings +}; + +/** + * Settings to display a small dialog. Useful for info-dialogs. + * `width='400px'` + */ +export const infoDialogSettings = { + width: '400px', + ...generalSettings +}; diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts index a877423cb..dd86f8fb1 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts @@ -22,6 +22,7 @@ import { PdfDocumentService } from 'app/core/ui-services/pdf-document.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { ViewportService } from 'app/core/ui-services/viewport.service'; import { ColumnRestriction } from 'app/shared/components/list-view-table/list-view-table.component'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseListViewComponent } from 'app/site/base/base-list-view'; import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable'; import { ViewTopic } from 'app/site/topics/models/view-topic'; @@ -190,11 +191,7 @@ export class AgendaListComponent extends BaseListViewComponent impleme if (this.isMultiSelect || !this.canManage) { return; } - const dialogRef = this.dialog.open(ItemInfoDialogComponent, { - width: '400px', - data: item, - disableClose: true - }); + const dialogRef = this.dialog.open(ItemInfoDialogComponent, infoDialogSettings); dialogRef.afterClosed().subscribe(result => { if (result) { diff --git a/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.ts b/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.ts index 4b6584305..7b76a530d 100644 --- a/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.ts +++ b/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.ts @@ -10,6 +10,7 @@ import { OperatorService } from 'app/core/core-services/operator.service'; import { AssignmentRepositoryService } from 'app/core/repositories/assignments/assignment-repository.service'; import { CalculablePollKey, MajorityMethod } from 'app/core/ui-services/poll.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; +import { mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { AssignmentPollDialogComponent } from '../assignment-poll-dialog/assignment-poll-dialog.component'; import { AssignmentPollPdfService } from '../../services/assignment-poll-pdf.service'; @@ -197,10 +198,7 @@ export class AssignmentPollComponent extends BaseViewComponent implements OnInit const dialogRef = this.dialog.open(AssignmentPollDialogComponent, { // TODO deep copy of this.poll (JSON parse is ugly workaround) or sending just copy of the options data: this.poll.copy(), - maxHeight: '90vh', - width: '600px', - maxWidth: '90vw', - disableClose: true + ...mediumDialogSettings }); dialogRef.afterClosed().subscribe(result => { if (result) { diff --git a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts index 5a130d6c8..9d9672efe 100644 --- a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts +++ b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.ts @@ -25,6 +25,7 @@ import { MediaManageService } from 'app/core/ui-services/media-manage.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { ViewportService } from 'app/core/ui-services/viewport.service'; import { Mediafile } from 'app/shared/models/mediafiles/mediafile'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile'; import { ViewGroup } from 'app/site/users/models/view-group'; @@ -306,12 +307,7 @@ export class MediafileListComponent extends BaseViewComponent implements OnInit, access_groups_id: [file.access_groups_id] }); - const dialogRef = this.dialog.open(this.fileEditDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + const dialogRef = this.dialog.open(this.fileEditDialog, infoDialogSettings); dialogRef.keydownEvents().subscribe((event: KeyboardEvent) => { if (event.key === 'Enter' && event.shiftKey && this.fileEditForm.valid) { @@ -410,9 +406,7 @@ export class MediafileListComponent extends BaseViewComponent implements OnInit, public createNewFolder(templateRef: TemplateRef): void { this.newDirectoryForm.reset(); - const dialogRef = this.dialog.open(templateRef, { - width: '400px' - }); + const dialogRef = this.dialog.open(templateRef, infoDialogSettings); dialogRef.afterClosed().subscribe(result => { if (result) { @@ -428,9 +422,7 @@ export class MediafileListComponent extends BaseViewComponent implements OnInit, public move(templateRef: TemplateRef, mediafile: ViewMediafile): void { this.newDirectoryForm.reset(); - const dialogRef = this.dialog.open(templateRef, { - width: '400px' - }); + const dialogRef = this.dialog.open(templateRef, infoDialogSettings); dialogRef.afterClosed().subscribe(result => { if (result) { diff --git a/client/src/app/site/motions/modules/category/components/category-detail/category-detail.component.ts b/client/src/app/site/motions/modules/category/components/category-detail/category-detail.component.ts index 95e3e4688..01c444cd9 100644 --- a/client/src/app/site/motions/modules/category/components/category-detail/category-detail.component.ts +++ b/client/src/app/site/motions/modules/category/components/category-detail/category-detail.component.ts @@ -12,6 +12,7 @@ import { OperatorService } from 'app/core/core-services/operator.service'; import { CategoryRepositoryService } from 'app/core/repositories/motions/category-repository.service'; import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ViewCategory } from 'app/site/motions/models/view-category'; import { ViewMotion } from 'app/site/motions/models/view-motion'; @@ -198,12 +199,7 @@ export class CategoryDetailComponent extends BaseViewComponent implements OnInit name: [this.selectedCategory.name, Validators.required] }); - this.dialog.open(this.editDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + this.dialog.open(this.editDialog, infoDialogSettings); } /** diff --git a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts index 94b85a63e..d0bab4a48 100644 --- a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts @@ -13,6 +13,7 @@ import { MotionBlockRepositoryService } from 'app/core/repositories/motions/moti import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { MotionBlock } from 'app/shared/models/motions/motion-block'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ViewMotion } from 'app/site/motions/models/view-motion'; import { ViewMotionBlock } from 'app/site/motions/models/view-motion-block'; @@ -219,12 +220,7 @@ export class MotionBlockDetailComponent extends BaseViewComponent implements OnI internal: [this.block.internal] }); - const dialogRef = this.dialog.open(this.editDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + const dialogRef = this.dialog.open(this.editDialog, infoDialogSettings); dialogRef.keydownEvents().subscribe((event: KeyboardEvent) => { if (event.key === 'Enter' && event.shiftKey) { diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts index 9d00c78d4..91f2889a7 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts @@ -10,6 +10,7 @@ import { ConfigService } from 'app/core/ui-services/config.service'; import { DiffService, LineRange } from 'app/core/ui-services/diff.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { ViewUnifiedChange, ViewUnifiedChangeType } from 'app/shared/models/motions/view-unified-change'; +import { mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { getRecommendationTypeName } from 'app/shared/utils/recommendation-type-names'; import { BaseViewComponent } from 'app/site/base/base-view'; import { LineNumberingMode, ViewMotion } from 'app/site/motions/models/view-motion'; @@ -324,12 +325,8 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte changeRecommendation: reco }; this.dialogService.open(MotionChangeRecommendationDialogComponent, { - height: '600px', - width: '800px', - maxHeight: '90vh', - maxWidth: '90vw', - data: data, - disableClose: true + ...mediumDialogSettings, + data: data }); } @@ -343,12 +340,8 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte changeRecommendation: reco }; this.dialogService.open(MotionTitleChangeRecommendationDialogComponent, { - height: '600px', - width: '800px', - maxHeight: '90vh', - maxWidth: '90vw', - data: data, - disableClose: true + ...mediumDialogSettings, + data: data }); } diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index 7d89d6923..4c26c6945 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -30,6 +30,7 @@ import { ViewportService } from 'app/core/ui-services/viewport.service'; import { Mediafile } from 'app/shared/models/mediafiles/mediafile'; import { Motion } from 'app/shared/models/motions/motion'; import { ViewUnifiedChange } from 'app/shared/models/motions/view-unified-change'; +import { infoDialogSettings, mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { CreateMotion } from 'app/site/motions/models/create-motion'; import { ViewCategory } from 'app/site/motions/models/view-category'; @@ -1037,12 +1038,8 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, ) }; this.dialogService.open(MotionChangeRecommendationDialogComponent, { - height: '600px', - width: '800px', - maxHeight: '90vh', - maxWidth: '90vw', - data: data, - disableClose: true + ...mediumDialogSettings, + data: data }); } @@ -1059,11 +1056,8 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, ) }; this.dialogService.open(MotionTitleChangeRecommendationDialogComponent, { - width: '400px', - maxHeight: '90vh', - maxWidth: '90vw', - data: data, - disableClose: true + ...infoDialogSettings, + data: data }); } diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-poll/motion-poll.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-poll/motion-poll.component.ts index 2710d1d51..5cdb6ade2 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-poll/motion-poll.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-poll/motion-poll.component.ts @@ -8,6 +8,7 @@ import { MotionRepositoryService } from 'app/core/repositories/motions/motion-re import { CalculablePollKey } from 'app/core/ui-services/poll.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { MotionPoll } from 'app/shared/models/motions/motion-poll'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { LocalPermissionsService } from 'app/site/motions/services/local-permissions.service'; import { MotionPollPdfService } from 'app/site/motions/services/motion-poll-pdf.service'; import { MotionPollService } from 'app/site/motions/services/motion-poll.service'; @@ -184,9 +185,7 @@ export class MotionPollComponent implements OnInit { public editPoll(): void { const dialogRef = this.dialog.open(MotionPollDialogComponent, { data: { ...this.poll }, - maxHeight: '90vh', - minWidth: '250px', - disableClose: true + ...infoDialogSettings }); dialogRef.afterClosed().subscribe(result => { if (result) { diff --git a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts index 121a5a50b..9b6e76e73 100644 --- a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts +++ b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts @@ -16,6 +16,7 @@ import { TagRepositoryService } from 'app/core/repositories/tags/tag-repository. import { ConfigService } from 'app/core/ui-services/config.service'; import { PdfError } from 'app/core/ui-services/pdf-document.service'; import { ColumnRestriction } from 'app/shared/components/list-view-table/list-view-table.component'; +import { infoDialogSettings, largeDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseListViewComponent } from 'app/site/base/base-list-view'; import { ViewCategory } from 'app/site/motions/models/view-category'; import { ViewMotion } from 'app/site/motions/models/view-motion'; @@ -300,9 +301,7 @@ export class MotionListComponent extends BaseListViewComponent imple */ public openExportDialog(): void { const exportDialogRef = this.dialog.open(MotionExportDialogComponent, { - width: '1100px', - maxWidth: '90vw', - maxHeight: '90vh', + ...largeDialogSettings, data: this.dataSource }); @@ -447,12 +446,7 @@ export class MotionListComponent extends BaseListViewComponent imple // Copies the interface to check, if changes were made. const copyDialog = { ...this.infoDialog }; - const dialogRef = this.dialog.open(this.motionInfoDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + const dialogRef = this.dialog.open(this.motionInfoDialog, infoDialogSettings); dialogRef.keydownEvents().subscribe((event: KeyboardEvent) => { if (event.key === 'Enter' && event.shiftKey) { diff --git a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts index 2cb97c964..03b985c2a 100644 --- a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts @@ -13,6 +13,7 @@ import { StateRepositoryService } from 'app/core/repositories/motions/state-repo import { WorkflowRepositoryService } from 'app/core/repositories/motions/workflow-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { MergeAmendment, State } from 'app/shared/models/motions/state'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ViewState } from 'app/site/motions/models/view-state'; import { ViewWorkflow } from 'app/site/motions/models/view-workflow'; @@ -344,11 +345,7 @@ export class WorkflowDetailComponent extends BaseViewComponent implements OnInit deletable: deletable }; - const dialogRef = this.dialog.open(this.workflowDialog, { - maxHeight: '90vh', - width: '400px', - maxWidth: '90vw' - }); + const dialogRef = this.dialog.open(this.workflowDialog, infoDialogSettings); return dialogRef.afterClosed(); } diff --git a/client/src/app/site/motions/modules/motion-workflow/components/workflow-list/workflow-list.component.ts b/client/src/app/site/motions/modules/motion-workflow/components/workflow-list/workflow-list.component.ts index 0ee19f0be..ccbf45a19 100644 --- a/client/src/app/site/motions/modules/motion-workflow/components/workflow-list/workflow-list.component.ts +++ b/client/src/app/site/motions/modules/motion-workflow/components/workflow-list/workflow-list.component.ts @@ -10,6 +10,7 @@ import { StorageService } from 'app/core/core-services/storage.service'; import { WorkflowRepositoryService } from 'app/core/repositories/motions/workflow-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { Workflow } from 'app/shared/models/motions/workflow'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseListViewComponent } from 'app/site/base/base-list-view'; import { ViewWorkflow } from 'app/site/motions/models/view-workflow'; @@ -76,9 +77,7 @@ export class WorkflowListComponent extends BaseListViewComponent i */ public onNewButton(templateRef: TemplateRef): void { this.newWorkflowTitle = ''; - const dialogRef = this.dialog.open(templateRef, { - width: '400px' - }); + const dialogRef = this.dialog.open(templateRef, infoDialogSettings); dialogRef.afterClosed().subscribe(result => { if (result) { diff --git a/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts b/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts index f9b1ccc7d..e91a4de5d 100644 --- a/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts +++ b/client/src/app/site/projector/components/projector-detail/projector-detail.component.ts @@ -18,6 +18,7 @@ import { DurationService } from 'app/core/ui-services/duration.service'; import { Countdown } from 'app/shared/models/core/countdown'; import { ProjectorElement } from 'app/shared/models/core/projector'; import { ProjectorMessage } from 'app/shared/models/core/projector-message'; +import { infoDialogSettings, mediumDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { Projectable } from 'app/site/base/projectable'; import { ViewCountdown } from 'app/site/projector/models/view-countdown'; @@ -207,10 +208,7 @@ export class ProjectorDetailComponent extends BaseViewComponent implements OnIni const dialogRef = this.dialog.open(CountdownDialogComponent, { data: countdownData, - maxHeight: '90vh', - width: '400px', - maxWidth: '90vw', - disableClose: true + ...infoDialogSettings }); dialogRef.afterClosed().subscribe(result => { @@ -238,10 +236,7 @@ export class ProjectorDetailComponent extends BaseViewComponent implements OnIni const dialogRef = this.dialog.open(MessageDialogComponent, { data: messageData, - maxHeight: '90vh', - width: '800px', - maxWidth: '90vw', - disableClose: true + ...mediumDialogSettings }); dialogRef.afterClosed().subscribe(result => { diff --git a/client/src/app/site/users/components/group-list/group-list.component.ts b/client/src/app/site/users/components/group-list/group-list.component.ts index 6aee1617e..19f074ab4 100644 --- a/client/src/app/site/users/components/group-list/group-list.component.ts +++ b/client/src/app/site/users/components/group-list/group-list.component.ts @@ -10,6 +10,7 @@ import { TranslateService } from '@ngx-translate/core'; import { AppPermissions, GroupRepositoryService } from 'app/core/repositories/users/group-repository.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { Group } from 'app/shared/models/users/group'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseViewComponent } from 'app/site/base/base-view'; import { ViewGroup } from '../../models/view-group'; @@ -96,12 +97,7 @@ export class GroupListComponent extends BaseViewComponent implements OnInit { name: [name, Validators.required] }); - const dialogRef = this.dialog.open(this.groupEditDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + const dialogRef = this.dialog.open(this.groupEditDialog, infoDialogSettings); dialogRef.keydownEvents().subscribe((event: KeyboardEvent) => { if (event.key === 'Enter' && event.shiftKey && this.groupForm.valid) { diff --git a/client/src/app/site/users/components/user-list/user-list.component.ts b/client/src/app/site/users/components/user-list/user-list.component.ts index cd6171112..3a761a65c 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.ts +++ b/client/src/app/site/users/components/user-list/user-list.component.ts @@ -17,6 +17,7 @@ import { ConfigService } from 'app/core/ui-services/config.service'; import { CsvExportService } from 'app/core/ui-services/csv-export.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { genders } from 'app/shared/models/users/user'; +import { infoDialogSettings } from 'app/shared/utils/dialog-settings'; import { BaseListViewComponent } from 'app/site/base/base-list-view'; import { UserFilterListService } from '../../services/user-filter-list.service'; import { UserPdfExportService } from '../../services/user-pdf-export.service'; @@ -219,12 +220,7 @@ export class UserListComponent extends BaseListViewComponent implement number: user.number }; - const dialogRef = this.dialog.open(this.userInfoDialog, { - width: '400px', - maxWidth: '90vw', - maxHeight: '90vh', - disableClose: true - }); + const dialogRef = this.dialog.open(this.userInfoDialog, infoDialogSettings); dialogRef.keydownEvents().subscribe((event: KeyboardEvent) => { if (event.key === 'Enter' && event.shiftKey) {