Skip to content

Commit a113286

Browse files
committed
feat(query-builder): update styles and configuration
1 parent 69d4b25 commit a113286

7 files changed

Lines changed: 13 additions & 138 deletions

File tree

live-editing/configs/QueryBuilderConfigGenerator.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { Config, IConfigGenerator} from 'igniteui-live-editing'
22
import { BaseAppConfig } from './BaseConfig';
33
export class QueryBuilderConfigGenerator implements IConfigGenerator {
4-
public additionalImports = {
5-
RemoteLoDService: '../../src/app/services/remote-lod.service'
6-
};
7-
84
public generateConfigs(): Config[] {
95
const configs = new Array<Config>();
106

@@ -29,7 +25,6 @@ export class QueryBuilderConfigGenerator implements IConfigGenerator {
2925

3026
configs.push(new Config({
3127
component: 'QueryBuilderSqlSampleComponent',
32-
additionalFiles: ['/src/app/interactions/query-builder/query-builder-sql-sample/data-query.ts'],
3328
appConfig: BaseAppConfig,
3429
shortenComponentPathBy: "/interactions/query-builder/"
3530
}));

package-lock.json

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
"minireset.css": "0.0.6",
8383
"rxjs": "^7.8.2",
8484
"sql-formatter": "^15.4.11",
85-
"sql.js": "^1.12.0",
8685
"tslib": "^2.6.1",
8786
"zone.js": "~0.15.0"
8887
},

src/app/interactions/query-builder/query-builder-sql-sample/data-query.ts

Lines changed: 0 additions & 118 deletions
This file was deleted.

src/app/interactions/query-builder/query-builder-sql-sample/query-builder-sql-sample.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<igx-query-builder #queryBuilder
44
[entities]="entities"
55
[(expressionTree)]="expressionTree"
6-
(expressionTreeChange)="executeQuery()">
6+
(expressionTreeChange)="executeQuery()"
7+
class="output-area">
78
</igx-query-builder>
89

910
<div class="output-area">

src/app/interactions/query-builder/query-builder-sql-sample/query-builder-sql-sample.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.container {
88
display: flex;
99
flex-wrap: wrap;
10+
margin-right: 20px;
1011
}
1112

1213
igx-query-builder {
@@ -16,8 +17,8 @@ igx-query-builder {
1617
.output-area{
1718
flex: 1 200px;
1819
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.75);
19-
border-radius: 4px;
20-
margin: 5px 20px 20px 20px;
20+
border-radius: 0.75rem;
21+
margin: 5px 0px 20px 20px;
2122
word-break: break-all;
2223
word-wrap: break-word;
2324

src/app/interactions/query-builder/query-builder-sql-sample/query-builder-sql-sample.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { HttpClient } from '@angular/common/http';
2-
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
3-
import { EntityType, FieldType, FilteringExpressionsTree, IExpressionTree, IgxGridComponent, IgxQueryBuilderComponent, IgxStringFilteringOperand } from 'igniteui-angular';
2+
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
3+
import { EntityType, FilteringExpressionsTree, IExpressionTree, IgxGridComponent, IgxQueryBuilderComponent, IgxStringFilteringOperand } from 'igniteui-angular';
44
import { format } from 'sql-formatter';
5+
56
const API_ENDPOINT = 'https://data-northwind.indigo.design';
67

78
@Component({
@@ -22,7 +23,7 @@ export class QueryBuilderSqlSampleComponent implements OnInit {
2223
public expressionTree: IExpressionTree;
2324
public sqlQuery: string = 'SQL Query will be displayed here';
2425

25-
constructor(private http: HttpClient) {}
26+
constructor(private http: HttpClient, private cdr: ChangeDetectorRef) {}
2627

2728
public ngOnInit(): void {
2829
this.setEntities();
@@ -80,7 +81,7 @@ export class QueryBuilderSqlSampleComponent implements OnInit {
8081
}
8182

8283
private setInitialExpressionTree() {
83-
const categoriesTree = new FilteringExpressionsTree(0, undefined, 'Categories', ['categoryId', 'name']);
84+
const categoriesTree = new FilteringExpressionsTree(0, undefined, 'Categories', ['categoryId']);
8485
categoriesTree.filteringOperands.push({
8586
fieldName: 'name',
8687
conditionName: IgxStringFilteringOperand.instance().condition('equals').name,
@@ -210,8 +211,11 @@ export class QueryBuilderSqlSampleComponent implements OnInit {
210211
}
211212

212213
private setGridData() {
214+
this.grid.isLoading = true;
213215
this.http.post(`${API_ENDPOINT}/QueryBuilder/ExecuteQuery`, this.expressionTree).subscribe(data => {
214216
this.gridData = Object.values(data)[0] as any[];
217+
this.grid.isLoading = false;
215218
});
219+
this.cdr.detectChanges();
216220
}
217221
}

0 commit comments

Comments
 (0)