Prettier code cleanup for .ts files

See #182
This commit is contained in:
Michael Shamoon
2022-03-11 10:53:32 -08:00
parent f8c8161a3e
commit f34202a82a
159 changed files with 3882 additions and 2716 deletions

View File

@@ -1,25 +1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { NumberComponent } from './number.component';
import { NumberComponent } from './number.component'
describe('NumberComponent', () => {
let component: NumberComponent;
let fixture: ComponentFixture<NumberComponent>;
let component: NumberComponent
let fixture: ComponentFixture<NumberComponent>
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ NumberComponent ]
})
.compileComponents();
});
declarations: [NumberComponent],
}).compileComponents()
})
beforeEach(() => {
fixture = TestBed.createComponent(NumberComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
fixture = TestBed.createComponent(NumberComponent)
component = fixture.componentInstance
fixture.detectChanges()
})
it('should create', () => {
expect(component).toBeTruthy();
});
});
expect(component).toBeTruthy()
})
})

View File

@@ -1,21 +1,22 @@
import { Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { FILTER_ASN_ISNULL } from 'src/app/data/filter-rule-type';
import { DocumentService } from 'src/app/services/rest/document.service';
import { AbstractInputComponent } from '../abstract-input';
import { Component, forwardRef } from '@angular/core'
import { NG_VALUE_ACCESSOR } from '@angular/forms'
import { FILTER_ASN_ISNULL } from 'src/app/data/filter-rule-type'
import { DocumentService } from 'src/app/services/rest/document.service'
import { AbstractInputComponent } from '../abstract-input'
@Component({
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NumberComponent),
multi: true
}],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NumberComponent),
multi: true,
},
],
selector: 'app-input-number',
templateUrl: './number.component.html',
styleUrls: ['./number.component.scss']
styleUrls: ['./number.component.scss'],
})
export class NumberComponent extends AbstractInputComponent<number> {
constructor(private documentService: DocumentService) {
super()
}
@@ -24,16 +25,17 @@ export class NumberComponent extends AbstractInputComponent<number> {
if (this.value) {
return
}
this.documentService.listFiltered(1, 1, "archive_serial_number", true, [{rule_type: FILTER_ASN_ISNULL, value: "false"}]).subscribe(
results => {
this.documentService
.listFiltered(1, 1, 'archive_serial_number', true, [
{ rule_type: FILTER_ASN_ISNULL, value: 'false' },
])
.subscribe((results) => {
if (results.count > 0) {
this.value = results.results[0].archive_serial_number + 1
} else {
this.value = 1
}
this.onChange(this.value)
}
)
})
}
}