mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Feature: document history (audit log UI) (#6388)
This commit is contained in:
@@ -19,6 +19,7 @@ export enum PermissionType {
|
||||
PaperlessTask = '%s_paperlesstask',
|
||||
AppConfig = '%s_applicationconfiguration',
|
||||
UISettings = '%s_uisettings',
|
||||
History = '%s_logentry',
|
||||
Note = '%s_note',
|
||||
MailAccount = '%s_mailaccount',
|
||||
MailRule = '%s_mailrule',
|
||||
|
@@ -266,6 +266,13 @@ describe(`DocumentService`, () => {
|
||||
)
|
||||
expect(req.request.body.remove_inbox_tags).toEqual(true)
|
||||
})
|
||||
|
||||
it('should call appropriate api endpoint for getting audit log', () => {
|
||||
subscription = service.getHistory(documents[0].id).subscribe()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}${endpoint}/${documents[0].id}/history/`
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
|
@@ -19,7 +19,8 @@ import {
|
||||
PermissionsService,
|
||||
} from '../permissions.service'
|
||||
import { SettingsService } from '../settings.service'
|
||||
import { SETTINGS, SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { SETTINGS_KEYS } from 'src/app/data/ui-settings'
|
||||
import { AuditLogEntry } from 'src/app/data/auditlog-entry'
|
||||
|
||||
export const DOCUMENT_SORT_FIELDS = [
|
||||
{ field: 'archive_serial_number', name: $localize`ASN` },
|
||||
@@ -222,6 +223,10 @@ export class DocumentService extends AbstractPaperlessService<Document> {
|
||||
)
|
||||
}
|
||||
|
||||
getHistory(id: number): Observable<AuditLogEntry[]> {
|
||||
return this.http.get<AuditLogEntry[]>(this.getResourceUrl(id, 'history'))
|
||||
}
|
||||
|
||||
bulkDownload(
|
||||
ids: number[],
|
||||
content = 'both',
|
||||
|
@@ -47,6 +47,7 @@ describe('SettingsService', () => {
|
||||
update_checking: { enabled: false, backend_setting: 'default' },
|
||||
saved_views: { warn_on_unsaved_change: true },
|
||||
notes_enabled: true,
|
||||
auditlog_enabled: true,
|
||||
tour_complete: false,
|
||||
permissions: {
|
||||
default_owner: null,
|
||||
|
Reference in New Issue
Block a user