mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Chore: add pre-commit hook for codespell (#5324)
This commit is contained in:
@@ -363,7 +363,7 @@ export class SettingsComponent
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.isDirty) this.settings.updateAppearanceSettings() // in case user changed appearance but didnt save
|
||||
if (this.isDirty) this.settings.updateAppearanceSettings() // in case user changed appearance but didn't save
|
||||
this.storeSub && this.storeSub.unsubscribe()
|
||||
this.settings.organizingSidebarSavedViews = false
|
||||
}
|
||||
|
@@ -248,7 +248,7 @@ describe('AppFrameComponent', () => {
|
||||
expect(toastSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should support collapsable menu', () => {
|
||||
it('should support collapsible menu', () => {
|
||||
const button: HTMLButtonElement = (
|
||||
fixture.nativeElement as HTMLDivElement
|
||||
).querySelector('button[data-toggle=collapse]')
|
||||
|
@@ -97,7 +97,7 @@ export abstract class EditDialogComponent<
|
||||
})
|
||||
}
|
||||
|
||||
// wait to enable close button so it doesnt steal focus from input since its the first clickable element in the DOM
|
||||
// wait to enable close button so it doesn't steal focus from input since its the first clickable element in the DOM
|
||||
setTimeout(() => {
|
||||
this.closeEnabled = true
|
||||
})
|
||||
|
@@ -56,7 +56,7 @@ describe('NumberComponent', () => {
|
||||
component.step = 0.1
|
||||
component.writeValue(12.3456)
|
||||
expect(component.value).toEqual(12.3456)
|
||||
// float (step = .1) doesnt force 2 decimals
|
||||
// float (step = .1) doesn't force 2 decimals
|
||||
component.writeValue(11.1)
|
||||
expect(component.value).toEqual(11.1)
|
||||
})
|
||||
|
@@ -28,7 +28,7 @@ describe('PasswordComponent', () => {
|
||||
|
||||
it('should support use of input field', () => {
|
||||
expect(component.value).toBeUndefined()
|
||||
// TODO: why doesnt this work?
|
||||
// TODO: why doesn't this work?
|
||||
// input.value = 'foo'
|
||||
// input.dispatchEvent(new Event('change'))
|
||||
// fixture.detectChanges()
|
||||
|
@@ -27,7 +27,7 @@ describe('TextComponent', () => {
|
||||
|
||||
it('should support use of input field', () => {
|
||||
expect(component.value).toBeUndefined()
|
||||
// TODO: why doesnt this work?
|
||||
// TODO: why doesn't this work?
|
||||
// input.value = 'foo'
|
||||
// input.dispatchEvent(new Event('change'))
|
||||
// fixture.detectChanges()
|
||||
|
@@ -27,7 +27,7 @@ describe('TextComponent', () => {
|
||||
|
||||
it('should support use of input field', () => {
|
||||
expect(component.value).toBeUndefined()
|
||||
// TODO: why doesnt this work?
|
||||
// TODO: why doesn't this work?
|
||||
// input.value = 'foo'
|
||||
// input.dispatchEvent(new Event('change'))
|
||||
// fixture.detectChanges()
|
||||
|
@@ -303,7 +303,7 @@ describe('DocumentDetailComponent', () => {
|
||||
discardPeriodicTasks()
|
||||
}))
|
||||
|
||||
it('should update title before doc change if wasnt updated via debounce', fakeAsync(() => {
|
||||
it('should update title before doc change if was not updated via debounce', fakeAsync(() => {
|
||||
initNormally()
|
||||
component.titleInput.value = 'Foo Bar'
|
||||
component.titleInput.inputField.nativeElement.dispatchEvent(
|
||||
|
@@ -157,7 +157,7 @@ export class DocumentDetailComponent
|
||||
|
||||
@ViewChild('nav') nav: NgbNav
|
||||
@ViewChild('pdfPreview') set pdfPreview(element) {
|
||||
// this gets called when compontent added or removed from DOM
|
||||
// this gets called when component added or removed from DOM
|
||||
if (
|
||||
element &&
|
||||
element.nativeElement.offsetParent !== null &&
|
||||
@@ -316,7 +316,7 @@ export class DocumentDetailComponent
|
||||
.subscribe({
|
||||
next: (titleValue) => {
|
||||
// In the rare case when the field changed just after debounced event was fired.
|
||||
// We dont want to overwrite whats actually in the text field, so just return
|
||||
// We dont want to overwrite what's actually in the text field, so just return
|
||||
if (titleValue !== this.titleInput.value) return
|
||||
|
||||
this.title = titleValue
|
||||
|
@@ -82,7 +82,7 @@ export class DocumentCardLargeComponent extends ComponentWithPermissions {
|
||||
// only show notes with a match
|
||||
highlights = (this.document['__search_hit__'].note_highlights as string)
|
||||
.split(',')
|
||||
.filter((higlight) => higlight.includes('<span'))
|
||||
.filter((highlight) => highlight.includes('<span'))
|
||||
}
|
||||
return highlights
|
||||
}
|
||||
|
@@ -355,7 +355,7 @@ describe('FilterEditorComponent', () => {
|
||||
expect(component.textFilterTarget).toEqual('fulltext-morelike') // TEXT_FILTER_TARGET_FULLTEXT_MORELIKE
|
||||
expect(moreLikeSpy).toHaveBeenCalledWith(1)
|
||||
expect(component.textFilter).toEqual('Foo Bar')
|
||||
// we have to do this here because it cant be done by user input
|
||||
// we have to do this here because it can't be done by user input
|
||||
expect(component.filterRules).toEqual([
|
||||
{
|
||||
rule_type: FILTER_FULLTEXT_MORELIKE,
|
||||
@@ -1264,7 +1264,7 @@ describe('FilterEditorComponent', () => {
|
||||
|
||||
dateCreatedAfter.nativeElement.value = '05/14/2023'
|
||||
// dateCreatedAfter.triggerEventHandler('change')
|
||||
// TODO: why isnt ngModel triggering this on change?
|
||||
// TODO: why isn't ngModel triggering this on change?
|
||||
component.dateCreatedAfter = '2023-05-14'
|
||||
fixture.detectChanges()
|
||||
tick(400)
|
||||
@@ -1284,7 +1284,7 @@ describe('FilterEditorComponent', () => {
|
||||
|
||||
dateCreatedBefore.nativeElement.value = '05/14/2023'
|
||||
// dateCreatedBefore.triggerEventHandler('change')
|
||||
// TODO: why isnt ngModel triggering this on change?
|
||||
// TODO: why isn't ngModel triggering this on change?
|
||||
component.dateCreatedBefore = '2023-05-14'
|
||||
fixture.detectChanges()
|
||||
tick(400)
|
||||
@@ -1341,7 +1341,7 @@ describe('FilterEditorComponent', () => {
|
||||
|
||||
dateAddedAfter.nativeElement.value = '05/14/2023'
|
||||
// dateAddedAfter.triggerEventHandler('change')
|
||||
// TODO: why isnt ngModel triggering this on change?
|
||||
// TODO: why isn't ngModel triggering this on change?
|
||||
component.dateAddedAfter = '2023-05-14'
|
||||
fixture.detectChanges()
|
||||
tick(400)
|
||||
@@ -1361,7 +1361,7 @@ describe('FilterEditorComponent', () => {
|
||||
|
||||
dateAddedBefore.nativeElement.value = '05/14/2023'
|
||||
// dateAddedBefore.triggerEventHandler('change')
|
||||
// TODO: why isnt ngModel triggering this on change?
|
||||
// TODO: why isn't ngModel triggering this on change?
|
||||
component.dateAddedBefore = '2023-05-14'
|
||||
fixture.detectChanges()
|
||||
tick(400)
|
||||
@@ -1524,7 +1524,7 @@ describe('FilterEditorComponent', () => {
|
||||
)
|
||||
ownerToggle.nativeElement.checked = true
|
||||
// ownerToggle.triggerEventHandler('change')
|
||||
// TODO: ngModel isnt doing this here
|
||||
// TODO: ngModel isn't doing this here
|
||||
component.permissionsSelectionModel.hideUnowned = true
|
||||
fixture.detectChanges()
|
||||
expect(component.filterRules).toEqual([
|
||||
|
@@ -40,7 +40,7 @@ export class SaveViewConfigDialogComponent implements OnInit {
|
||||
})
|
||||
|
||||
ngOnInit(): void {
|
||||
// wait to enable close button so it doesnt steal focus from input since its the first clickable element in the DOM
|
||||
// wait to enable close button so it doesn't steal focus from input since its the first clickable element in the DOM
|
||||
setTimeout(() => {
|
||||
this.closeEnabled = true
|
||||
})
|
||||
|
@@ -34,7 +34,7 @@ describe('CorrespondentListComponent', () => {
|
||||
correspondentsService = TestBed.inject(CorrespondentService)
|
||||
})
|
||||
|
||||
// Tests are included in management-list.compontent.spec.ts
|
||||
// Tests are included in management-list.component.spec.ts
|
||||
|
||||
it('should use correct delete message', () => {
|
||||
jest.spyOn(correspondentsService, 'listFiltered').mockReturnValue(
|
||||
|
@@ -58,7 +58,7 @@ describe('DocumentTypeListComponent', () => {
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
// Tests are included in management-list.compontent.spec.ts
|
||||
// Tests are included in management-list.component.spec.ts
|
||||
|
||||
it('should use correct delete message', () => {
|
||||
expect(
|
||||
|
@@ -58,7 +58,7 @@ describe('StoragePathListComponent', () => {
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
// Tests are included in management-list.compontent.spec.ts
|
||||
// Tests are included in management-list.component.spec.ts
|
||||
|
||||
it('should use correct delete message', () => {
|
||||
expect(component.getDeleteMessage({ id: 1, name: 'StoragePath1' })).toEqual(
|
||||
|
@@ -60,7 +60,7 @@ describe('TagListComponent', () => {
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
// Tests are included in management-list.compontent.spec.ts
|
||||
// Tests are included in management-list.component.spec.ts
|
||||
|
||||
it('should use correct delete message', () => {
|
||||
expect(component.getDeleteMessage({ id: 1, name: 'Tag1' })).toEqual(
|
||||
|
@@ -66,7 +66,7 @@ export class WorkflowsComponent
|
||||
? EditDialogMode.EDIT
|
||||
: EditDialogMode.CREATE
|
||||
if (workflow) {
|
||||
// quick "deep" clone so original doesnt get modified
|
||||
// quick "deep" clone so original doesn't get modified
|
||||
const clone = Object.assign({}, workflow)
|
||||
clone.actions = [...workflow.actions]
|
||||
clone.triggers = [...workflow.triggers]
|
||||
|
@@ -146,7 +146,7 @@ export class ConsumerStatusService {
|
||||
this.statusWebSocket.onmessage = (ev) => {
|
||||
let statusMessage: WebsocketConsumerStatusMessage = JSON.parse(ev['data'])
|
||||
|
||||
// fallback if backend didnt restrict message
|
||||
// fallback if backend didn't restrict message
|
||||
if (
|
||||
statusMessage.owner_id &&
|
||||
statusMessage.owner_id !== this.settingsService.currentUser?.id &&
|
||||
|
@@ -208,7 +208,7 @@ export class DocumentListViewService {
|
||||
this.activeListViewState.sortField = newState.sortField
|
||||
this.activeListViewState.sortReverse = newState.sortReverse
|
||||
this.activeListViewState.currentPage = newState.currentPage
|
||||
this.reload(null, paramsEmpty) // update the params if there arent any
|
||||
this.reload(null, paramsEmpty) // update the params if there aren't any
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,7 @@ export class OpenDocumentsService {
|
||||
openDocument(doc: Document): Observable<boolean> {
|
||||
if (this.openDocuments.find((d) => d.id == doc.id) == null) {
|
||||
if (this.openDocuments.length == this.MAX_OPEN_DOCUMENTS) {
|
||||
// at max, ensure changes arent lost
|
||||
// at max, ensure changes aren't lost
|
||||
const docToRemove = this.openDocuments[this.MAX_OPEN_DOCUMENTS - 1]
|
||||
const closeObservable = this.closeDocument(docToRemove)
|
||||
closeObservable.pipe(first()).subscribe((closed) => {
|
||||
|
@@ -23,7 +23,7 @@ export class GroupService extends AbstractNameFilterService<Group> {
|
||||
const { typeKey, actionKey } =
|
||||
this.permissionService.getPermissionKeys(perm)
|
||||
if (!typeKey || !actionKey) {
|
||||
// dont lose permissions the UI doesnt use
|
||||
// dont lose permissions the UI doesn't use
|
||||
o.permissions.push(perm)
|
||||
}
|
||||
})
|
||||
|
@@ -23,7 +23,7 @@ export class UserService extends AbstractNameFilterService<User> {
|
||||
const { typeKey, actionKey } =
|
||||
this.permissionService.getPermissionKeys(perm)
|
||||
if (!typeKey || !actionKey) {
|
||||
// dont lose permissions the UI doesnt use
|
||||
// dont lose permissions the UI doesn't use
|
||||
o.user_permissions.push(perm)
|
||||
}
|
||||
})
|
||||
|
@@ -53,7 +53,7 @@ export class LocalizedDateParserFormatter extends NgbDateParserFormatter {
|
||||
if (this.separatorRegExp.test(value)) {
|
||||
let segments = value.split(this.separatorRegExp)
|
||||
|
||||
// always accept strict yyyy*mm*dd format even if thats not the input format since we can be certain its not yyyy*dd*mm
|
||||
// always accept strict yyyy*mm*dd format even if that's not the input format since we can be certain its not yyyy*dd*mm
|
||||
if (
|
||||
value.length == 10 &&
|
||||
segments.length == 3 &&
|
||||
|
Reference in New Issue
Block a user