From 3b2bc292d80708332f32c903af9a01104ff8a34e Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Mon, 14 Dec 2020 23:14:04 -0800 Subject: [PATCH 001/138] Tweak checkbox --- .../document-card-small.component.html | 2 +- .../document-card-small.component.scss | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git 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 index 4ced42bdd..378047602 100644 --- 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 @@ -3,7 +3,7 @@
-
+
diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss index 36db2203c..a4af1bb11 100644 --- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss +++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss @@ -8,7 +8,15 @@ } .document-card-check { - display: none + display: none; + position: absolute; + top: 0; + left: 0; + + .custom-control { + margin-left: 4px; + margin-right: -3px; + } } .document-card:hover .document-card-check { @@ -17,8 +25,12 @@ .card-selected { border-color: $primary; + + .document-card-check { + display: block; + } } .doc-img-background-selected { background-color: $primaryFaded; -} \ No newline at end of file +} From b45bd665736879afcc776d876a5eacad35000b66 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Mon, 14 Dec 2020 23:14:19 -0800 Subject: [PATCH 002/138] Basic bulk editor component --- src-ui/src/app/app.module.ts | 2 + .../bulk-editor/bulk-editor.component.html | 16 +++++++ .../bulk-editor/bulk-editor.component.scss | 0 .../bulk-editor/bulk-editor.component.spec.ts | 25 ++++++++++ .../bulk-editor/bulk-editor.component.ts | 46 +++++++++++++++++++ .../document-list.component.html | 30 +++++++----- .../document-list/document-list.component.ts | 4 ++ 7 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html create mode 100644 src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss create mode 100644 src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts create mode 100644 src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index 914854892..627d4f6cf 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -32,6 +32,7 @@ import { FilterDropdownButtonComponent } from './components/filter-editor/filter import { FilterDropdownDateComponent } from './components/filter-editor/filter-dropdown-date/filter-dropdown-date.component'; import { DocumentCardLargeComponent } from './components/document-list/document-card-large/document-card-large.component'; import { DocumentCardSmallComponent } from './components/document-list/document-card-small/document-card-small.component'; +import { BulkEditorComponent } from './components/document-list/bulk-editor/bulk-editor.component'; import { NgxFileDropModule } from 'ngx-file-drop'; import { TextComponent } from './components/common/input/text/text.component'; import { SelectComponent } from './components/common/input/select/select.component'; @@ -84,6 +85,7 @@ import { SelectDialogComponent } from './components/common/select-dialog/select- FilterDropdownDateComponent, DocumentCardLargeComponent, DocumentCardSmallComponent, + BulkEditorComponent, TextComponent, SelectComponent, CheckComponent, 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 new file mode 100644 index 000000000..a1574f6f7 --- /dev/null +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -0,0 +1,16 @@ +
+ + + +
+
+ + + + + + +
+
+ +
diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts new file mode 100644 index 000000000..140d73301 --- /dev/null +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BulkEditorComponent } from './bulk-editor.component'; + +describe('BulkEditorComponent', () => { + let component: BulkEditorComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BulkEditorComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BulkEditorComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts new file mode 100644 index 000000000..7459d62dc --- /dev/null +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -0,0 +1,46 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { DocumentListViewService } from 'src/app/services/document-list-view.service'; + +@Component({ + selector: 'app-bulk-editor', + templateUrl: './bulk-editor.component.html', + styleUrls: ['./bulk-editor.component.scss'] +}) +export class BulkEditorComponent { + + @Input() + list: DocumentListViewService + + @Output() + selectPage = new EventEmitter() + + @Output() + selectAll = new EventEmitter() + + @Output() + selectNone = new EventEmitter() + + @Output() + setCorrespondent = new EventEmitter() + + @Output() + removeCorresponden = new EventEmitter() + + @Output() + setDocumentType = new EventEmitter() + + @Output() + removeDocumentType = new EventEmitter() + + @Output() + addTag = new EventEmitter() + + @Output() + removeTag = new EventEmitter() + + @Output() + delete = new EventEmitter() + + constructor( ) { } + +} diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index be2ed4847..36e9ff8fd 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -1,25 +1,16 @@
- -
+
- - - - - - - - -
@@ -96,6 +87,21 @@ [rotate]="true" (pageChange)="list.reload()" aria-label="Default pagination">
+
+ + +
+
diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts index 1bd1e5c7f..0a6fa4352 100644 --- a/src-ui/src/app/components/document-list/document-list.component.ts +++ b/src-ui/src/app/components/document-list/document-list.component.ts @@ -52,6 +52,10 @@ export class DocumentListComponent implements OnInit { return DOCUMENT_SORT_FIELDS } + get isBulkEditing(): boolean { + return this.list.selected.size > 0 + } + saveDisplayMode() { localStorage.setItem('document-list:displayMode', this.displayMode) } From 34c42c4339a9ef8b7f5d03d76be1eddb6a84d865 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Mon, 14 Dec 2020 23:39:10 -0800 Subject: [PATCH 003/138] Better svgs --- .../filter-dropdown-button.component.html | 4 ++-- .../app/components/filter-editor/filter-editor.component.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-button/filter-dropdown-button.component.html b/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-button/filter-dropdown-button.component.html index 8dff12a33..0ea870533 100644 --- a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-button/filter-dropdown-button.component.html +++ b/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-button/filter-dropdown-button.component.html @@ -1,7 +1,7 @@ From 03f071fd27c2e7e003655d534a8affe28d48b871 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Tue, 15 Dec 2020 00:57:31 -0800 Subject: [PATCH 004/138] Styled, organized button UI --- .../bulk-editor/bulk-editor.component.html | 101 +++++++++++++++--- .../bulk-editor/bulk-editor.component.scss | 6 ++ .../bulk-editor/bulk-editor.component.ts | 2 +- .../document-list.component.html | 2 +- 4 files changed, 95 insertions(+), 16 deletions(-) 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 a1574f6f7..54212923a 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 @@ -1,16 +1,89 @@ -
- - - +
+
+
+ +
+ + + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
-
- - - - - - -
-
-
+ + + + + + Add + + + + + + + Edit + + + + + + + Remove + diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss index e69de29bb..3868e7a02 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss @@ -0,0 +1,6 @@ +.btn svg { + width: 0.9em; + height: 0.9em; + margin-right: 2px; + margin-top: -1px; +} diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts index 7459d62dc..5c1ad01ae 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -24,7 +24,7 @@ export class BulkEditorComponent { setCorrespondent = new EventEmitter() @Output() - removeCorresponden = new EventEmitter() + removeCorrespondent = new EventEmitter() @Output() setDocumentType = new EventEmitter() diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 36e9ff8fd..a88ad65b7 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -87,7 +87,7 @@ [rotate]="true" (pageChange)="list.reload()" aria-label="Default pagination">
-
+
Date: Tue, 15 Dec 2020 11:09:25 -0800 Subject: [PATCH 005/138] Smaller editor, cleaned up responsive flow --- .../bulk-editor/bulk-editor.component.html | 54 +++++++++---------- .../bulk-editor/bulk-editor.component.scss | 6 ++- 2 files changed, 32 insertions(+), 28 deletions(-) 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 54212923a..22724db17 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 @@ -1,67 +1,67 @@
-
-
- +
+
+
- - -
-
- +
+
- -
-
- +
+
- -
-
- +
+
- -
-
-
@@ -71,19 +71,19 @@ - Add + Add - Edit + Edit - Remove + Remove diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss index 3868e7a02..5afd86545 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.scss @@ -1,6 +1,10 @@ .btn svg { width: 0.9em; height: 0.9em; - margin-right: 2px; + margin-right: 3px; margin-top: -1px; } + +.btn-sm { + line-height: 1; +} From fb9d750684092f40b4d5f5cee565d12ecd15f2f5 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+nikonratm@users.noreply.github.com> Date: Tue, 15 Dec 2020 14:19:40 -0800 Subject: [PATCH 006/138] Delete button margin-left --- .../document-list/bulk-editor/bulk-editor.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 22724db17..d330ba228 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 @@ -56,7 +56,7 @@
-
+
{{hint}} -
\ No newline at end of file +
diff --git a/src-ui/src/app/components/common/input/select/select.component.scss b/src-ui/src/app/components/common/input/select/select.component.scss index e69de29bb..8faec3bc0 100644 --- a/src-ui/src/app/components/common/input/select/select.component.scss +++ b/src-ui/src/app/components/common/input/select/select.component.scss @@ -0,0 +1 @@ +// styles for ng-select child are in styles.scss diff --git a/src-ui/src/app/components/common/input/tags/tags.component.html b/src-ui/src/app/components/common/input/tags/tags.component.html index 8029dd860..8a5dbc4f2 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.html +++ b/src-ui/src/app/components/common/input/tags/tags.component.html @@ -1,30 +1,41 @@ -
- +
+ -
-
- -
+
+ -
- -
- -
-
+ + + + + + + + + +
+
+ + + +
+ +
+
+
-
-
{{hint}} -
\ No newline at end of file +
diff --git a/src-ui/src/app/components/common/input/tags/tags.component.scss b/src-ui/src/app/components/common/input/tags/tags.component.scss index f2635b7f2..2eaaa4f6d 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.scss +++ b/src-ui/src/app/components/common/input/tags/tags.component.scss @@ -1,10 +1,12 @@ -.tags-form-control { - height: auto; +.selected-icon { + min-width: 1em; + min-height: 1em; } +.tag-wrap { + font-size: 1rem; +} -.scrollable-menu { - height: auto; - max-height: 300px; - overflow-x: hidden; -} \ No newline at end of file +.tag-wrap-delete { + cursor: pointer; +} diff --git a/src-ui/src/app/components/common/input/tags/tags.component.ts b/src-ui/src/app/components/common/input/tags/tags.component.ts index cca99cc55..5501ac5a6 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.ts +++ b/src-ui/src/app/components/common/input/tags/tags.component.ts @@ -21,7 +21,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor { onChange = (newValue: number[]) => {}; - + onTouched = () => {}; writeValue(newValue: number[]): void { @@ -66,29 +66,28 @@ export class TagsComponent implements OnInit, ControlValueAccessor { removeTag(id) { let index = this.displayValue.indexOf(id) if (index > -1) { - this.displayValue.splice(index, 1) + let oldValue = this.displayValue + oldValue.splice(index, 1) + this.displayValue = [...oldValue] this.onChange(this.displayValue) } } - addTag(id) { - let index = this.displayValue.indexOf(id) - if (index == -1) { - this.displayValue.push(id) - this.onChange(this.displayValue) - } - } - - createTag() { var modal = this.modalService.open(TagEditDialogComponent, {backdrop: 'static'}) modal.componentInstance.dialogMode = 'create' modal.componentInstance.success.subscribe(newTag => { this.tagService.listAll().subscribe(tags => { this.tags = tags.results - this.addTag(newTag.id) + this.displayValue = [...this.displayValue, newTag.id] + this.onChange(this.displayValue) }) }) } + ngSelectChange() { + this.value = this.displayValue + this.onChange(this.displayValue) + } + } diff --git 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 index 194497d39..f50708af3 100644 --- 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 @@ -13,7 +13,7 @@ {{doc.created | date}} - {{doc.title}} + {{doc.title | documentTitle}} 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 c0114f709..a3bc7e1e6 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 @@ -52,9 +52,9 @@
+ (createNew)="createCorrespondent()"> + (createNew)="createDocumentType()"> @@ -110,8 +110,8 @@ - - + + 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 5fe9f9250..b4005b920 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 @@ -6,6 +6,7 @@ import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; import { PaperlessDocument } from 'src/app/data/paperless-document'; import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; import { PaperlessDocumentType } from 'src/app/data/paperless-document-type'; +import { DocumentTitlePipe } from 'src/app/pipes/document-title.pipe'; import { DocumentListViewService } from 'src/app/services/document-list-view.service'; import { OpenDocumentsService } from 'src/app/services/open-documents.service'; import { CorrespondentService } from 'src/app/services/rest/correspondent.service'; @@ -54,7 +55,8 @@ export class DocumentDetailComponent implements OnInit { private router: Router, private modalService: NgbModal, private openDocumentService: OpenDocumentsService, - private documentListViewService: DocumentListViewService) { } + private documentListViewService: DocumentListViewService, + private documentTitlePipe: DocumentTitlePipe) { } getContentType() { return this.metadata?.has_archive_version ? 'application/pdf' : this.metadata?.original_mime_type @@ -90,7 +92,7 @@ export class DocumentDetailComponent implements OnInit { this.documentsService.getMetadata(doc.id).subscribe(result => { this.metadata = result }) - this.title = doc.title + this.title = this.documentTitlePipe.transform(doc.title) this.documentForm.patchValue(doc) } diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss index d6be8837e..11fb10562 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.scss @@ -1,5 +1,6 @@ .result-content { color: darkgray; + overflow-wrap: anywhere; } .doc-img { diff --git 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 index 378047602..948d585f4 100644 --- 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 @@ -31,7 +31,7 @@