LP#1779158 Angular vandelay module, routing, stub modules
authorBill Erickson <berickxx@gmail.com>
Thu, 28 Jun 2018 22:23:39 +0000 (18:23 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 11 Oct 2018 18:56:30 +0000 (14:56 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/routing.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/eg2/src/app/staff/routing.module.ts

diff --git a/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/routing.module.ts
new file mode 100644 (file)
index 0000000..a923b46
--- /dev/null
@@ -0,0 +1,15 @@
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+
+const routes: Routes = [
+  { path: 'vandelay',
+    loadChildren: '@eg/staff/cat/vandelay/vandelay.module#VandelayModule'
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+
+export class CatRoutingModule {}
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.html
new file mode 100644 (file)
index 0000000..41a4880
--- /dev/null
@@ -0,0 +1 @@
+EXPORT COMPONENT
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/export.component.ts
new file mode 100644 (file)
index 0000000..4f64a3e
--- /dev/null
@@ -0,0 +1,14 @@
+import {Component, OnInit} from '@angular/core';
+
+@Component({
+  templateUrl: 'export.component.html'
+})
+export class ExportComponent implements OnInit {
+
+    constructor() {}
+
+    ngOnInit() {
+    }
+
+}
+
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html
new file mode 100644 (file)
index 0000000..83bbc2d
--- /dev/null
@@ -0,0 +1,2 @@
+
+IMPORT COMPONENT
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts
new file mode 100644 (file)
index 0000000..40c65a5
--- /dev/null
@@ -0,0 +1,14 @@
+import {Component, OnInit} from '@angular/core';
+
+@Component({
+  templateUrl: 'import.component.html'
+})
+export class ImportComponent implements OnInit {
+
+    constructor() {}
+
+    ngOnInit() {
+    }
+
+}
+
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/routing.module.ts
new file mode 100644 (file)
index 0000000..232f51f
--- /dev/null
@@ -0,0 +1,30 @@
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {VandelayComponent} from './vandelay.component';
+import {ImportComponent} from './import.component';
+import {ExportComponent} from './export.component';
+
+const routes: Routes = [{
+  path: '',
+  component: VandelayComponent,
+  //resolve: {vandelayResolver : VandelayResolver},
+  children: [{
+    path: '',
+    pathMatch: 'full',
+    redirectTo: 'import'
+  }, {
+    path: 'import',
+    component: ImportComponent
+  }, {
+    path: 'export',
+    component: ExportComponent
+  }]
+}];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+  providers: []
+})
+
+export class VandelayRoutingModule {}
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.html
new file mode 100644 (file)
index 0000000..839454b
--- /dev/null
@@ -0,0 +1,33 @@
+
+<ul class="nav nav-pills nav-fill pt-3 pb-3">
+  <li class="nav-item">
+    <a class="nav-link" [ngClass]="{active: tab=='export'}" 
+      routerLink="/staff/cat/vandelay/export" i18n>Export</a>
+  </li>
+  <li class="nav-item">
+    <a class="nav-link" [ngClass]="{active: tab=='import'}" 
+      routerLink="/staff/cat/vandelay/import" i18n>Import</a>
+  </li>
+  <li class="nav-item" disabled>
+    <a class="nav-link" [ngClass]="{active: tab=='queue'}" 
+      routerLink="/staff/cat/vandelay/queue" i18n>Inspect Queue</a>
+  </li>
+  <li class="nav-item">
+    <a class="nav-link" disabled [ngClass]="{active: tab=='display_attrs'}" 
+      routerLink="/staff/cat/vandelay/display_attrs" i18n>Record Display Attributes</a>
+  </li>
+  <li class="nav-item">
+    <a class="nav-link" disabled [ngClass]="{active: tab=='merge_profiles'}" 
+      routerLink="/staff/cat/vandelay/merge_profiles" i18n>Merge / Overlay Profiles</a>
+  </li>
+  <li class="nav-item">
+    <a class="nav-link" disabled [ngClass]="{active: tab=='match_sets'}" 
+      routerLink="/staff/cat/vandelay/match_sets" i18n>Record Match Sets</a>
+  </li>
+  <li class="nav-item">
+    <a class="nav-link" disabled [ngClass]="{active: tab=='holdings_profiles'}" 
+      routerLink="/staff/cat/vandelay/holdings_profiles" i18n>Holdings Import Profiles</a>
+  </li>
+</ul>
+
+<router-outlet></router-outlet>
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.component.ts
new file mode 100644 (file)
index 0000000..4c537b6
--- /dev/null
@@ -0,0 +1,33 @@
+import {Component, OnInit} from '@angular/core';
+import {Router, ActivatedRoute, NavigationEnd} from "@angular/router";
+import {take} from 'rxjs/operators/take';
+
+@Component({
+  templateUrl: 'vandelay.component.html'
+})
+export class VandelayComponent implements OnInit {
+
+    tab: string;
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute
+    ) {
+
+        // As the parent component of the vandelay route tree, our
+        // activated route never changes.  Instead, listen for global
+        // route events, then ask for the first segement of the first
+        // child, which will be the tab name.
+        this.router.events.subscribe(routeEvent => {
+            if (routeEvent instanceof NavigationEnd) {
+                this.route.firstChild.url.pipe(take(1))
+                .subscribe(segments => this.tab = segments[0].path);
+            }
+        });
+    }
+
+    ngOnInit() {
+    }
+
+}
+
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts
new file mode 100644 (file)
index 0000000..2b9c65b
--- /dev/null
@@ -0,0 +1,26 @@
+import {NgModule} from '@angular/core';
+import {StaffCommonModule} from '@eg/staff/common.module';
+import {VandelayRoutingModule} from './routing.module';
+import {VandelayComponent} from './vandelay.component';
+import {ImportComponent} from './import.component';
+import {ExportComponent} from './export.component';
+import {GridModule} from '@eg/share/grid/grid.module';
+
+@NgModule({
+  declarations: [
+    VandelayComponent,
+    ImportComponent,
+    ExportComponent
+  ],
+  imports: [
+    StaffCommonModule,
+    VandelayRoutingModule,
+    GridModule
+  ],
+  providers: [
+  ]
+})
+
+export class VandelayModule {
+
+}
index feed30b..dc5fa77 100644 (file)
             <span class="material-icons">cloud_download</span>
             <span i18n>Import Record from Z39.50</span>
           </a>
-          <a href="/eg/staff/cat/catalog/vandelay" class="dropdown-item">
+          <a routerLink="/staff/cat/vandelay/import" class="dropdown-item">
             <span class="material-icons">import_export</span>
             <span i18n>MARC Batch Import/Export</span>
           </a>
index b515f38..6f20336 100644 (file)
@@ -31,6 +31,9 @@ const routes: Routes = [{
     path: 'circ',
     loadChildren : '@eg/staff/circ/routing.module#CircRoutingModule'
   }, {
+    path: 'cat',
+    loadChildren : '@eg/staff/cat/routing.module#CatRoutingModule'
+  }, {
     path: 'catalog',
     loadChildren : '@eg/staff/catalog/catalog.module#CatalogModule'
   }, {