A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Merge branch 'dev' into feature-permissions
Michael Shamoonceeb2da3fe69
diff --cc src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.htmlindex d4a8eba16,32ca3859e..3e15335a4--- a/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html+++ b/src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html@@@ -10,10 -10,10 +10,10 @@@<th scope="col" i18n>Title</th></tr></thead>- <tbody>+ <tbody *ifPermissions="{ action: PermissionAction.View, type: PermissionType.Document }">- <tr *ngFor="let doc of documents" (click)="openDocumentsService.openDocument(doc)">- <td>{{doc.created_date | customDate}}</td>- <td>{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ms-1" (click)="clickTag(t); $event.stopPropagation();"></app-tag></td>+ <tr *ngFor="let doc of documents">+ <td><a routerLink="/documents/{{doc.id}}" class="d-block text-dark text-decoration-none">{{doc.created_date | customDate}}</a></td>+ <td><a routerLink="/documents/{{doc.id}}" class="d-block text-dark text-decoration-none">{{doc.title | documentTitle}}<app-tag [tag]="t" *ngFor="let t of doc.tags$ | async" class="ms-1" (click)="clickTag(t, $event)"></app-tag></a></td></tr></tbody></table>diff --cc src-ui/src/app/components/document-list/document-card-large/document-card-large.component.htmlindex 78f8a1c6c,80aedb7f2..63bee1712--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html@@@ -37,7 -37,7 +37,7 @@@<use xlink:href="assets/bootstrap-icons.svg#diagram-3"/></svg> <span class="d-none d-md-inline" i18n>More like this</span></a>- <a (click)="openDocumentsService.openDocument(document)" class="btn btn-sm btn-outline-secondary" *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }">- <a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary">++ <a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary" *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }"><svg class="sidebaricon" fill="currentColor" class="sidebaricon"><use xlink:href="assets/bootstrap-icons.svg#pencil"/></svg> <span class="d-none d-md-inline" i18n>Edit</span>diff --cc src-ui/src/app/components/document-list/document-card-large/document-card-large.component.tsindex a32e66b39,512cb51ae..a6c9c25d3--- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts+++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts@@@ -10,9 -10,7 +10,8 @@@ import { PaperlessDocument } from 'src/import { DocumentService } from 'src/app/services/rest/document.service'import { SettingsService } from 'src/app/services/settings.service'import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'- import { OpenDocumentsService } from 'src/app/services/open-documents.service'import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'+import { ComponentWithPermissions } from '../../with-permissions/with-permissions.component'@Component({selector: 'app-document-card-large',@@@ -22,17 -20,11 +21,16 @@@'../popover-preview/popover-preview.scss',],})-export class DocumentCardLargeComponent implements OnInit {+export class DocumentCardLargeComponent+ extends ComponentWithPermissions+ implements OnInit+{constructor(private documentService: DocumentService,- private settingsService: SettingsService,- public openDocumentsService: OpenDocumentsService+ private settingsService: SettingsService- ) {}+ ) {+ super()+ }@Input()selected = falsediff --cc src-ui/src/app/components/document-list/document-card-small/document-card-small.component.htmlindex e2dfee50b,5e46ed7b4..c4e15442b--- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html+++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html@@@ -67,7 -67,7 +67,7 @@@</div><div class="d-flex justify-content-between align-items-center"><div class="btn-group w-100">- <a (click)="openDocumentsService.openDocument(document)" class="btn btn-sm btn-outline-secondary" title="Edit" *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n-title>- <a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary" title="Edit" i18n-title>++ <a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary" title="Edit" i18n-title *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n-title><svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-pencil" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/></svg>diff --cc src-ui/src/app/components/document-list/document-card-small/document-card-small.component.tsindex 583fde4ee,8e6ae33a6..0aa7bd758--- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts+++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts@@@ -10,9 -11,7 +10,8 @@@ import { PaperlessDocument } from 'src/import { DocumentService } from 'src/app/services/rest/document.service'import { SettingsService } from 'src/app/services/settings.service'import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'- import { OpenDocumentsService } from 'src/app/services/open-documents.service'import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'+import { ComponentWithPermissions } from '../../with-permissions/with-permissions.component'@Component({selector: 'app-document-card-small',@@@ -22,14 -21,11 +21,13 @@@'../popover-preview/popover-preview.scss',],})-export class DocumentCardSmallComponent implements OnInit {+export class DocumentCardSmallComponent extends ComponentWithPermissions {constructor(private documentService: DocumentService,- private settingsService: SettingsService,- public openDocumentsService: OpenDocumentsService+ private settingsService: SettingsService- ) {}+ ) {+ super()+ }@Input()selected = falsediff --cc src/documents/views.pyindex 312e0115c,7ff6e90d9..a3ab7382f--- a/src/documents/views.py+++ b/src/documents/views.py@@@ -256,10 -226,11 +256,12 @@@ class DocumentViewSetfields = fields_param.split(",")else:fields = None+ truncate_content = self.request.query_params.get("truncate_content", "False")serializer_class = self.get_serializer_class()+ kwargs.setdefault("user", self.request.user) # PassUserMixinkwargs.setdefault("context", self.get_serializer_context())kwargs.setdefault("fields", fields)+ kwargs.setdefault("truncate_content", truncate_content.lower() in ["true", "1"])return serializer_class(*args, **kwargs)def update(self, request, *args, **kwargs):