From 6dc5c1de3293f0e591685b9b0381f424c325c161 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 Dec 2022 17:51:01 -0800 Subject: [PATCH] Support bulk edit owner --- .../permissions-dialog.component.html | 18 ++---------------- .../permissions-dialog.component.ts | 19 ++++++++----------- .../document-detail.component.html | 4 +++- .../document-detail.component.ts | 2 +- .../bulk-editor/bulk-editor.component.html | 2 +- .../bulk-editor/bulk-editor.component.ts | 6 +++--- src/documents/bulk_edit.py | 11 +++++++++-- src/documents/serialisers.py | 10 +++++++++- src/documents/tasks.py | 10 ++++++++++ src/documents/tests/test_api.py | 2 +- 10 files changed, 47 insertions(+), 37 deletions(-) diff --git a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html index 1f23cecd9..e452c8144 100644 --- a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html +++ b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.html @@ -5,24 +5,10 @@ diff --git a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts index 0d7b07c00..c786be5df 100644 --- a/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts +++ b/src-ui/src/app/components/common/permissions-dialog/permissions-dialog.component.ts @@ -27,20 +27,17 @@ export class PermissionsDialogComponent implements OnInit { title = $localize`Set Permissions` form = new FormGroup({ - set_permissions: new FormGroup({ - view: new FormGroup({ - users: new FormControl([]), - groups: new FormControl([]), - }), - change: new FormGroup({ - users: new FormControl([]), - groups: new FormControl([]), - }), - }), + permissions_form: new FormControl(), }) get permissions() { - return this.form.value['set_permissions'] + console.log(this.form.get('permissions_form')) + + return { + owner: this.form.get('permissions_form')?.value['owner'], + set_permissions: + this.form.get('permissions_form')?.value['set_permissions'], + } } @Input() diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index 0384e976c..336d722c3 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -181,7 +181,9 @@
  • Permissions - +
    + +
  • diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 6be68e5d1..76bb2099f 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -209,7 +209,7 @@ export class DocumentDetailComponent this.openDocumentService.getOpenDocument(this.documentId) ) } else { - this.openDocumentService.openDocument(doc, false) + this.openDocumentService.openDocument(doc) this.updateComponent(doc) } diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html index cca53552c..9c7c87d58 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -69,7 +69,7 @@
    -
    +