LP#1831788: create CommonWidgetsModule
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 25 Mar 2019 19:27:05 +0000 (15:27 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 14 Jun 2019 15:53:05 +0000 (11:53 -0400)
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 <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/common-widgets.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/grid/grid.module.ts
Open-ILS/src/eg2/src/app/staff/common.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 (file)
index 0000000..0f15c98
--- /dev/null
@@ -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 { }
index 0773a7e..649b39a 100644 (file)
@@ -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
index 5575b70..949b379 100644 (file)
@@ -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,