From b1605bd04c08eaf3c76085be0bdaa5479ee4d431 Mon Sep 17 00:00:00 2001 From: Demerson Carvalho Date: Wed, 4 Feb 2026 15:47:53 -0300 Subject: [PATCH] DECAF-26 - fix list component condition builder --- src/lib/components/list/list.component.ts | 4 ++-- src/lib/engine/NgxComponentDirective.ts | 2 +- src/lib/i18n/data/en.json | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/components/list/list.component.ts b/src/lib/components/list/list.component.ts index 41248b19..2716ddda 100644 --- a/src/lib/components/list/list.component.ts +++ b/src/lib/components/list/list.component.ts @@ -1223,9 +1223,9 @@ export class ListComponent extends NgxComponentDirective implements OnInit, OnDe parseConditions(value: string | number | IFilterQuery): Condition { let _condition: Condition; const model = this.model as Model; - if (typeof value === Primitives.STRING || !isNaN(value as number)) { + if (typeof value === Primitives.STRING) { _condition = Condition.attribute(this.pk as keyof Model).eq( - !isNaN(value as number) ? Number(value) : value, + this.pkType.toLocaleLowerCase() === Primitives.STRING ? value : Number(value), ); for (const index of this.indexes as (keyof Model)[]) { if (index === this.pk) continue; diff --git a/src/lib/engine/NgxComponentDirective.ts b/src/lib/engine/NgxComponentDirective.ts index 7ee8f6ad..bf32a308 100644 --- a/src/lib/engine/NgxComponentDirective.ts +++ b/src/lib/engine/NgxComponentDirective.ts @@ -659,7 +659,7 @@ export abstract class NgxComponentDirective const { repository, pk, pkType } = context; this._repository = repository; if (this.model && !this.pk) this.pk = pk; - this.pkType = pkType || Model.pk(repository.class); + this.pkType = pkType; if (!this.modelName) this.modelName = repository.class.name; } } diff --git a/src/lib/i18n/data/en.json b/src/lib/i18n/data/en.json index bcb0c3cd..ecf0f814 100644 --- a/src/lib/i18n/data/en.json +++ b/src/lib/i18n/data/en.json @@ -28,7 +28,7 @@ "greaterThanOrEqual": "This field must be greater than or equal to field {0}", "form_control": "Controlador do formulário não encontrado para {0}.", "not_found": "No records found with {0}: {1} in {2}.", - "empty_options" : "No options available for required field {0}. Fix the data source." + "empty_options": "No options available for required field {0}. Fix the data source." }, "operations": { "read": { @@ -42,7 +42,7 @@ "error": "Error creating item." }, "update": { - "title": "Update", + "title": "Update", "success": "Successfully updated item with {0} {1}.", "error": "Error updating item with {0} {1}." }, @@ -54,7 +54,8 @@ "multiple": { "success": "Successfully processed all operations.", "error": "Error processing operations." - } + }, + "processing": "Processing {0}..." }, "component": { "crud_form": {