Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed Feb 21, 2024
1 parent 406c0b7 commit 2f1863b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,13 @@ <h5 i18n="@@resumenFiltrosInformeH6">
<div class="col-1">
<!-- <div i18n="@@edaMode" *ngIf="!modeSQL">Modo EDA</div>
<div i18n="@@sqlMode" *ngIf="modeSQL">Modo SQL</div> -->

<p-dropdown [(ngModel)]="selectedQueryMode" [options]="queryModes" (ngModelChange)="changeQueryMode()" [style]="{'width': '100%'}">
</p-dropdown>

<!--
<p-selectButton [(ngModel)]="selectedQueryMode" [options]="queryModes" (ngModelChange)="changeQueryMode()" [style]="{'width': '100%'}">
</p-selectButton >
-->
<p-dropdown [(ngModel)]="selectedQueryMode" [options]="queryModes" (ngModelChange)="changeQueryMode()" [style]="{'width': '100%'}">
</p-dropdown >

<!-- <p-inputSwitch id="switchQueryMode" class="col-1 sql-switch" (onChange)="changeQueryMode()" #switchMode
[(ngModel)]="modeSQL" [pTooltip]="ptooltipSQLmode" tooltipPosition="left">
</p-inputSwitch> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export class EdaBlankPanelComponent implements OnInit {
public queryModes: any[] = [
{ label: 'EDA Query', value: 'EDA' },
{ label: 'SQL Query', value: 'SQL' },
{ label: 'EDA Joins Query', value: 'EDA2' }
{ label: 'Tree Query', value: 'EDA2' }
];
public selectedQueryMode: string = 'EDA';
public selectedQueryMode: string = 'EDA2';

// Depreacted use selectedQueryMode instead of
// public modeSQL: boolean;
Expand Down Expand Up @@ -671,7 +671,7 @@ export class EdaBlankPanelComponent implements OnInit {
}
}


PanelInteractionUtils.loadTableNodes(this);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export const PanelInteractionUtils = {
// Sort columns by default display name
ebp.columns = filteredColumns.sort((a, b) => a.display_name.default.localeCompare(b.display_name.default));

// if(!treeClick){ Juanjo?
if(treeClick || ebp.selectedQueryMode == 'EDA2') {
if(!treeClick){
PanelInteractionUtils.loadTableNodes(ebp);
}
// Reset input and update table data if the findTable ngModel is not empty
Expand Down Expand Up @@ -151,7 +150,7 @@ export const PanelInteractionUtils = {
// Label to show on the treeComponent
let childLabel = relation.display_name?.default
? `${relation.display_name.default}`
: `${relation.target_table} - ${relation.target_column[0]}`;
: ` ${relation.source_column[0]} - ${relation.target_table} `;

// Check if the childNode have more possible paths to explore
let isexpandible = dataSource.find((source) => relation.target_table == source.table_name)?.relations?.length > 0;
Expand Down

0 comments on commit 2f1863b

Please sign in to comment.