From c2f5df0271ea1a78a9505116c2766c53c6573e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Thu, 30 Jun 2022 15:50:32 +0200 Subject: [PATCH 1/5] update jalhyd_branch refs #552 --- jalhyd_branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jalhyd_branch b/jalhyd_branch index f4a6ca09b..089b58e40 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 -- GitLab From 4b967662c6879c4e002a6adc77153ee23e37ba1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Thu, 30 Jun 2022 16:15:26 +0200 Subject: [PATCH 2/5] fix: fish ladder: invalidate "calculate" button if any table cell is empty refs #552 --- src/app/components/pab-table/pab-table.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/pab-table/pab-table.component.html b/src/app/components/pab-table/pab-table.component.html index 293bd1b07..063a7339a 100644 --- a/src/app/components/pab-table/pab-table.component.html +++ b/src/app/components/pab-table/pab-table.component.html @@ -85,7 +85,7 @@ [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" + <input matInput *ngIf="isNumberInput(cell)" step="0.00000000000001" type="number" required [(ngModel)]="cell.model.singleValue" (input)="inputValueChanged($event, cell)"> <mat-select #selectWidget *ngIf="isSelect(cell)" [value]="cell.modelValue" -- GitLab From ff6222db5c129bd711c410ea5fa3ad3093305727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Fri, 1 Jul 2022 12:14:07 +0200 Subject: [PATCH 3/5] fix: fish ladder: invalidate "calculate" button on domain invalid table values refs #552 --- .../pab-table/pab-table.component.html | 3 ++- .../components/pab-table/pab-table.component.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/app/components/pab-table/pab-table.component.html b/src/app/components/pab-table/pab-table.component.html index 063a7339a..e27aeda84 100644 --- a/src/app/components/pab-table/pab-table.component.html +++ b/src/app/components/pab-table/pab-table.component.html @@ -86,7 +86,8 @@ [title]="cellTitle(cell)"> <input matInput *ngIf="isNumberInput(cell)" step="0.00000000000001" type="number" required - [(ngModel)]="cell.model.singleValue" (input)="inputValueChanged($event, cell)"> + [ngModel]="getCellValue(cell)" (ngModelChange)="setCellValue(cell,$event)" + (input)="inputValueChanged($event, cell)"> <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 7d95042fb..f22816c7d 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 */ -- GitLab From e0b921a572e3f97f6b5580f52a3df4764fbed979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Fri, 1 Jul 2022 13:04:36 +0200 Subject: [PATCH 4/5] fix: fish ladder: remove place holder in attraction flow input refs #552 --- .../components/pab-table/pab-table.component.html | 3 ++- .../param-field-line.component.html | 2 +- .../param-field-line.component.ts | 15 +++++++++++++++ src/app/formulaire/elements/ngparam.ts | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/app/components/pab-table/pab-table.component.html b/src/app/components/pab-table/pab-table.component.html index e27aeda84..70dfaa219 100644 --- a/src/app/components/pab-table/pab-table.component.html +++ b/src/app/components/pab-table/pab-table.component.html @@ -102,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/param-field-line/param-field-line.component.html b/src/app/components/param-field-line/param-field-line.component.html index a9114f5f2..641d9c4b0 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 0c68a6112..623690306 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 c4d6c146e..869e54e20 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; } -- GitLab From 8bdd85e498c49ed8bd6b574639a14a98cb9f7f7b Mon Sep 17 00:00:00 2001 From: David Dorchies <david.dorchies@inrae.fr> Date: Fri, 1 Jul 2022 14:09:00 +0000 Subject: [PATCH 5/5] fix(ci): fall back on jalhyd devel branch instead of master if the requested jalhyd branch does not exists This allows to run CI jobs on a nghyd developpement branch when the corresponding jalhyd branch has already been merged into devel. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 901ed8f2a..aaf15f2ff 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 -- GitLab