Enhancement: angular 19 (#8584)

This commit is contained in:
shamoon
2025-01-01 22:26:53 -08:00
committed by GitHub
parent 75de53eb83
commit f89b6281da
209 changed files with 6147 additions and 4098 deletions

View File

@@ -67,7 +67,9 @@
(mousedown)="$event.stopImmediatePropagation()"
></ng-select>
<select class="w-25 form-select" [(ngModel)]="atom.operator" [disabled]="disabled">
<option *ngFor="let operator of getOperatorsForField(atom.field)" [ngValue]="operator.value">{{operator.label}}</option>
@for (operator of getOperatorsForField(atom.field); track operator.label) {
<option [ngValue]="operator.value">{{operator.label}}</option>
}
</select>
@switch (atom.operator) {
@case (CustomFieldQueryOperator.Exists) {

View File

@@ -55,13 +55,13 @@ describe('CustomFieldsQueryDropdownComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CustomFieldsQueryDropdownComponent],
imports: [
NgbDropdownModule,
NgxBootstrapIconsModule.pick(allIcons),
NgSelectModule,
FormsModule,
ReactiveFormsModule,
CustomFieldsQueryDropdownComponent,
],
providers: [
provideHttpClient(withInterceptorsFromDi()),

View File

@@ -1,3 +1,4 @@
import { NgTemplateOutlet } from '@angular/common'
import {
Component,
EventEmitter,
@@ -7,8 +8,10 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core'
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
import { NgSelectComponent } from '@ng-select/ng-select'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbDropdown, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select'
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons'
import { first, Subject, takeUntil } from 'rxjs'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
import {
@@ -29,6 +32,7 @@ import {
} from 'src/app/utils/custom-field-query-element'
import { popperOptionsReenablePreventOverflow } from 'src/app/utils/popper-options'
import { LoadingComponentWithPermissions } from '../../loading-component/loading.component'
import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component'
export class CustomFieldQueriesModel {
public queries: CustomFieldQueryElement[] = []
@@ -156,6 +160,15 @@ export class CustomFieldQueriesModel {
selector: 'pngx-custom-fields-query-dropdown',
templateUrl: './custom-fields-query-dropdown.component.html',
styleUrls: ['./custom-fields-query-dropdown.component.scss'],
imports: [
ClearableBadgeComponent,
FormsModule,
ReactiveFormsModule,
NgTemplateOutlet,
NgSelectModule,
NgxBootstrapIconsModule,
NgbDropdownModule,
],
})
export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPermissions {
public CustomFieldQueryComponentType = CustomFieldQueryElementType