diff --git a/src/app/components/pab-results/pab-results-table.component.html b/src/app/components/pab-results/pab-results-table.component.html index 4a86d0a987436e5a49b4ae273a74ba8de11c90fa..ce1029faef169b64fc08b8bb7215bf0ea99ec43a 100644 --- a/src/app/components/pab-results/pab-results-table.component.html +++ b/src/app/components/pab-results/pab-results-table.component.html @@ -1,5 +1,5 @@ <!-- @TODO copied from var-results.component.html > merge ?--> -<div class="pab-results-table-container" #pabResultsTable *ngIf="hasResults" fxLayout="row wrap" fxLayoutAlign="center center"> +<div class="pab-results-table-container" #pabResultsTable fxLayout="row wrap" fxLayoutAlign="center center"> <div fxFlex="1 1 100%"> <div class="pab-results-table-buttons"> <button mat-icon-button (click)="exportAsSpreadsheet()"> diff --git a/src/app/components/pab-results/pab-results-table.component.ts b/src/app/components/pab-results/pab-results-table.component.ts index b5b202e67bae9cc7c7e5a6036ed05578e73aed7f..3080acf1f7415f4c7734b20dc262fc7765ea1b55 100644 --- a/src/app/components/pab-results/pab-results-table.component.ts +++ b/src/app/components/pab-results/pab-results-table.component.ts @@ -117,10 +117,6 @@ export class PabResultsTableComponent extends ResultsComponent { } } - public get hasResults(): boolean { - return this._pabResults && this._pabResults.hasResults; - } - public get headers() { return this._headers; } diff --git a/src/app/components/pab-results/pab-results.component.html b/src/app/components/pab-results/pab-results.component.html index 6f8a67cb0c7f8421d8982355834c5bee8462325d..b80345d1ef1234d83c45f37fc73658e740d019ef 100644 --- a/src/app/components/pab-results/pab-results.component.html +++ b/src/app/components/pab-results/pab-results.component.html @@ -9,9 +9,9 @@ <div> <!-- tableau de résultats --> - <pab-results-table [results]="pabResults"></pab-results-table> + <pab-results-table *ngIf="hasDisplayableResults" [results]="pabResults"></pab-results-table> </div> - <results-graph *ngIf="hasResults"></results-graph> + <results-graph *ngIf="hasDisplayableResults"></results-graph> </div> diff --git a/src/app/components/pab-results/pab-results.component.ts b/src/app/components/pab-results/pab-results.component.ts index a0c5e16ab14214ad212e65fb460a0483cefefa1e..10f7aa941155c903beac95e624fdba7c0326b833 100644 --- a/src/app/components/pab-results/pab-results.component.ts +++ b/src/app/components/pab-results/pab-results.component.ts @@ -199,6 +199,7 @@ export class PabResultsComponent implements DoCheck { private updateResults() { let pabUpdated: boolean; let graphUpdated: boolean; + let selectorUpdated: boolean; // results or not, there might be a log const logUpdated = (this.iterationLogComponent !== undefined || this.generalLogComponent !== undefined); // gne ? @@ -212,6 +213,9 @@ export class PabResultsComponent implements DoCheck { pabUpdated = this.pabResultsTableComponent !== undefined; if (pabUpdated) { this.pabResultsTableComponent.results = this._pabResults; + } + selectorUpdated = this.pabVariableResultsSelectorComponent !== undefined; + if (selectorUpdated) { this.pabVariableResultsSelectorComponent.results = this._pabResults; } graphUpdated = this.resultsGraphComponent !== undefined; @@ -222,9 +226,10 @@ export class PabResultsComponent implements DoCheck { } else { pabUpdated = true; graphUpdated = true; + selectorUpdated = true; } - return pabUpdated && logUpdated && graphUpdated; + return pabUpdated && logUpdated && graphUpdated && selectorUpdated; } public get pabResults() { @@ -244,6 +249,21 @@ export class PabResultsComponent implements DoCheck { return this._pabResults && this._pabResults.hasResults; } + public get hasDisplayableResults(): boolean { + let ret = this._pabResults && this._pabResults.hasResults; + if ( + this._pabResults + && this._pabResults.variatedParameters + && this._pabResults.variatedParameters.length > 0 + ) { + ret = ret + && this._pabResults.variableIndex !== undefined + && this._pabResults.result.resultElements[this._pabResults.variableIndex] !== undefined + && this._pabResults.result.resultElements[this._pabResults.variableIndex].resultsOk; + } + return ret; + } + public get uitextGeneralLogTitle(): string { return this.i18nService.localizeText("INFO_TITREJOURNAL_GLOBAL"); }