Skip to content

Commit

Permalink
Merge branch 'edaquery2' of https://github.com/jortilles/EDA into eda…
Browse files Browse the repository at this point in the history
…query2
  • Loading branch information
jortilles committed Mar 20, 2024
2 parents fc2f347 + e70ba65 commit eada1c4
Show file tree
Hide file tree
Showing 18 changed files with 1,426 additions and 440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ export abstract class QueryBuilderService {
}
}
}

for (const filter of this.queryTODO.filters) {
if (filter.joins && filter.joins.length > 0) {
for (const join of filter.joins) {
tree.push(join);
}
}
}

// console.log(JSON.stringify( [...new Set(tree)] ));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ export class EdaBlankPanelComponent implements OnInit {
* @param filter filter so set
*/
public setGlobalFilter(filter) {
console.log('setGlobalFilter', filter);
if (filter.filter_elements[0].value1.length === 0) {
let filters = this.globalFilters;
this.globalFilters = filters.filter(f => f.filter_id !== filter.filter_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,12 @@ export class PanelChartComponent implements OnInit, OnChanges, OnDestroy {
}

public updateComponent() {
if (this.componentRef) {
this.componentRef.instance.updateChart();
if (this.componentRef && !['table', 'crosstable'].includes(this.props.chartType)) {
try {
this.componentRef.instance?.updateChart();
} catch(err) {
console.error(err);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export const PanelInteractionUtils = {
assertTable.table_name = column.table_id;
assertTable.display_name.default = displayName;
assertTable.description.default = displayName;
// console.log('assertTable', assertTable);
ebp.assertedTables.push(assertTable);
ebp.tables.push(assertTable);
}
Expand Down Expand Up @@ -183,9 +182,14 @@ export const PanelInteractionUtils = {
joins
};

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

// Check if the childNode have more possible paths to explore
const isexpandible = ebp.tables.some((source) => {
return source.table_name == childNode.child_id &&
(source.relations||[]).some((rel: any) => rel.target_table != table_id);
});

// If it's expandable, we add properties to expand the node.
if (isexpandible) {
childNode.expandedIcon = "pi pi-folder-open";
Expand Down
109 changes: 2 additions & 107 deletions eda/eda_app/src/app/module/pages/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,105 +15,7 @@ <h3 *ngIf="!titleClick" class="eda-title"> {{title}} </h3>
<!-- ============================================================== -->
<!-- GLOBAL FILTERS -->
<!-- ============================================================== -->
<div [ngClass]="{'noShow': display_v.panelMode }" > <!-- panel mode es per quan vull mostrat nomes un panell-->
<div *ngIf="filtersList.length > 0" class="d-flex align-items-end" style="margin: 0.5em; gap: 10px; flex-wrap: wrap;" >


<button
*ngIf="userService.isAdmin || filterButtonVisibility.public || isDashboardCreator"
id="dashFilterBtn"
[label]="filtrar"
pButton pRipple type="button"
icon="pi pi-filter"
style="height: 36px; min-width: 80px;"
(click)="reloadPanelsWithTimeOut()"
class="p-button-raised p-button-outlined filters-size">
</button>



<div *ngFor="let filter of filtersList" class="filter-set d-flex align-items-center">
<span *ngIf="userService.isAdmin || filter.visible === 'public' || filter.visible === 'readOnly' || isDashboardCreator" class="filter-name filters-size"> {{filter.column.label}}: </span>
<p-multiSelect *ngIf="filter.data && filter.column.value.column_type !== 'date' && (userService.isAdmin || filter.visible == 'public' || isDashboardCreator) "
[options]="filter.data"
[(ngModel)]="filter.selectedItems"
[virtualScroll]="true"
itemSize="30"
[maxSelectedLabels]="3"
defaultLabel="{{filter.column.label}}"
display="chip"
class="customMultiselect filters-size"
[style]="{'max-width': '250px', 'min-width':'200px', 'font-family':'var(--eda-filters-font-family)'}"
[Show]="adjustSize(filter)"
(onChange)="applyGlobalFilter(filter)">

<p-footer>
<button *ngIf="canIedit()" id="dashFilterConf"
pButton pRipple type="button"
icon="pi pi-cog"
(click)="onFilterConfig(false, filter)"
class="p-button-rounded p-button-outlined filters-size">
</button>

<button *ngIf="autoClear"
pButton pRipple type="button"
icon="pi pi-undo"
(click)="clearRangeDates();emitChanges();"
class="p-button-rounded p-button-outlined">
</button>
</p-footer>
</p-multiSelect>

<p-multiSelect *ngIf="filter.data && filter.column.value.column_type !== 'date' && (!userService.isAdmin && filter.visible === 'readOnly' && !isDashboardCreator)"
[options]="filter.data"
[(ngModel)]="filter.selectedItems"
[virtualScroll]="true"
itemSize="30"
[maxSelectedLabels]="3"
defaultLabel="{{filter.column.label}}"
display="chip"
disabled="true"
class="customMultiselect filters-size"
[style]="{'max-width': '250px', 'min-width':'200px', 'font-family':'var(--eda-filters-font-family)'}"
[Show]="adjustSize(filter)"
(onChange)="applyGlobalFilter(filter)">

<p-footer>
<button id="dashFilterConf"
pButton pRipple type="button"
icon="pi pi-cog"
(click)="onFilterConfig(false, filter)"
class="p-button-rounded p-button-outlined filters-size">
</button>

<button *ngIf="autoClear"
pButton pRipple type="button"
icon="pi pi-undo"
(click)="clearRangeDates();emitChanges();"
class="p-button-rounded p-button-outlined">
</button>
</p-footer>
</p-multiSelect>

<eda-date-picker
*ngIf="filter.column.value.column_type === 'date' && (filter.visible === 'public' || userService.isAdmin || isDashboardCreator) "
[autoClear]="true"
[inject]="datePickerConfigs[filter.id]"
(onRemove)="removeGlobalFilter(filter, true)"
(onDatesChanges)="processPickerEvent($event, filter)">

<ng-container footer>
<button id="dashFilterConf"
pButton pRipple type="button"
icon="pi pi-cog"
(click)="onFilterConfig(false, filter)"
class="p-button-rounded p-button-outlined filters-size">
</button>
</ng-container>
</eda-date-picker>
</div>
</div>
</div>
<app-global-filter #globalFilter [dashboard]="this" ></app-global-filter>

<ngx-gridster class="dashboard-grid" [options]="gridsterOptions" [draggableOptions]="gridsterDraggableOptions" #gridster1 >
<!-- Normal Size -->
Expand Down Expand Up @@ -153,11 +55,6 @@ <h3 *ngIf="!titleClick" class="eda-title"> {{title}} </h3>

</div>

<!-- ============================================================== -->
<!-- GLOBAL FILTERS PANEL -->
<!-- ============================================================== -->
<dashboard-filter-dialog *ngIf="filterController" [controller]="filterController"></dashboard-filter-dialog>

<!-- ============================================================== -->
<!-- SENT VIA EMAIL PANEL -->
<!-- ============================================================== -->
Expand Down Expand Up @@ -185,11 +82,9 @@ <h3 *ngIf="!titleClick" class="eda-title"> {{title}} </h3>
[style]="{width:'21em', overflow: 'auto'}" >

<div>

<div class="right-sidebar-blocks-title mt-1">
<span class="ml-2">{{datasourceName}}</span>
</div>

</div>
<hr>

Expand All @@ -207,7 +102,7 @@ <h3 *ngIf="!titleClick" class="eda-title"> {{title}} </h3>
</div>
</div>

<div *ngIf="display_v.edit_mode" class="right-sidebar-blocks-options block-options-bg pointer mt-1" (click)="addGlobalFilter()">
<div *ngIf="display_v.edit_mode" class="right-sidebar-blocks-options block-options-bg pointer mt-1" (click)="globalFilter?.onShowGlobalFilter(true)">
<div>
<i id="newFilter" class="fa fa-filter"></i>
<span i18n="@@opcionFiltro" class="ml-2">NUEVO FILTRO</span>
Expand Down
Loading

0 comments on commit eada1c4

Please sign in to comment.