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
|
<pngx-input-tags
|
||||||
[allowCreate]="false"
|
[allowCreate]="false"
|
||||||
[title]="null"
|
[title]="null"
|
||||||
|
[autoHeirarchy]="false"
|
||||||
formControlName="values"
|
formControlName="values"
|
||||||
></pngx-input-tags>
|
></pngx-input-tags>
|
||||||
} @else if (
|
} @else if (
|
||||||
|
|||||||
@ -103,6 +103,9 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
@Input()
|
@Input()
|
||||||
multiple: boolean = true
|
multiple: boolean = true
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
autoHeirarchy: boolean = true
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
filterDocuments = new EventEmitter<Tag[]>()
|
filterDocuments = new EventEmitter<Tag[]>()
|
||||||
|
|
||||||
@ -134,7 +137,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
oldValue.splice(index, 1)
|
oldValue.splice(index, 1)
|
||||||
|
|
||||||
// remove children
|
// remove children
|
||||||
oldValue = this.removeChildren(oldValue, tag)
|
if (this.autoHeirarchy) oldValue = this.removeChildren(oldValue, tag)
|
||||||
|
|
||||||
this.value = [...oldValue]
|
this.value = [...oldValue]
|
||||||
this.onChange(this.value)
|
this.onChange(this.value)
|
||||||
@ -153,7 +156,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public onAdd(tag: Tag) {
|
public onAdd(tag: Tag) {
|
||||||
if (tag.parent) {
|
if (this.autoHeirarchy && tag.parent) {
|
||||||
// add all parents recursively
|
// add all parents recursively
|
||||||
const parent = this.getTag(tag.parent)
|
const parent = this.getTag(tag.parent)
|
||||||
this.value = [...this.value, parent.id]
|
this.value = [...this.value, parent.id]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user