mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 18:46:52 +01:00
frontend support for suggestions #264
This commit is contained in:
parent
ddcc0883eb
commit
d22d9a023c
9 changed files with 102 additions and 43 deletions
|
|
@ -30,11 +30,22 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
|||
@Input()
|
||||
allowNull: boolean = false
|
||||
|
||||
@Input()
|
||||
suggestions: number[]
|
||||
|
||||
@Output()
|
||||
createNew = new EventEmitter()
|
||||
|
||||
|
||||
showPlusButton(): boolean {
|
||||
return this.createNew.observers.length > 0
|
||||
}
|
||||
|
||||
getSuggestions() {
|
||||
if (this.suggestions && this.items) {
|
||||
return this.suggestions.filter(id => id != this.value).map(id => this.items.find(item => item.id == id))
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue