LP1849212: lint
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 2 Sep 2020 19:32:07 +0000 (12:32 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 14 Sep 2020 22:17:41 +0000 (18:17 -0400)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-term-map.component.ts
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.directive.ts [deleted file]
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts [deleted file]
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.component.ts
Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.module.ts

diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.component.ts
new file mode 100644 (file)
index 0000000..26d76fd
--- /dev/null
@@ -0,0 +1,60 @@
+import {Component, Host, Input, OnInit, AfterViewInit} from '@angular/core';
+import {MarcSimplifiedEditorComponent} from './simplified-editor.component';
+import {MarcField, MarcSubfield} from '../marcrecord';
+
+/**
+ * A field that a user can edit, which will later be
+ * compiled into MARC
+ */
+
+@Component({
+  selector: 'eg-marc-simplified-editor-field',
+  template: ''
+})
+export class MarcSimplifiedEditorFieldComponent implements OnInit, AfterViewInit {
+
+  @Input() tag = 'a';
+  @Input() ind1 = ' ';
+  @Input() ind2 = ' ';
+
+  subfieldIndex = 1;
+
+  marcVersion: MarcField;
+
+  addSubfield: (code: string, defaultValue?: string) => void;
+
+  constructor(@Host() private editor: MarcSimplifiedEditorComponent) {}
+
+  ngOnInit() {
+    this.marcVersion = {
+      tag: this.tag,
+      subfields: [],
+      authValid: false,
+      authChecked: false,
+      isCtrlField: false,
+      isControlfield: () => false,
+      indicator: (ind: number) => (ind === 1) ? this.ind1 : this.ind2,
+      deleteExactSubfields: (...subfield: MarcSubfield[]) => 0, // not used by the simplified editor
+    };
+
+    this.addSubfield = (code: string, defaultValue?: string) => {
+      this.marcVersion.subfields.push(
+        [
+          code,
+          defaultValue ? defaultValue : '',
+          this.subfieldIndex
+        ]
+      );
+      this.subfieldIndex += 1;
+
+    };
+  }
+
+  ngAfterViewInit() {
+    this.editor.addField(this.marcVersion);
+  }
+
+}
+
+
+
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.directive.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.directive.ts
deleted file mode 100644 (file)
index a5e7e0a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-import {Directive, Host, Input, OnInit, AfterViewInit} from '@angular/core';
-import {MarcSimplifiedEditorComponent} from './simplified-editor.component';
-import {MarcField, MarcSubfield} from '../marcrecord';
-import {MarcSimplifiedEditorSubfieldDirective} from './simplified-editor-subfield.directive';
-
-/**
- * A field that a user can edit, which will later be
- * compiled into MARC
- */
-
-@Directive({
-  selector: 'eg-marc-simplified-editor-field',
-})
-export class MarcSimplifiedEditorFieldDirective implements OnInit, AfterViewInit {
-
-  @Input() tag = 'a';
-  @Input() ind1 = ' ';
-  @Input() ind2 = ' ';
-
-  subfieldIndex = 1;
-
-  marcVersion: MarcField;
-
-  addSubfield: (code: string, defaultValue?: string) => void;
-
-  constructor(@Host() private editor: MarcSimplifiedEditorComponent) {}
-
-  ngOnInit() {
-    this.marcVersion = {
-      tag: this.tag,
-      subfields: [],
-      authValid: false,
-      authChecked: false,
-      isCtrlField: false,
-      isControlfield: () => false,
-      indicator: (ind: number) => (ind === 1) ? this.ind1 : this.ind2,
-      deleteExactSubfields: (...subfield: MarcSubfield[]) => 0, // not used by the simplified editor
-    };
-
-    this.addSubfield = (code: string, defaultValue?: string) => {
-      this.marcVersion.subfields.push(
-        [
-          code,
-          defaultValue ? defaultValue : '',
-          this.subfieldIndex
-        ]
-      );
-      this.subfieldIndex += 1;
-
-    }
-  }
-
-  ngAfterViewInit() {
-    this.editor.addField(this.marcVersion);
-  }
-
-}
-
-
-
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.component.ts
new file mode 100644 (file)
index 0000000..24104ce
--- /dev/null
@@ -0,0 +1,24 @@
+import {Directive, Input, Host, OnInit, Component} from '@angular/core';
+import {MarcSimplifiedEditorFieldComponent} from './simplified-editor-field.component';
+
+/**
+ * A subfield that a user can edit, which will later be
+ * compiled into MARC
+ */
+
+@Component({
+  selector: 'eg-marc-simplified-editor-subfield',
+  template: ''
+})
+export class MarcSimplifiedEditorSubfieldComponent implements OnInit {
+
+  @Input() code: string;
+  @Input() defaultValue: string;
+
+  constructor(@Host() private field: MarcSimplifiedEditorFieldComponent) {}
+
+  ngOnInit() {
+    this.field.addSubfield(this.code, this.defaultValue);
+  }
+
+}
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts
deleted file mode 100644 (file)
index d9474a8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-import {Directive, Input, Host, OnInit} from '@angular/core';
-import {MarcSimplifiedEditorFieldDirective} from './simplified-editor-field.directive';
-
-/**
- * A subfield that a user can edit, which will later be
- * compiled into MARC
- */
-
-@Directive({
-  selector: 'eg-marc-simplified-editor-subfield',
-})
-export class MarcSimplifiedEditorSubfieldDirective implements OnInit {
-
-  @Input() code: string;
-  @Input() defaultValue: string;
-
-  constructor(@Host() private field: MarcSimplifiedEditorFieldDirective) {}
-
-  ngOnInit() {
-    this.field.addSubfield(this.code, this.defaultValue);
-  }
-
-}
index 77405cc..149bf26 100644 (file)
@@ -3,9 +3,7 @@ import {FormGroup, FormControl} from '@angular/forms';
 import {MarcField, MarcRecord} from '../marcrecord';
 import {TagTableService} from '../tagtable.service';
 import {NetService} from '@eg/core/net.service';
-import { ComboboxEntry } from '@eg/share/combobox/combobox.component';
-import { Observable, of } from 'rxjs';
-import { switchMap } from 'rxjs/operators';
+import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
 
 const DEFAULT_RECORD_TYPE = 'BKS';
 
@@ -57,22 +55,22 @@ export class MarcSimplifiedEditorComponent implements AfterViewInit, OnInit {
             field.fieldId = this.fieldIndex;
             this.fields.push(field);
             field.subfields.forEach((subfield) => {
-                this.editor.addControl(this.editorFieldIdentifier(field, subfield), new FormControl(null, []));               
-            })
+                this.editor.addControl(this.editorFieldIdentifier(field, subfield), new FormControl(null, []));
+            });
             this.fieldIndex++;
         };
 
         this.editorFieldIdentifier = (field: MarcField, subfield: Array<any>) => {
             return field.tag + subfield[0]; // e.g. 245a
-        }
+        };
 
         this.net.request('open-ils.cat',
             'open-ils.cat.biblio.fixed_field_values.by_rec_type',
             DEFAULT_RECORD_TYPE, 'Form')
             .subscribe((forms) => {
                 this.marcForms = forms['Form'].map((form) => {
-                    return {id: form[0], label: form[1]}
-                })
+                    return {id: form[0], label: form[1]};
+                });
             });
 
         this.net.request('open-ils.cat',
@@ -80,8 +78,8 @@ export class MarcSimplifiedEditorComponent implements AfterViewInit, OnInit {
             DEFAULT_RECORD_TYPE, 'Type')
             .subscribe((types) => {
                 this.marcTypes = types['Type'].map((type) => {
-                    return {id: type[0], label: type[1]}
-                })
+                    return {id: type[0], label: type[1]};
+                });
             });
 
     }
@@ -91,7 +89,7 @@ export class MarcSimplifiedEditorComponent implements AfterViewInit, OnInit {
             this.fields.forEach((field) => {
                 field.subfields.forEach((subfield) => {
                     this.subfieldLabels[this.editorFieldIdentifier(field, subfield)] = table.getSubfieldLabel(field.tag, subfield[0]);
-                })
+                });
             });
         });
     }
@@ -103,8 +101,8 @@ export class MarcSimplifiedEditorComponent implements AfterViewInit, OnInit {
             field.subfields.forEach((subfield) => {
                 if (subfield[1] === '') { // Default value has not been applied
                     subfield[1] = this.editor.get(this.editorFieldIdentifier(field, subfield)).value;
-                }  
-            })
+                }
+            });
         });
         record.fields = this.fields;
 
index e17ad0e..3c0fe7a 100644 (file)
@@ -2,15 +2,15 @@ import {NgModule} from '@angular/core';
 import {StaffCommonModule} from '@eg/staff/common.module';
 import {CommonWidgetsModule} from '@eg/share/common-widgets.module';
 import {MarcSimplifiedEditorComponent} from './simplified-editor.component';
-import {MarcSimplifiedEditorFieldDirective} from './simplified-editor-field.directive';
-import {MarcSimplifiedEditorSubfieldDirective} from './simplified-editor-subfield.directive';
+import {MarcSimplifiedEditorFieldComponent} from './simplified-editor-field.component';
+import {MarcSimplifiedEditorSubfieldComponent} from './simplified-editor-subfield.component';
 import {TagTableService} from '../tagtable.service';
 
 @NgModule({
     declarations: [
         MarcSimplifiedEditorComponent,
-        MarcSimplifiedEditorFieldDirective,
-        MarcSimplifiedEditorSubfieldDirective,
+        MarcSimplifiedEditorFieldComponent,
+        MarcSimplifiedEditorSubfieldComponent,
     ],
     imports: [
         StaffCommonModule,
@@ -18,8 +18,8 @@ import {TagTableService} from '../tagtable.service';
     ],
     exports: [
         MarcSimplifiedEditorComponent,
-        MarcSimplifiedEditorFieldDirective,
-        MarcSimplifiedEditorSubfieldDirective
+        MarcSimplifiedEditorFieldComponent,
+        MarcSimplifiedEditorSubfieldComponent
     ],
     providers: [
         TagTableService