mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-12 01:26:41 -05:00
Enhancement: allow tags list selection without auto parent/child
This commit is contained in:
parent
74f72e417d
commit
3e3ff39b0c
@ -210,6 +210,7 @@
|
||||
<pngx-input-tags
|
||||
[allowCreate]="false"
|
||||
[title]="null"
|
||||
[autoHeirarchy]="false"
|
||||
formControlName="values"
|
||||
></pngx-input-tags>
|
||||
} @else if (
|
||||
|
||||
@ -103,6 +103,9 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
@Input()
|
||||
multiple: boolean = true
|
||||
|
||||
@Input()
|
||||
autoHeirarchy: boolean = true
|
||||
|
||||
@Output()
|
||||
filterDocuments = new EventEmitter<Tag[]>()
|
||||
|
||||
@ -134,7 +137,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
oldValue.splice(index, 1)
|
||||
|
||||
// remove children
|
||||
oldValue = this.removeChildren(oldValue, tag)
|
||||
if (this.autoHeirarchy) oldValue = this.removeChildren(oldValue, tag)
|
||||
|
||||
this.value = [...oldValue]
|
||||
this.onChange(this.value)
|
||||
@ -153,7 +156,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
||||
}
|
||||
|
||||
public onAdd(tag: Tag) {
|
||||
if (tag.parent) {
|
||||
if (this.autoHeirarchy && tag.parent) {
|
||||
// add all parents recursively
|
||||
const parent = this.getTag(tag.parent)
|
||||
this.value = [...this.value, parent.id]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user