diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92811cedb1fad95a05865e51acd895e050f929ce..4c09990f8a08e309ba5225e11e5f4c320309ee3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ stages: - releases-version default: - tags: [docker] + tags: [mia2] image: geaucassiopee/ci-cd-cross-platform-webapp:v3 variables: diff --git a/jalhyd_branch b/jalhyd_branch index de46203d553111974d009468e3acd939c142406d..d64531f1305e091791eac674c3a36d86b9e17ddd 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -350-modifier-l-avertissement-de-limite-d-ennoiement-de-villemonte +devel diff --git a/src/app/components/pab-table/pab-table.component.html b/src/app/components/pab-table/pab-table.component.html index d3b0c017eeb1010229cc3362691195e9eecd3d9d..283b07d1b3ee73e35bef122f2f5b08c000a55ab8 100644 --- a/src/app/components/pab-table/pab-table.component.html +++ b/src/app/components/pab-table/pab-table.component.html @@ -86,9 +86,11 @@ [class.select]="isSelect(cell)" [attr.rowspan]="rowSpan(cell)" [attr.colspan]="colSpan(cell)" [title]="cellTitle(cell)"> - <input matInput *ngIf="isNumberInput(cell)" step="0.00000000000001" type="number" required - [ngModel]="getCellValue(cell)" (ngModelChange)="setCellValue(cell,$event)" - (input)="inputValueChanged($event, cell)"> + <input matInput *ngIf="isNumberInput(cell)" type="text" required + [ngModel]="getCellValue(cell)" (ngModelChange)="setCellValue(cell,$event)" + (input)="inputValueChanged($event, cell)" (keypress) ="invalidNANInputValue($event)" + pattern="^-?[0-9]*\.?[0-9]*$" inputmode="numeric" + > <mat-select #selectWidget *ngIf="isSelect(cell)" [value]="cell.modelValue" (selectionChange)="loiDebitSelected($event, cell)"> diff --git a/src/app/components/pab-table/pab-table.component.ts b/src/app/components/pab-table/pab-table.component.ts index 8d48ab20a3b7a42edc349e47a265f229f51b342c..32f6b8248eb43fc66708d86e10cf3854ca62153a 100644 --- a/src/app/components/pab-table/pab-table.component.ts +++ b/src/app/components/pab-table/pab-table.component.ts @@ -1388,12 +1388,21 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni return round(cell.model.singleValue, this.nDigits); } - public setCellValue(cell, event) { - try { - cell.model.singleValue = event - cell.modelValidity = undefined; - } catch (error) { - cell.modelValidity = false; + public setCellValue(cell, $event) { + if($event !== "-" && $event !== "") { + try { + cell.model.singleValue = $event; + cell.modelValidity = undefined; + } catch (error) { + cell.modelValidity = false + } + } + } + + public invalidNANInputValue(e: any) { + var rgx = /^-?[0-9]*\.?[0-9]*$/; + if(e.key.match(rgx) === null) { + e.preventDefault(); } }