From ea9779f461a372db1e169dbeb828736e253c65c3 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Wed, 2 Sep 2020 12:32:07 -0700 Subject: [PATCH] LP1849212: lint Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan Signed-off-by: Galen Charlton --- .../course-reserves/course-term-map.component.ts | 2 +- ...ive.ts => simplified-editor-field.component.ts} | 10 ++++----- .../simplified-editor-subfield.component.ts | 24 ++++++++++++++++++++++ .../simplified-editor-subfield.directive.ts | 23 --------------------- .../simplified-editor.component.ts | 24 ++++++++++------------ .../simplified-editor/simplified-editor.module.ts | 12 +++++------ 6 files changed, 47 insertions(+), 48 deletions(-) rename Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/{simplified-editor-field.directive.ts => simplified-editor-field.component.ts} (83%) create mode 100644 Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.component.ts delete mode 100644 Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-term-map.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-term-map.component.ts index 7fb460d4cb..bfca8a7270 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-term-map.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-term-map.component.ts @@ -25,4 +25,4 @@ import {Component} from '@angular/core'; export class CourseTermMapComponent { -} \ No newline at end of file +} 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.component.ts similarity index 83% rename from Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.directive.ts rename to Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-field.component.ts index a5e7e0a76f..26d76fdf0a 100644 --- 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.component.ts @@ -1,17 +1,17 @@ -import {Directive, Host, Input, OnInit, AfterViewInit} from '@angular/core'; +import {Component, 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({ +@Component({ selector: 'eg-marc-simplified-editor-field', + template: '' }) -export class MarcSimplifiedEditorFieldDirective implements OnInit, AfterViewInit { +export class MarcSimplifiedEditorFieldComponent implements OnInit, AfterViewInit { @Input() tag = 'a'; @Input() ind1 = ' '; @@ -47,7 +47,7 @@ export class MarcSimplifiedEditorFieldDirective implements OnInit, AfterViewInit ); this.subfieldIndex += 1; - } + }; } ngAfterViewInit() { 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 index 0000000000..24104cee7b --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.component.ts @@ -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 index d9474a85c5..0000000000 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts +++ /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); - } - -} diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.component.ts index 77405cc261..149bf26fe8 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.component.ts @@ -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) => { 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; diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.module.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.module.ts index e17ad0efd1..3c0fe7aac2 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor.module.ts @@ -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 -- 2.11.0