mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Merge frontend user model
This commit is contained in:
		| @@ -6,8 +6,8 @@ | |||||||
|         "user": { |         "user": { | ||||||
|             "id": 1, |             "id": 1, | ||||||
|             "username": "user2", |             "username": "user2", | ||||||
|             "firstname": "", |             "first_name": "", | ||||||
|             "lastname": "" |             "last_name": "" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
| @@ -17,8 +17,8 @@ | |||||||
|         "user": { |         "user": { | ||||||
|             "id": 2, |             "id": 2, | ||||||
|             "username": "user1", |             "username": "user1", | ||||||
|             "firstname": "", |             "first_name": "", | ||||||
|             "lastname": "" |             "last_name": "" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
| @@ -28,8 +28,8 @@ | |||||||
|         "user": { |         "user": { | ||||||
|             "id": 2, |             "id": 2, | ||||||
|             "username": "user33", |             "username": "user33", | ||||||
|             "firstname": "", |             "first_name": "", | ||||||
|             "lastname": "" |             "last_name": "" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
| @@ -39,8 +39,8 @@ | |||||||
|         "user": { |         "user": { | ||||||
|             "id": 3, |             "id": 3, | ||||||
|             "username": "admin", |             "username": "admin", | ||||||
|             "firstname": "", |             "first_name": "", | ||||||
|             "lastname": "" |             "last_name": "" | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| ] | ] | ||||||
|   | |||||||
| @@ -92,8 +92,8 @@ export class DocumentCommentsComponent extends ComponentWithPermissions { | |||||||
|   displayName(comment: PaperlessDocumentComment): string { |   displayName(comment: PaperlessDocumentComment): string { | ||||||
|     if (!comment.user) return '' |     if (!comment.user) return '' | ||||||
|     let nameComponents = [] |     let nameComponents = [] | ||||||
|     if (comment.user.firstname) nameComponents.unshift(comment.user.firstname) |     if (comment.user.first_name) nameComponents.unshift(comment.user.first_name) | ||||||
|     if (comment.user.lastname) nameComponents.unshift(comment.user.lastname) |     if (comment.user.last_name) nameComponents.unshift(comment.user.last_name) | ||||||
|     if (comment.user.username) { |     if (comment.user.username) { | ||||||
|       if (nameComponents.length > 0) |       if (nameComponents.length > 0) | ||||||
|         nameComponents.push(`(${comment.user.username})`) |         nameComponents.push(`(${comment.user.username})`) | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| import { ObjectWithId } from './object-with-id' | import { ObjectWithId } from './object-with-id' | ||||||
| import { User } from './user' | import { PaperlessUser } from './paperless-user' | ||||||
|  |  | ||||||
| export interface PaperlessDocumentComment extends ObjectWithId { | export interface PaperlessDocumentComment extends ObjectWithId { | ||||||
|   created?: Date |   created?: Date | ||||||
|   comment?: string |   comment?: string | ||||||
|   user?: User |   user?: PaperlessUser | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,7 +0,0 @@ | |||||||
| import { ObjectWithId } from './object-with-id' |  | ||||||
|  |  | ||||||
| export interface User extends ObjectWithId { |  | ||||||
|   username: string |  | ||||||
|   firstname: string |  | ||||||
|   lastname: string |  | ||||||
| } |  | ||||||
| @@ -1400,8 +1400,8 @@ class TestDocumentApi(DirectoriesMixin, APITestCase): | |||||||
|                 "user": { |                 "user": { | ||||||
|                     "id": comment.user.id, |                     "id": comment.user.id, | ||||||
|                     "username": comment.user.username, |                     "username": comment.user.username, | ||||||
|                     "firstname": comment.user.first_name, |                     "first_name": comment.user.first_name, | ||||||
|                     "lastname": comment.user.last_name, |                     "last_name": comment.user.last_name, | ||||||
|                 }, |                 }, | ||||||
|             }, |             }, | ||||||
|         ) |         ) | ||||||
|   | |||||||
| @@ -400,8 +400,8 @@ class DocumentViewSet( | |||||||
|                 "user": { |                 "user": { | ||||||
|                     "id": c.user.id, |                     "id": c.user.id, | ||||||
|                     "username": c.user.username, |                     "username": c.user.username, | ||||||
|                     "firstname": c.user.first_name, |                     "first_name": c.user.first_name, | ||||||
|                     "lastname": c.user.last_name, |                     "last_name": c.user.last_name, | ||||||
|                 }, |                 }, | ||||||
|             } |             } | ||||||
|             for c in Comment.objects.filter(document=doc).order_by("-created") |             for c in Comment.objects.filter(document=doc).order_by("-created") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon