LP#1831788: create CommonWidgetsModule
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 25 Mar 2019 19:27:05 +0000 (15:27 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 1 Aug 2019 13:49:09 +0000 (09:49 -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>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
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 454dcfb..a6eb093 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';
@@ -33,7 +34,8 @@ import {GridPrintComponent} from './grid-print.component';
         GridPrintComponent
     ],
     imports: [
-        EgCommonModule
+        EgCommonModule,
+        CommonWidgetsModule
     ],
     exports: [
         // public components
index bbf959c..66c62c3 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 {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,