From b579cf985a807fc2708465ff28efa2a2f3ee43a0 Mon Sep 17 00:00:00 2001 From: teodosia Date: Fri, 18 Oct 2024 13:09:42 +0300 Subject: [PATCH] revert: refactor(query-builder): add entities to query builder styling sample --- .../query-builder-style.component.html | 3 +- .../query-builder-style.component.ts | 68 +++++-------------- 2 files changed, 19 insertions(+), 52 deletions(-) diff --git a/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.html b/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.html index 88a699c7f..86cdfb00e 100644 --- a/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.html +++ b/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.html @@ -1,3 +1,2 @@ - + diff --git a/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.ts b/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.ts index 852082fcb..ed290a860 100644 --- a/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.ts +++ b/src/app/interactions/query-builder/query-builder-style/query-builder-style.component.ts @@ -1,57 +1,25 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'app-query-builder-style-sample', styleUrls: ['./query-builder-style.component.scss'], templateUrl: 'query-builder-style.component.html' }) -export class QueryBuilderStyleComponent implements OnInit { - public entities: any[]; - public companiesFields: any[]; - public ordersFields: any[]; - - public ngOnInit(): void { - this.companiesFields = [ - { field: "ID", dataType: "string" }, - { field: "CompanyName", dataType: "string" }, - { field: "ContactName", dataType: "string" }, - { field: "Employees", dataType: "number" }, - { field: "ContactTitle", dataType: "string" }, - { field: "DateCreated", dataType: "date" }, - { field: "TimeCreated", dataType: "time" }, - { field: "Address", dataType: "string" }, - { field: "City", dataType: "string" }, - { field: "Region", dataType: "string" }, - { field: "PostalCode", dataType: "string" }, - { field: "Phone", dataType: "string" }, - { field: "Fax", dataType: "string" }, - { field: "Contract", dataType: "boolean" } - ]; - - this.ordersFields = [ - { field: "OrderId", dataType: "number" }, - { field: "EmployeeId", dataType: "number" }, - { field: "OrderDate", dataType: "date" }, - { field: "RequiredDate", dataType: "date" }, - { field: "ShippedDate", dataType: "date" }, - { field: "ShipVia", dataType: "number" }, - { field: "Freight", dataType: "number" }, - { field: "ShipName", dataType: "string" }, - { field: "ShipCity", dataType: "string" }, - { field: "ShipPostalCode", dataType: "string" }, - { field: "ShipCountry", dataType: "string" }, - { field: "Region", dataType: "string" } - ]; - - this.entities = [ - { - name: "Companies", - fields: this.companiesFields - }, - { - name: "Orders", - fields: this.ordersFields - } - ]; - } +export class QueryBuilderStyleComponent { + public fields: any[] = [ + { field: 'ID', dataType: 'string' }, + { field: 'CompanyName', dataType: 'string' }, + { field: 'ContactName', dataType: 'string' }, + { field: 'Employees', dataType: 'number' }, + { field: 'ContactTitle', dataType: 'string' }, + { field: 'DateCreated', dataType: 'date' }, + { field: 'TimeCreated', dataType: 'time' }, + { field: 'Address', dataType: 'string' }, + { field: 'City', dataType: 'string' }, + { field: 'Region', dataType: 'string' }, + { field: 'PostalCode', dataType: 'string' }, + { field: 'Phone', dataType: 'string' }, + { field: 'Fax', dataType: 'string' }, + { field: 'Contract', dataType: 'boolean' } + ]; }