From eb7e61fe21110cff07abfc8a2f99aa0a62a00e70 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 25 Mar 2019 15:27:05 -0400 Subject: [PATCH] LP#1831788: create CommonWidgetsModule This patch moves some commonly-shared components off to a separate module. The immediate motivation is to avoid circular dependencies when adding filtering widgets to eg-grid. Components included in CommonWidgetsModule should be "core" in the sense that they are unlikely to ever need to embed one another. Sponsored-by: MassLNC Sponsored-by: Georgia Public Library Service Sponsored-by: Indiana State Library Sponsored-by: CW MARS Sponsored-by: King County Library System Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- .../src/eg2/src/app/share/common-widgets.module.ts | 38 ++++++++++++++++++++++ Open-ILS/src/eg2/src/app/share/grid/grid.module.ts | 4 ++- Open-ILS/src/eg2/src/app/staff/common.module.ts | 15 ++------- 3 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 Open-ILS/src/eg2/src/app/share/common-widgets.module.ts diff --git a/Open-ILS/src/eg2/src/app/share/common-widgets.module.ts b/Open-ILS/src/eg2/src/app/share/common-widgets.module.ts new file mode 100644 index 0000000000..0f15c98b67 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/common-widgets.module.ts @@ -0,0 +1,38 @@ +/* + Module for grouping commonly used widgets that might be embedded + in other shared components. Components included here should be + unlikely to ever need to embed one another. +*/ +import {NgModule, ModuleWithProviders} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {ComboboxComponent} from '@eg/share/combobox/combobox.component'; +import {ComboboxEntryComponent} from '@eg/share/combobox/combobox-entry.component'; +import {DateSelectComponent} from '@eg/share/date-select/date-select.component'; +import {OrgSelectComponent} from '@eg/share/org-select/org-select.component'; + +@NgModule({ + declarations: [ + ComboboxComponent, + ComboboxEntryComponent, + DateSelectComponent, + OrgSelectComponent + ], + imports: [ + CommonModule, + FormsModule, + NgbModule + ], + exports: [ + CommonModule, + FormsModule, + NgbModule, + ComboboxComponent, + ComboboxEntryComponent, + DateSelectComponent, + OrgSelectComponent + ], +}) + +export class CommonWidgetsModule { } diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts index 0773a7e56f..649b39a822 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.module.ts @@ -1,5 +1,6 @@ import {NgModule} from '@angular/core'; import {EgCommonModule} from '@eg/common.module'; +import {CommonWidgetsModule} from '@eg/share/common-widgets.module'; import {GridComponent} from './grid.component'; import {GridColumnComponent} from './grid-column.component'; import {GridHeaderComponent} from './grid-header.component'; @@ -31,7 +32,8 @@ import {GridPrintComponent} from './grid-print.component'; GridPrintComponent ], imports: [ - EgCommonModule + EgCommonModule, + CommonWidgetsModule ], exports: [ // public components diff --git a/Open-ILS/src/eg2/src/app/staff/common.module.ts b/Open-ILS/src/eg2/src/app/staff/common.module.ts index 5575b70c3a..949b379cd2 100644 --- a/Open-ILS/src/eg2/src/app/staff/common.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/common.module.ts @@ -1,11 +1,9 @@ import {NgModule, ModuleWithProviders} from '@angular/core'; import {EgCommonModule} from '@eg/common.module'; +import {CommonWidgetsModule} from '@eg/share/common-widgets.module'; import {AudioService} from '@eg/share/util/audio.service'; import {GridModule} from '@eg/share/grid/grid.module'; import {StaffBannerComponent} from './share/staff-banner.component'; -import {ComboboxComponent} from '@eg/share/combobox/combobox.component'; -import {ComboboxEntryComponent} from '@eg/share/combobox/combobox-entry.component'; -import {OrgSelectComponent} from '@eg/share/org-select/org-select.component'; import {AccessKeyDirective} from '@eg/share/accesskey/accesskey.directive'; import {AccessKeyService} from '@eg/share/accesskey/accesskey.service'; import {AccessKeyInfoComponent} from '@eg/share/accesskey/accesskey-info.component'; @@ -16,7 +14,6 @@ import {StringComponent} from '@eg/share/string/string.component'; import {StringService} from '@eg/share/string/string.service'; import {TitleComponent} from '@eg/share/title/title.component'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; -import {DateSelectComponent} from '@eg/share/date-select/date-select.component'; import {BucketDialogComponent} from '@eg/staff/share/buckets/bucket-dialog.component'; import {BibSummaryComponent} from '@eg/staff/share/bib-summary/bib-summary.component'; import {TranslateComponent} from '@eg/staff/share/translate/translate.component'; @@ -30,9 +27,6 @@ import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover. @NgModule({ declarations: [ StaffBannerComponent, - ComboboxComponent, - ComboboxEntryComponent, - OrgSelectComponent, AccessKeyDirective, AccessKeyInfoComponent, ToastComponent, @@ -40,7 +34,6 @@ import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover. TitleComponent, OpChangeComponent, FmRecordEditorComponent, - DateSelectComponent, BucketDialogComponent, BibSummaryComponent, TranslateComponent, @@ -49,15 +42,14 @@ import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover. ], imports: [ EgCommonModule, + CommonWidgetsModule, GridModule ], exports: [ EgCommonModule, + CommonWidgetsModule, GridModule, StaffBannerComponent, - ComboboxComponent, - ComboboxEntryComponent, - OrgSelectComponent, AccessKeyDirective, AccessKeyInfoComponent, ToastComponent, @@ -65,7 +57,6 @@ import {EgHelpPopoverComponent} from '@eg/share/eg-help-popover/eg-help-popover. TitleComponent, OpChangeComponent, FmRecordEditorComponent, - DateSelectComponent, BucketDialogComponent, BibSummaryComponent, TranslateComponent, -- 2.11.0