-
Notifications
You must be signed in to change notification settings - Fork 9
feat(query-builder): add overview and template samples #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IMinchev64
wants to merge
4
commits into
vnext
Choose a base branch
from
iminchev/querybuilder-samples
base: vnext
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9c997a4
feat(query-builder): add samples
IMinchev64 f819304
chore(browser): add query builder overview and template
IMinchev64 bf97b20
chore(query-builder): use PascalCase for method name
IMinchev64 b32079b
chore(query-builder): fix comment url in index.css
IMinchev64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| @using IgniteUI.Blazor.Controls | ||
| @inject IJSRuntime JS | ||
|
|
||
| <div class="container vertical"> | ||
| <div class="options horizontal fill"> | ||
| <IgbQueryBuilder @ref="queryBuilder" | ||
| Entities="Entities" | ||
| ExpressionTree="ExpressionTree" | ||
| ExpressionTreeChangeScript="WebQueryBuilderExpressionTreeChange"> | ||
| </IgbQueryBuilder> | ||
| </div> | ||
|
|
||
| <div class="container vertical fill"> | ||
| <IgbGrid @ref="grid" | ||
| Id="grid" | ||
| AutoGenerate="false" | ||
| Width="100%" | ||
| Height="420px"> | ||
| <IgbColumn Field="orderId" DataType="GridColumnDataType.Number"></IgbColumn> | ||
| <IgbColumn Field="customerId" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="companyName" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="contactName" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="contactTitle" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="employeeId" DataType="GridColumnDataType.Number"></IgbColumn> | ||
| <IgbColumn Field="shipperId" DataType="GridColumnDataType.Number"></IgbColumn> | ||
| <IgbColumn Field="orderDate" DataType="GridColumnDataType.Date"></IgbColumn> | ||
| <IgbColumn Field="requiredDate" DataType="GridColumnDataType.Date"></IgbColumn> | ||
| <IgbColumn Field="shipVia" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="freight" DataType="GridColumnDataType.Number"></IgbColumn> | ||
| <IgbColumn Field="shipName" DataType="GridColumnDataType.String"></IgbColumn> | ||
| <IgbColumn Field="completed" DataType="GridColumnDataType.Boolean"></IgbColumn> | ||
| </IgbGrid> | ||
| </div> | ||
| </div> | ||
|
|
||
| @code { | ||
| private static readonly string[] InitialReturnFields = | ||
| [ | ||
| "orderId", | ||
| "customerId", | ||
| "employeeId", | ||
| "shipperId", | ||
| "orderDate", | ||
| "requiredDate", | ||
| "shipVia", | ||
| "freight", | ||
| "shipName", | ||
| "completed" | ||
| ]; | ||
|
|
||
| private static readonly IgbFieldType[] CustomerFields = | ||
| [ | ||
| new() { Field = "customerId", DataType = GridColumnDataType.String }, | ||
| new() { Field = "companyName", DataType = GridColumnDataType.String }, | ||
| new() { Field = "contactName", DataType = GridColumnDataType.String }, | ||
| new() { Field = "contactTitle", DataType = GridColumnDataType.String } | ||
| ]; | ||
|
|
||
| private static readonly IgbFieldType[] OrderFields = | ||
| [ | ||
| new() { Field = "orderId", DataType = GridColumnDataType.Number }, | ||
| new() { Field = "customerId", DataType = GridColumnDataType.String }, | ||
| new() { Field = "employeeId", DataType = GridColumnDataType.Number }, | ||
| new() { Field = "shipperId", DataType = GridColumnDataType.Number }, | ||
| new() { Field = "orderDate", DataType = GridColumnDataType.Date }, | ||
| new() { Field = "requiredDate", DataType = GridColumnDataType.Date }, | ||
| new() { Field = "shipVia", DataType = GridColumnDataType.String }, | ||
| new() { Field = "freight", DataType = GridColumnDataType.Number }, | ||
| new() { Field = "shipName", DataType = GridColumnDataType.String }, | ||
| new() { Field = "completed", DataType = GridColumnDataType.Boolean } | ||
| ]; | ||
|
|
||
| private static readonly IgbEntityType[] Entities = | ||
| [ | ||
| new() { Name = "Customers", Fields = CustomerFields }, | ||
| new() { Name = "Orders", Fields = OrderFields } | ||
| ]; | ||
|
|
||
| private static readonly IgbExpressionTree ExpressionTree = new() | ||
| { | ||
| FilteringOperands = [], | ||
| Operator = FilteringLogic.And, | ||
| Entity = "Orders", | ||
| ReturnFields = InitialReturnFields | ||
| }; | ||
|
|
||
| private IgbQueryBuilder queryBuilder; | ||
| private IgbGrid grid; | ||
|
|
||
| protected override async Task OnAfterRenderAsync(bool firstRender) | ||
| { | ||
| if (!firstRender || queryBuilder is null || grid is null) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| await queryBuilder.EnsureReady(); | ||
| await grid.EnsureReady(); | ||
|
|
||
| await JS.InvokeVoidAsync("queryBuilderOverview.loadInitialData", new | ||
| { | ||
| filteringOperands = Array.Empty<object>(), | ||
| @operator = 0, | ||
| entity = "Orders", | ||
| returnFields = InitialReturnFields | ||
| }); | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
samples/interactions/query-builder/overview/BlazorClientApp.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <RazorLangVersion>3.0</RazorLangVersion> | ||
| <AssemblyName>Infragistics.Samples</AssemblyName> | ||
| <RootNamespace>Infragistics.Samples</RootNamespace> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
| <NoWarn>1701;1702,IDE0028,BL0005,0219,CS1998</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="IgniteUI.Blazor.Trial" Version="25.2.83" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.1" /> | ||
| <PackageReference Include="System.Net.Http.Json" Version="10.0.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Folder Include="Services\" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
25 changes: 25 additions & 0 deletions
25
samples/interactions/query-builder/overview/BlazorClientApp.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 18 | ||
| VisualStudioVersion = 18.2.11415.280 d18.0 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorClientApp", "BlazorClientApp.csproj", "{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {FC52AAC8-4488-40AE-9621-75F6BA744B18} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| using System; | ||
| using System.Net.Http; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
|
|
||
| // required for registering IgniteUIBlazor | ||
| using IgniteUI.Blazor.Controls; | ||
|
|
||
| namespace Infragistics.Samples | ||
| { | ||
| public class Program | ||
| { | ||
| public static async Task Main(string[] args) | ||
| { | ||
| var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
| builder.RootComponents.Add<App>("app"); | ||
|
|
||
| builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
|
|
||
| // registering Infragistics Blazor | ||
| builder.Services.AddIgniteUIBlazor( | ||
| typeof(IgbQueryBuilderModule), | ||
| typeof(IgbGridModule) | ||
| ); | ||
|
|
||
| await builder.Build().RunAsync(); | ||
| } | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
samples/interactions/query-builder/overview/Properties/launchSettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "iisSettings": { | ||
| "windowsAuthentication": false, | ||
| "anonymousAuthentication": true, | ||
| "iisExpress": { | ||
| "applicationUrl": "http://localhost:4200", | ||
| "sslPort": 44385 | ||
| } | ||
| }, | ||
| "profiles": { | ||
| "IIS Express": { | ||
| "commandName": "IISExpress", | ||
| "launchBrowser": true, | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| }, | ||
| "BlazorClientApp": { | ||
| "commandName": "Project", | ||
| "launchBrowser": true, | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| }, | ||
| "applicationUrl": "https://localhost:5001;http://localhost:4200" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!-- NOTE: do not change this file because it's auto re-generated from template: --> | ||
| <!-- https://github.com/IgniteUI/igniteui-blazor-examples/tree/vnext/templates/sample/ReadMe.md --> | ||
|
|
||
| This folder contains implementation of Blazor application with example of Overview feature using [Query Builder](https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-getting-started.html) component. | ||
|
|
||
| <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
| <body> | ||
| <a target="_blank" href="https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-getting-started.html" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://dl.infragistics.com/x/img/browsers/button-docs.png"/> | ||
| </a> | ||
| <a target="_blank" href="./App.razor" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://dl.infragistics.com/x/img/browsers/button-code.png"/> | ||
| </a> | ||
| <a target="_blank" href="https://infragistics.com/blazor-client/samples/interactions/query-builder/overview" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-run.png"/> | ||
| </a> | ||
| <!-- <a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-blazor-examples/tree/master/samples/interactions/query-builder/overview?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/App.razor" rel="noopener noreferrer"> | ||
| <img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-sandbox.png"/> | ||
| </a> --> | ||
| </body> | ||
| </html> | ||
|
|
||
| ## Branches | ||
|
|
||
| > **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-blazor-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-blazor-examples/tree/vnext) branch only when you want to contribute new samples to this repository. | ||
|
|
||
| ## Setup | ||
|
|
||
| - instal **.NET SDK** from this [website](https://dotnet.microsoft.com/learn/aspnet/blazor-tutorial/install) | ||
|
|
||
| ## Running App in Visual Studio 2022 | ||
|
|
||
| NOTE: VS 2022 has better code highlighting and error detection than VS Code does. | ||
|
|
||
| - open **Visual Studio 2022** as an administrator | ||
|
|
||
| - open the **BlazorClientApp.sln** solution | ||
|
|
||
| - right click solution and select **Restore NuGet Packages** menu item | ||
|
|
||
| - click **Debug** menu and select **Start Debugging** or press **F5** key | ||
|
|
||
|
|
||
| ## Running App in VS Code | ||
|
|
||
| - open **VS Code** as an administrator | ||
|
|
||
| - open this folder in **VS Code** | ||
|
|
||
| - open a terminal window | ||
|
|
||
| - to restore assemblies, run this command: | ||
| ```dotnet restore``` | ||
|
|
||
| - to run samples, run this command: | ||
| ```dotnet watch run``` | ||
|
|
||
| - wait for for message: | ||
|
IMinchev64 marked this conversation as resolved.
|
||
| **Now listening on: http://localhost:4200** | ||
|
|
||
| - open **http://localhost:4200** in your browser | ||
|
|
||
|
|
||
| ## Resources | ||
|
|
||
| - [Razor Component Models](https://www.codemag.com/article/1911052) | ||
| - [Razor Syntax](https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-3.1#razor-syntax) | ||
| - [Getting reference to components](https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-3.1#capture-references-to-components) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| @using System.Net.Http | ||
| @using System.Net.Http.Json | ||
| @using Microsoft.AspNetCore.Components.Forms | ||
| @using Microsoft.AspNetCore.Components.Routing | ||
| @using Microsoft.AspNetCore.Components.Web | ||
| @using Microsoft.AspNetCore.Components.WebAssembly.Http | ||
| @using Microsoft.JSInterop | ||
| @using Infragistics.Samples |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.