mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-18 22:14:22 -06:00
Core elements, migration, consumer modifications
This commit is contained in:
@@ -97,6 +97,12 @@
|
||||
<br/><em>(<ng-container i18n>click for full output</ng-container>)</em>
|
||||
}
|
||||
</ng-template>
|
||||
@if (task.duplicate_documents?.length > 0) {
|
||||
<div class="small text-warning-emphasis d-flex align-items-center gap-1">
|
||||
<i-bs class="lh-1" width="1em" height="1em" name="exclamation-triangle"></i-bs>
|
||||
<span i18n>Duplicate(s) detected</span>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
<td class="d-lg-none">
|
||||
|
||||
@@ -145,6 +145,24 @@
|
||||
<a ngbNavLink i18n>Details</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div>
|
||||
@if (document?.duplicate_documents?.length) {
|
||||
<div class="alert alert-warning">
|
||||
<div class="fw-semibold" i18n>Duplicate content detected.</div>
|
||||
<ul class="mb-0 mt-2">
|
||||
@for (duplicate of document.duplicate_documents; track duplicate.id) {
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-link p-0 align-baseline"
|
||||
(click)="openDuplicateDocument(duplicate.id)"
|
||||
>
|
||||
{{ duplicate.title }}
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
<pngx-input-text #inputTitle i18n-title title="Title" formControlName="title" [horizontal]="true" [suggestion]="suggestions?.title" (keyup)="titleKeyUp($event)" [error]="error?.title"></pngx-input-text>
|
||||
<pngx-input-number i18n-title title="Archive serial number" [error]="error?.archive_serial_number" [horizontal]="true" formControlName='archive_serial_number'></pngx-input-number>
|
||||
<pngx-input-date i18n-title title="Date created" formControlName="created" [suggestions]="suggestions?.dates" [showFilter]="true" [horizontal]="true" (filterDocuments)="filterDocuments($event)"
|
||||
|
||||
@@ -706,6 +706,10 @@ export class DocumentDetailComponent
|
||||
this.prepareForm(doc)
|
||||
}
|
||||
|
||||
openDuplicateDocument(documentId: number) {
|
||||
this.router.navigate(['documents', documentId, 'details'])
|
||||
}
|
||||
|
||||
get customFieldFormFields(): FormArray {
|
||||
return this.documentForm.get('custom_fields') as FormArray
|
||||
}
|
||||
|
||||
@@ -112,6 +112,11 @@ export interface SearchHit {
|
||||
note_highlights?: string
|
||||
}
|
||||
|
||||
export interface DuplicateDocument {
|
||||
id: number
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface Document extends ObjectWithPermissions {
|
||||
correspondent?: number
|
||||
|
||||
@@ -159,6 +164,8 @@ export interface Document extends ObjectWithPermissions {
|
||||
|
||||
page_count?: number
|
||||
|
||||
duplicate_documents?: DuplicateDocument[]
|
||||
|
||||
// Frontend only
|
||||
__changedFields?: string[]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { DuplicateDocument } from './document'
|
||||
import { ObjectWithId } from './object-with-id'
|
||||
|
||||
export enum PaperlessTaskType {
|
||||
@@ -42,5 +43,7 @@ export interface PaperlessTask extends ObjectWithId {
|
||||
|
||||
related_document?: number
|
||||
|
||||
duplicate_documents?: DuplicateDocument[]
|
||||
|
||||
owner?: number
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user