From 58a5fbc2c6fc2ed878daf324c243ecbed168aa62 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 Signed-off-by: Jane Sandberg --- .../src/app/share/common-widgets.module.ts | 38 +++++++++++++++++++ .../src/eg2/src/app/share/grid/grid.module.ts | 4 +- .../src/eg2/src/app/staff/common.module.ts | 19 +++------- 3 files changed, 46 insertions(+), 15 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 454dcfb0ed..a6eb093dc0 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'; @@ -33,7 +34,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 bbf959c98c..66c62c32eb 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 {OrgFamilySelectComponent} from '@eg/share/org-family-select/org-family-select.component'; import {AccessKeyDirective} from '@eg/share/accesskey/accesskey.directive'; import {AccessKeyService} from '@eg/share/accesskey/accesskey.service'; @@ -17,7 +15,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'; @@ -32,9 +29,6 @@ import {ReactiveFormsModule} from '@angular/forms'; @NgModule({ declarations: [ StaffBannerComponent, - ComboboxComponent, - ComboboxEntryComponent, - OrgSelectComponent, OrgFamilySelectComponent, AccessKeyDirective, AccessKeyInfoComponent, @@ -43,7 +37,6 @@ import {ReactiveFormsModule} from '@angular/forms'; TitleComponent, OpChangeComponent, FmRecordEditorComponent, - DateSelectComponent, BucketDialogComponent, BibSummaryComponent, TranslateComponent, @@ -52,16 +45,15 @@ import {ReactiveFormsModule} from '@angular/forms'; ], imports: [ EgCommonModule, - GridModule, - ReactiveFormsModule + ReactiveFormsModule, + CommonWidgetsModule, + GridModule ], exports: [ EgCommonModule, + CommonWidgetsModule, GridModule, StaffBannerComponent, - ComboboxComponent, - ComboboxEntryComponent, - OrgSelectComponent, OrgFamilySelectComponent, AccessKeyDirective, AccessKeyInfoComponent, @@ -70,7 +62,6 @@ import {ReactiveFormsModule} from '@angular/forms'; TitleComponent, OpChangeComponent, FmRecordEditorComponent, - DateSelectComponent, BucketDialogComponent, BibSummaryComponent, TranslateComponent, -- 2.43.2