mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 17:11:21 +00:00
Handle "private" tags, doctypes, correspondents
This commit is contained in:
@@ -26,8 +26,23 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
||||
this.addItemRef = this.addItem.bind(this)
|
||||
}
|
||||
|
||||
_items: any[]
|
||||
|
||||
@Input()
|
||||
items: any[]
|
||||
set items(items) {
|
||||
if (this.value && items.find((i) => i.id === this.value) === undefined) {
|
||||
items.push({
|
||||
id: this.value,
|
||||
name: $localize`Private`,
|
||||
private: true,
|
||||
})
|
||||
}
|
||||
this._items = items
|
||||
}
|
||||
|
||||
get items(): any[] {
|
||||
return this._items
|
||||
}
|
||||
|
||||
@Input()
|
||||
textColor: any
|
||||
@@ -61,6 +76,10 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
||||
return this.createNew.observers.length > 0
|
||||
}
|
||||
|
||||
get isPrivate(): boolean {
|
||||
return this.items.find((i) => i.id === this.value)?.private
|
||||
}
|
||||
|
||||
getSuggestions() {
|
||||
if (this.suggestions && this.items) {
|
||||
return this.suggestions
|
||||
|
||||
Reference in New Issue
Block a user