In operator
This commit is contained in:
parent
3bf40b154c
commit
c223090180
@ -81,6 +81,15 @@
|
||||
@case (CustomFieldQueryOperator.Contains) {
|
||||
<pngx-input-document-link [(ngModel)]="atom.value" class="w-25 form-select doc-link-select p-0" placeholder="Search docs..." i18n-placeholder [minimal]="true"></pngx-input-document-link>
|
||||
}
|
||||
@case (CustomFieldQueryOperator.In) {
|
||||
<ng-select
|
||||
class="paperless-input-select rounded-end"
|
||||
[items]="getSelectOptionsForField(atom.field)"
|
||||
[(ngModel)]="atom.value"
|
||||
[disabled]="disabled"
|
||||
[multiple]="true"
|
||||
></ng-select>
|
||||
}
|
||||
@default {
|
||||
<input class="w-25 form-control rounded-end" type="text" [(ngModel)]="atom.value" [disabled]="disabled">
|
||||
}
|
||||
|
@ -11,6 +11,13 @@
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
::ng-deep .rounded-end .ng-select-container {
|
||||
border-top-right-radius: var(--bs-border-radius) !important;
|
||||
border-bottom-right-radius: var(--bs-border-radius) !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
}
|
||||
|
||||
::ng-deep .ng-select {
|
||||
max-width: 100px;
|
||||
min-width: 35%;
|
||||
|
@ -252,4 +252,12 @@ export class CustomFieldsQueryDropdownComponent {
|
||||
label: CUSTOM_FIELD_QUERY_OPERATOR_LABELS[operator],
|
||||
}))
|
||||
}
|
||||
|
||||
getSelectOptionsForField(fieldID: number): string[] {
|
||||
const field = this.customFields.find((field) => field.id === fieldID)
|
||||
if (field) {
|
||||
return field.extra_data['select_options']
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ export const CUSTOM_FIELD_QUERY_VALUE_TYPES_BY_OPERATOR = {
|
||||
[CustomFieldQueryOperator.GreaterThan]: 'number',
|
||||
[CustomFieldQueryOperator.LessThan]: 'number',
|
||||
[CustomFieldQueryOperator.Contains]: 'array',
|
||||
// [CustomFieldQueryOperator.In]: 'array', // TODO: Implement
|
||||
[CustomFieldQueryOperator.In]: 'array',
|
||||
}
|
||||
|
||||
export const CUSTOM_FIELD_QUERY_MAX_DEPTH = 4
|
||||
|
Loading…
x
Reference in New Issue
Block a user