Skip to content

Commit c16cc6f

Browse files
auto sync for version 2023.1
1 parent 15b917c commit c16cc6f

37 files changed

+234
-245
lines changed

AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
2020
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
2121
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0" />
22-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />
22+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.14" />
2323
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
2424
</ItemGroup>
2525
<ItemGroup>

AspNetCore.Reporting.Angular/ClientApp/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"@angular/platform-browser-dynamic": "^14.0.3",
2121
"@angular/platform-server": "^14.0.3",
2222
"@angular/router": "^14.0.3",
23-
"devextreme": "22.2-stable",
24-
"@devexpress/analytics-core": "22.2-stable",
25-
"devexpress-reporting-angular": "22.2-stable",
26-
"devexpress-richedit": "22.2-stable",
23+
"devextreme": "23.1-stable",
24+
"@devexpress/analytics-core": "23.1-stable",
25+
"devexpress-reporting-angular": "23.1-stable",
26+
"devexpress-richedit": "23.1-stable",
2727
"bootstrap": "^5.1.3",
2828
"jquery": "^3.6.0",
2929
"oidc-client": "^1.11.5",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<dx-report-designer [reportUrl]="reportUrl" height="800px">
2-
<dxrd-callbacks (PreviewOnExport)="previewOnExport($event)">
2+
<dxrd-callbacks>
33
</dxrd-callbacks>
44
<dxrd-request-options [getDesignerModelAction]="getDesignerModelAction" [host]="hostUrl"></dxrd-request-options>
55
</dx-report-designer>

AspNetCore.Reporting.Angular/ClientApp/src/app/reportdesigner/report-designer.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ajaxSetup } from "@devexpress/analytics-core/analytics-utils"
1+
import { fetchSetup } from "@devexpress/analytics-core/analytics-utils"
22
import { Component, Inject, ViewEncapsulation, OnInit } from '@angular/core';
33
import { AuthorizeService } from '../../api-authorization/authorize.service';
44
import * as ko from 'knockout';
@@ -9,10 +9,9 @@ import { ActivatedRoute } from '@angular/router';
99
encapsulation: ViewEncapsulation.None,
1010
templateUrl: './report-designer.html',
1111
styleUrls: [
12-
"../../../node_modules/devextreme/dist/css/dx.common.css",
13-
"../../../node_modules/devextreme/dist/css/dx.light.css",
12+
"../../../node_modules/devextreme/dist/css/dx.material.blue.light.css",
1413
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css",
15-
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.light.css",
14+
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.material.blue.light.css",
1615
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-querybuilder.css",
1716
"../../../node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css",
1817
"../../../node_modules/devexpress-reporting/dist/css/dx-reportdesigner.css"
@@ -28,24 +27,18 @@ export class ReportDesignerComponent implements OnInit {
2827
this.koReportUrl(newUrl);
2928
}
3029
koReportUrl = ko.observable('');
31-
exportAccessToken: string | null = null;
3230

3331
constructor(@Inject('BASE_URL') public hostUrl: string, private authorize: AuthorizeService, private activateRoute: ActivatedRoute) {
3432
this.authorize.getAccessToken()
3533
.subscribe(x => {
36-
ajaxSetup.ajaxSettings = {
34+
fetchSetup.fetchSettings = {
3735
headers: {
3836
'Authorization': 'Bearer ' + x
3937
}
4038
};
41-
this.exportAccessToken = x;
4239
});
4340
}
4441

45-
previewOnExport(event: any) {
46-
event.args.FormData["access_token"] = this.exportAccessToken;
47-
}
48-
4942
ngOnInit() {
5043
if(this.activateRoute.snapshot.queryParams['reportId']) {
5144
this.reportUrl = this.activateRoute.snapshot.queryParams['reportId'];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<dx-report-viewer [reportUrl]="reportUrl" height="800px">
2-
<dxrv-callbacks (OnExport)="viewerOnExport($event)"></dxrv-callbacks>
2+
<dxrv-callbacks></dxrv-callbacks>
33
<dxrv-request-options [invokeAction]="invokeAction" [host]="hostUrl"></dxrv-request-options>
44
<dxrv-export-settings [useSameTab]="useSameTabExport" [useAsynchronousExport]="useAsynchronousExport"></dxrv-export-settings>
55
</dx-report-viewer>

AspNetCore.Reporting.Angular/ClientApp/src/app/reportviewer/report-viewer.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
3-
import { ajaxSetup } from '@devexpress/analytics-core/analytics-utils';
3+
import { fetchSetup } from '@devexpress/analytics-core/analytics-utils';
44
import * as ko from 'knockout';
55
import { AuthorizeService } from '../../api-authorization/authorize.service';
66

@@ -9,10 +9,9 @@ import { AuthorizeService } from '../../api-authorization/authorize.service';
99
encapsulation: ViewEncapsulation.None,
1010
templateUrl: './report-viewer.html',
1111
styleUrls: [
12-
"../../../node_modules/devextreme/dist/css/dx.common.css",
13-
"../../../node_modules/devextreme/dist/css/dx.light.css",
12+
"../../../node_modules/devextreme/dist/css/dx.material.blue.light.css",
1413
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css",
15-
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.light.css",
14+
"../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.material.blue.light.css",
1615
"../../../node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css"
1716
]
1817
})
@@ -28,24 +27,18 @@ export class ReportViewerComponent implements OnInit {
2827

2928
useSameTabExport = true;
3029
useAsynchronousExport = true;
31-
exportAccesstoken: string | null = null;
3230

3331
constructor(@Inject('BASE_URL') public hostUrl: string, private authorize: AuthorizeService, private activateRoute: ActivatedRoute) {
3432
this.authorize.getAccessToken()
3533
.subscribe(x => {
36-
ajaxSetup.ajaxSettings = {
34+
fetchSetup.fetchSettings = {
3735
headers: {
3836
'Authorization': 'Bearer ' + x
3937
}
4038
};
41-
this.exportAccesstoken = x;
4239
});
4340
}
4441

45-
viewerOnExport(event: any) {
46-
event.args.FormData['access_token'] = this.exportAccesstoken;
47-
}
48-
4942
ngOnInit() {
5043
if(this.activateRoute.snapshot.queryParams['reportId']) {
5144
this.reportUrl = this.activateRoute.snapshot.queryParams['reportId'];

AspNetCore.Reporting.Angular/Services/ConfigureJwtBearerOptions.cs

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

AspNetCore.Reporting.Angular/Startup.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@
55
using AspNetCore.Reporting.Common.Services.Reporting;
66
using DevExpress.AspNetCore;
77
using DevExpress.AspNetCore.Reporting;
8-
using DevExpress.XtraReports.Web.ClientControls;
8+
using DevExpress.Utils;
99
using DevExpress.XtraReports.Web.Extensions;
1010
using Microsoft.AspNetCore.Authentication;
11-
using Microsoft.AspNetCore.Authentication.JwtBearer;
1211
using Microsoft.AspNetCore.Builder;
1312
using Microsoft.AspNetCore.Hosting;
1413
using Microsoft.AspNetCore.Identity;
1514
using Microsoft.AspNetCore.SpaServices.AngularCli;
1615
using Microsoft.EntityFrameworkCore;
1716
using Microsoft.Extensions.Configuration;
1817
using Microsoft.Extensions.DependencyInjection;
19-
using Microsoft.Extensions.DependencyInjection.Extensions;
2018
using Microsoft.Extensions.Hosting;
21-
using Microsoft.Extensions.Logging;
22-
using Microsoft.Extensions.Options;
2319

24-
namespace AspNetCore.Reporting.Angular {
20+
namespace AspNetCore.Reporting.Angular
21+
{
2522
public class Startup {
2623
public Startup(IConfiguration configuration, IWebHostEnvironment webHostEnvironment) {
2724
Configuration = configuration;
@@ -52,19 +49,25 @@ public void ConfigureServices(IServiceCollection services) {
5249
services.AddAuthentication()
5350
.AddIdentityServerJwt();
5451

55-
services.TryAddEnumerable(ServiceDescriptor.Singleton<IPostConfigureOptions<JwtBearerOptions>, ConfigureJwtBearerOptions>());
5652
services.AddControllersWithViews().AddNewtonsoftJson();
5753
services.AddRazorPages();
58-
services.ConfigureReportingServices(x => x.ConfigureReportDesigner(reportDesignerConfigurator => {
59-
reportDesignerConfigurator.RegisterObjectDataSourceWizardTypeProvider<CustomObjectDataSourceWizardTypeProvider>();
60-
}));
54+
services.ConfigureReportingServices(x => {
55+
if (WebHostEnvironment.IsDevelopment()) {
56+
x.UseDevelopmentMode();
57+
}
58+
x.ConfigureReportDesigner(reportDesignerConfigurator => {
59+
reportDesignerConfigurator.RegisterObjectDataSourceWizardTypeProvider<CustomObjectDataSourceWizardTypeProvider>();
60+
});
61+
});
6162
ServiceRegistrator.AddCommonServices(services, WebHostEnvironment.ContentRootPath);
6263

6364
services.AddSingleton<IScopedDbContextProvider<SchoolDbContext>, ScopedDbContextProvider<SchoolDbContext>>();
6465
services.AddScoped<IAuthenticatiedUserService, UserService<SchoolDbContext>>();
6566
services.AddTransient<ReportStorageWebExtension, EFCoreReportStorageWebExtension<SchoolDbContext>>();
6667
services.AddTransient<CourseListReportRepository>();
68+
DeserializationSettings.RegisterTrustedClass(typeof(CourseListReportRepository));
6769
services.AddTransient<MyEnrollmentsReportRepository>();
70+
DeserializationSettings.RegisterTrustedClass(typeof(MyEnrollmentsReportRepository));
6871

6972
// In production, the Angular files will be served from this directory
7073
services.AddSpaStaticFiles(configuration => {
@@ -73,7 +76,7 @@ public void ConfigureServices(IServiceCollection services) {
7376
}
7477

7578
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
76-
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) {
79+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
7780
app.UseDevExpressControls();
7881
if(env.IsDevelopment()) {
7982
app.UseDeveloperExceptionPage();
@@ -89,8 +92,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF
8992
app.UseSpaStaticFiles();
9093
}
9194

92-
LoggerService.Initialize(new CustomReportingLoggerService(loggerFactory.CreateLogger("DXReporting")));
93-
9495
app.UseRouting();
9596

9697
app.UseAuthentication();

AspNetCore.Reporting.Angular/appsettings.Development.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"Logging": {
33
"LogLevel": {
44
"Default": "Information",
5-
"Microsoft": "Warning",
6-
"Microsoft.Hosting.Lifetime": "Information"
5+
"DevExpress": "Debug"
76
}
87
},
98
"IdentityServer": {

AspNetCore.Reporting.Angular/appsettings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"DefaultSqliteConnection": "Data Source=Database/application.db"
55
},
66
"Logging": {
7-
"LogLevel": {
8-
"Default": "Information",
7+
"LogLevel": {
8+
"Default": "Warning",
99
"Microsoft": "Warning",
1010
"Microsoft.Hosting.Lifetime": "Information"
11-
}
12-
},
11+
}
12+
},
1313
"IdentityServer": {
1414
"Clients": {
1515
"AspNetCore.Reporting.Angular": {
1616
"Profile": "IdentityServerSPA"
1717
}
1818
}
1919
},
20-
"AllowedHosts": "*"
20+
"AllowedHosts": "*"
2121
}

0 commit comments

Comments
 (0)