diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 901ed8f2ae922c3d19d9d48930ed972812699cbf..aaf15f2ff9664928af4ead5a277ff5aeedeb9203 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,7 +60,7 @@ jalhyd: - rm -rf jalhyd - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.irstea.fr/cassiopee/jalhyd.git - cd jalhyd - - git checkout "$JALHYD_BRANCH" || git checkout master + - git checkout "$JALHYD_BRANCH" || git checkout devel - npm ci --force - npm run build diff --git a/jalhyd_branch b/jalhyd_branch index f4a6ca09b82270a2fb873b96b57291c379fc4366..089b58e4022e4235ee887b0190e963d9b5a3e56e 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -289-liens-inaccessibles-pour-certains-modules +317-pab-lancement-du-calcul-possible-avec-des-champs-vides diff --git a/src/app/components/pab-table/pab-table.component.html b/src/app/components/pab-table/pab-table.component.html index 293bd1b077c9dde9b999c953e080508a8b516288..70dfaa219dca2d79983fa9227181e39369f43d90 100644 --- a/src/app/components/pab-table/pab-table.component.html +++ b/src/app/components/pab-table/pab-table.component.html @@ -85,8 +85,9 @@ [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" - [(ngModel)]="cell.model.singleValue" (input)="inputValueChanged($event, cell)"> + <input matInput *ngIf="isNumberInput(cell)" step="0.00000000000001" type="number" required + [ngModel]="getCellValue(cell)" (ngModelChange)="setCellValue(cell,$event)" + (input)="inputValueChanged($event, cell)"> <mat-select #selectWidget *ngIf="isSelect(cell)" [value]="cell.modelValue" (selectionChange)="loiDebitSelected($event, cell)"> @@ -101,7 +102,8 @@ {{ cell.title }} </div> <param-field-line class="qaFieldLine" [param]="cell.model" (radio)="inputValueChanged($event, cell)" - (input)="inputValueChanged($event, cell)" [captureTabEvents]="false"> + (input)="inputValueChanged($event, cell)" [captureTabEvents]="false" + fixedPlaceHolder=""> </param-field-line> </div> diff --git a/src/app/components/pab-table/pab-table.component.ts b/src/app/components/pab-table/pab-table.component.ts index 7d95042fbe040b74b0ce78be4079036ccdc2478e..f22816c7dfc97d65842dede42319def5acb459a2 100644 --- a/src/app/components/pab-table/pab-table.component.ts +++ b/src/app/components/pab-table/pab-table.component.ts @@ -190,6 +190,9 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni if (cell.uiValidity !== undefined) { valid = valid && cell.uiValidity; } + if (cell.modelValidity !== undefined) { + valid = valid && cell.modelValidity; + } return ! valid; } @@ -1439,6 +1442,19 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni this.updateValidity(); } + public getCellValue(cell) { + return cell.model.singleValue; + } + + public setCellValue(cell, event) { + try { + cell.model.singleValue = event + cell.modelValidity = undefined; + } catch (error) { + cell.modelValidity = false; + } + } + /** * Computes the global Pab validity : validity of every cell of every row */ diff --git a/src/app/components/param-field-line/param-field-line.component.html b/src/app/components/param-field-line/param-field-line.component.html index a9114f5f2974450548c16151f381f711af3adb29..641d9c4b026793c3f12900a2de31ee916068ff30 100644 --- a/src/app/components/param-field-line/param-field-line.component.html +++ b/src/app/components/param-field-line/param-field-line.component.html @@ -3,7 +3,7 @@ <!-- input de saisie de la valeur --> <div fxFlex="1 0 120px"> <!-- composant pour gérer le cas général (valeur numérique à saisir) --> - <ngparam-input [title]="param.title" [hidden]="! isRadioFixChecked" (change)="onInputChange($event)" + <ngparam-input [title]="fixedPlaceHolder" [hidden]="! isRadioFixChecked" (change)="onInputChange($event)" (tabPressed)="onTabPressed($event)" [captureTabEvents]="captureTabEvents"> </ngparam-input> diff --git a/src/app/components/param-field-line/param-field-line.component.ts b/src/app/components/param-field-line/param-field-line.component.ts index 0c68a61120b4a2a02c1c523896277eeba9fe8083..623690306d3e53cfc750b87767b7ea3c1574bbc8 100644 --- a/src/app/components/param-field-line/param-field-line.component.ts +++ b/src/app/components/param-field-line/param-field-line.component.ts @@ -45,6 +45,21 @@ export class ParamFieldLineComponent implements OnChanges { return this.intlService.localizeText("INFO_PARAMFIELD_PARAMLIE"); } + /** user defined parameter placeholder (fixed mode) */ + private _fixedPlaceHolder: string; + + public get fixedPlaceHolder(): string { + if (this._fixedPlaceHolder !== undefined) { + return this._fixedPlaceHolder; + } + return this.param.title; + } + + @Input() + public set fixedPlaceHolder(ph: string) { + this._fixedPlaceHolder = ph; + } + // états booléens des boutons public get isRadioFixChecked(): boolean { diff --git a/src/app/formulaire/elements/ngparam.ts b/src/app/formulaire/elements/ngparam.ts index c4d6c146e010d746c54e61c8ede01b2311d3cd03..869e54e20f8131656548962e8d30bb56df4da946 100644 --- a/src/app/formulaire/elements/ngparam.ts +++ b/src/app/formulaire/elements/ngparam.ts @@ -32,6 +32,9 @@ export class NgParameter extends InputField implements Observer { /** set to true to disable UI validation on this input */ private _allowEmpty = false; + /** user defined title (if undefined : parameter label + unit */ + private _title: string; + public radioConfig: ParamRadioConfig; public disabled: boolean; @@ -269,6 +272,10 @@ export class NgParameter extends InputField implements Observer { } public get title(): string { + if (this._title !== undefined) { + return this._title; + } + let t = ""; if (this.label !== undefined) { t = this.label; @@ -279,6 +286,13 @@ export class NgParameter extends InputField implements Observer { return t; } + /** + * set custom title + */ + public set title(t: string) { + this._title = t; + } + public get valuesIterator(): INumberIterator { return this._paramDef.valuesIterator; }