Updates some Python dependencies and the hooks

This commit is contained in:
Trenton H
2023-07-20 11:02:33 -07:00
parent 2f149eac9d
commit 8aa5ecde62
17 changed files with 371 additions and 350 deletions

View File

@@ -22,7 +22,7 @@ export enum EditDialogMode {
@Directive()
export abstract class EditDialogComponent<
T extends ObjectWithPermissions | ObjectWithId
T extends ObjectWithPermissions | ObjectWithId,
> implements OnInit
{
constructor(

View File

@@ -26,7 +26,10 @@ import { EditDialogMode } from '../../edit-dialog/edit-dialog.component'
styleUrls: ['./tags.component.scss'],
})
export class TagsComponent implements OnInit, ControlValueAccessor {
constructor(private tagService: TagService, private modalService: NgbModal) {
constructor(
private tagService: TagService,
private modalService: NgbModal
) {
this.createTagRef = this.createTag.bind(this)
}

View File

@@ -115,9 +115,9 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
case FILTER_CORRESPONDENT:
case FILTER_HAS_CORRESPONDENT_ANY:
if (rule.value) {
return $localize`Correspondent: ${
this.correspondents.find((c) => c.id == +rule.value)?.name
}`
return $localize`Correspondent: ${this.correspondents.find(
(c) => c.id == +rule.value
)?.name}`
} else {
return $localize`Without correspondent`
}
@@ -125,9 +125,9 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
case FILTER_DOCUMENT_TYPE:
case FILTER_HAS_DOCUMENT_TYPE_ANY:
if (rule.value) {
return $localize`Document type: ${
this.documentTypes.find((dt) => dt.id == +rule.value)?.name
}`
return $localize`Document type: ${this.documentTypes.find(
(dt) => dt.id == +rule.value
)?.name}`
} else {
return $localize`Without document type`
}
@@ -135,17 +135,16 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
case FILTER_STORAGE_PATH:
case FILTER_HAS_STORAGE_PATH_ANY:
if (rule.value) {
return $localize`Storage path: ${
this.storagePaths.find((sp) => sp.id == +rule.value)?.name
}`
return $localize`Storage path: ${this.storagePaths.find(
(sp) => sp.id == +rule.value
)?.name}`
} else {
return $localize`Without storage path`
}
case FILTER_HAS_TAGS_ALL:
return $localize`Tag: ${
this.tags.find((t) => t.id == +rule.value)?.name
}`
return $localize`Tag: ${this.tags.find((t) => t.id == +rule.value)
?.name}`
case FILTER_HAS_ANY_TAG:
if (rule.value == 'false') {

View File

@@ -11,7 +11,10 @@ import { Meta } from '@angular/platform-browser'
@Injectable()
export class CsrfInterceptor implements HttpInterceptor {
constructor(private cookieService: CookieService, private meta: Meta) {}
constructor(
private cookieService: CookieService,
private meta: Meta
) {}
intercept(
request: HttpRequest<unknown>,

View File

@@ -276,9 +276,9 @@ export class DocumentListViewService {
errorMessage = Object.keys(error.error)
.map((fieldName) => {
const fieldError: Array<string> = error.error[fieldName]
return `${
DOCUMENT_SORT_FIELDS.find((f) => f.field == fieldName)?.name
}: ${fieldError[0]}`
return `${DOCUMENT_SORT_FIELDS.find(
(f) => f.field == fieldName
)?.name}: ${fieldError[0]}`
})
.join(', ')
} else {

View File

@@ -2,7 +2,7 @@ import { ObjectWithId } from 'src/app/data/object-with-id'
import { AbstractPaperlessService } from './abstract-paperless-service'
export abstract class AbstractNameFilterService<
T extends ObjectWithId
T extends ObjectWithId,
> extends AbstractPaperlessService<T> {
listFiltered(
page?: number,

View File

@@ -8,7 +8,10 @@ import { environment } from 'src/environments/environment'
export abstract class AbstractPaperlessService<T extends ObjectWithId> {
protected baseUrl: string = environment.apiBaseUrl
constructor(protected http: HttpClient, private resourceName: string) {}
constructor(
protected http: HttpClient,
private resourceName: string
) {}
protected getResourceUrl(id: number = null, action: string = null): string {
let url = `${this.baseUrl}${this.resourceName}/`

View File

@@ -9,7 +9,10 @@ import { AbstractNameFilterService } from './abstract-name-filter-service'
providedIn: 'root',
})
export class GroupService extends AbstractNameFilterService<PaperlessGroup> {
constructor(http: HttpClient, private permissionService: PermissionsService) {
constructor(
http: HttpClient,
private permissionService: PermissionsService
) {
super(http, 'groups')
}

View File

@@ -9,7 +9,10 @@ import { AbstractNameFilterService } from './abstract-name-filter-service'
providedIn: 'root',
})
export class UserService extends AbstractNameFilterService<PaperlessUser> {
constructor(http: HttpClient, private permissionService: PermissionsService) {
constructor(
http: HttpClient,
private permissionService: PermissionsService
) {
super(http, 'users')
}