mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
add share to c/dt/t/sp, refactor share input, ifOwner directive
This commit is contained in:
@@ -178,12 +178,12 @@
|
||||
</ng-template>
|
||||
</li>
|
||||
|
||||
<li [ngbNavItem]="6">
|
||||
<li [ngbNavItem]="6" *ifOwner="document?.owner">
|
||||
<a ngbNavLink i18n>Permissions</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div formGroupName="set_permissions">
|
||||
<app-input-select i18n-title title="Users can view" [items]="users" [bindLabel]="'username'" multiple="true" formControlName="view"></app-input-select>
|
||||
<app-input-select i18n-title title="Users can edit" [items]="users" [bindLabel]="'username'" multiple="true" formControlName="change"></app-input-select>
|
||||
<app-share-user type="view" formControlName="view"></app-share-user>
|
||||
<app-share-user type="change" formControlName="change"></app-share-user>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
|
@@ -40,7 +40,6 @@ import {
|
||||
PermissionsService,
|
||||
PermissionType,
|
||||
} from 'src/app/services/permissions.service'
|
||||
import { UserService } from 'src/app/services/rest/user.service'
|
||||
import { PaperlessUser } from 'src/app/data/paperless-user'
|
||||
|
||||
@Component({
|
||||
@@ -75,7 +74,6 @@ export class DocumentDetailComponent
|
||||
correspondents: PaperlessCorrespondent[]
|
||||
documentTypes: PaperlessDocumentType[]
|
||||
storagePaths: PaperlessStoragePath[]
|
||||
users: PaperlessUser[]
|
||||
|
||||
documentForm: FormGroup = new FormGroup({
|
||||
title: new FormControl(''),
|
||||
@@ -134,8 +132,7 @@ export class DocumentDetailComponent
|
||||
private toastService: ToastService,
|
||||
private settings: SettingsService,
|
||||
private storagePathService: StoragePathService,
|
||||
private permissionsService: PermissionsService,
|
||||
private userService: UserService
|
||||
private permissionsService: PermissionsService
|
||||
) {}
|
||||
|
||||
titleKeyUp(event) {
|
||||
@@ -175,11 +172,6 @@ export class DocumentDetailComponent
|
||||
.pipe(first())
|
||||
.subscribe((result) => (this.storagePaths = result.results))
|
||||
|
||||
this.userService
|
||||
.listAll()
|
||||
.pipe(first())
|
||||
.subscribe((result) => (this.users = result.results))
|
||||
|
||||
this.route.paramMap
|
||||
.pipe(
|
||||
takeUntil(this.unsubscribeNotifier),
|
||||
|
Reference in New Issue
Block a user