Browse Source

Merge branch 'dev' into issue-3813

pull/19282/head
oykuermann 3 years ago
parent
commit
ec1e5f1be7
  1. 2
      Directory.Packages.props
  2. 7
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  3. 97
      docs/en/UI/Angular/Chart-Component.md
  4. 16
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
  5. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs
  6. 2
      framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor
  7. 12
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Values/ValueObject.cs
  8. 63
      framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Values/AddressWithZipCode.cs
  9. 16
      framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Values/ValueObject_Tests.cs
  10. 2
      latest-versions.json
  11. 4
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json
  12. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs
  13. 2
      npm/ng-packs/package.json
  14. 1
      npm/ng-packs/packages/components/chart.js/src/chart.component.ts
  15. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorClientModule.cs
  16. 6
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host.Client/MyProjectNameBlazorHostClientModule.cs

2
Directory.Packages.props

@ -122,7 +122,7 @@
<PackageVersion Include="Oracle.EntityFrameworkCore" Version="8.21.121" />
<PackageVersion Include="Polly" Version="8.2.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<PackageVersion Include="Quartz" Version="3.7.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.7.0" />
<PackageVersion Include="Quartz.Plugins.TimeZoneConverter" Version="3.7.0" />

7
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json

@ -283,6 +283,7 @@
"ChooseCoverImage": "Choose a cover image...",
"Menu:Quotation": "Quotation",
"Menu:Invoice": "Invoice",
"Menu:Quotation/Invoice": "Quotation/Invoice",
"Menu:PaymentRequests": "Payment Requests",
"Permission:PaymentRequests": "Payment Requests",
"PaymentRequests": "Payment Requests",
@ -600,6 +601,10 @@
"NoChangesDetected": "No changes detected",
"ProductCount": "Product Count",
"Actions": "Actions",
"CreateInvoice": "Create Invoice"
"CreateInvoice": "Create Invoice",
"AllowedLicenses": "Allowed Licenses",
"AllowedModules": "Allowed Modules",
"ModuleName": "Module name",
"NonYet": "Non yet"
}
}

97
docs/en/UI/Angular/Chart-Component.md

@ -11,8 +11,8 @@ First of all, need to import the `ChartModule` to your feature module as follows
```ts
// your-feature.module.ts
import { ChartModule } from '@abp/ng.components/chart.js';
import { ChartDemoComponent } from './chart-demo.component';
import { ChartModule } from "@abp/ng.components/chart.js";
import { ChartDemoComponent } from "./chart-demo.component";
@NgModule({
imports: [
@ -30,20 +30,20 @@ Then, `abp-chart` component can be used. See an example:
```ts
// chart-demo.component.ts
import { Component } from '@angular/core';
import { Component } from "@angular/core";
@Component({
selector: 'app-chart-demo',
selector: "app-chart-demo",
template: ` <abp-chart type="pie" [data]="data"></abp-chart> `,
})
export class ChartDemoComponent {
data = {
labels: ['Data 1', 'Data 2', 'Data 3'],
labels: ["Data 1", "Data 2", "Data 3"],
datasets: [
{
label: 'Dataset 1',
label: "Dataset 1",
data: [40, 15, 45],
backgroundColor: ['#ff7675', '#fdcb6e', '#0984e3'],
backgroundColor: ["#ff7675", "#fdcb6e", "#0984e3"],
},
],
};
@ -61,10 +61,10 @@ See the result:
### Doughnut
```ts
import { Component } from '@angular/core';
import { Component } from "@angular/core";
@Component({
selector: 'app-chart-demo',
selector: "app-chart-demo",
template: `
<abp-chart
type="doughnut"
@ -72,17 +72,18 @@ import { Component } from '@angular/core';
[options]="options"
width="400px"
height="400px"
[plugins]="myPlugin"
></abp-chart>
`,
})
export class ChartDemoComponent {
data = {
labels: ['Data 1', 'Data 2', 'Data 3'],
labels: ["Data 1", "Data 2", "Data 3"],
datasets: [
{
label: 'Dataset 1',
label: "Dataset 1",
data: [40, 15, 45],
backgroundColor: ['#a0e6c3', '#f0ea4c', '#5b9dc3'],
backgroundColor: ["#a0e6c3", "#f0ea4c", "#5b9dc3"],
},
],
};
@ -91,14 +92,22 @@ export class ChartDemoComponent {
plugins: {
title: {
display: true,
text: 'Doughnut Chart',
text: "Doughnut Chart",
fontSize: 16,
},
legend: {
position: 'bottom',
position: "bottom",
},
},
};
myPlugin = [
{
afterRender: (chart, args, options) => {
console.log("chart has been rendered");
},
},
];
}
```
@ -109,10 +118,10 @@ Result:
### Bar
```ts
import { Component } from '@angular/core';
import { Component } from "@angular/core";
@Component({
selector: 'app-chart-demo',
selector: "app-chart-demo",
template: `
<abp-chart
type="bar"
@ -124,16 +133,16 @@ import { Component } from '@angular/core';
})
export class ChartDemoComponent {
data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: 'First dataset',
backgroundColor: '#42A5F5',
label: "First dataset",
backgroundColor: "#42A5F5",
data: [65, 59, 80, 81, 56, 55, 40],
},
{
label: 'Second dataset',
backgroundColor: '#FFA726',
label: "Second dataset",
backgroundColor: "#FFA726",
data: [28, 48, 40, 19, 86, 27, 90],
},
],
@ -148,10 +157,10 @@ Result:
### Radar
```ts
import { Component } from '@angular/core';
import { Component } from "@angular/core";
@Component({
selector: 'app-chart-demo',
selector: "app-chart-demo",
template: `
<abp-chart
type="radar"
@ -168,30 +177,30 @@ import { Component } from '@angular/core';
export class ChartDemoComponent {
data = {
labels: [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
datasets: [
{
label: 'Dataset 1',
backgroundColor: 'rgba(179,181,198,0.2)',
borderColor: 'rgba(179,181,198,1)',
label: "Dataset 1",
backgroundColor: "rgba(179,181,198,0.2)",
borderColor: "rgba(179,181,198,1)",
data: [65, 59, 90, 81, 56, 55, 40, 35, 82, 51, 62, 95],
},
{
label: 'Dataset 2',
backgroundColor: 'rgba(255,99,132,0.2)',
borderColor: 'rgba(255,99,132,1)',
label: "Dataset 2",
backgroundColor: "rgba(255,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
data: [28, 48, 40, 58, 96, 27, 100, 44, 85, 77, 71, 39],
},
],
@ -203,9 +212,9 @@ export class ChartDemoComponent {
datasets: [
...this.data.datasets,
{
label: 'Dataset 3',
backgroundColor: 'rgba(54,162,235,0.2)',
borderColor: 'rgba(54, 162, 235, 1)',
label: "Dataset 3",
backgroundColor: "rgba(54,162,235,0.2)",
borderColor: "rgba(54, 162, 235, 1)",
data: [90, 95, 98, 91, 99, 96, 89, 95, 98, 93, 92, 90],
},
],

16
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs

@ -57,6 +57,12 @@ public partial class PageHeader : ComponentBase
if (Toolbar != null)
{
var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar);
if (!ShouldRenderToolbarItems(toolbarItems))
{
return;
}
ToolbarItemRenders.Clear();
if (!Options.Value.RenderToolbar)
@ -88,6 +94,16 @@ public partial class PageHeader : ComponentBase
}
}
}
protected virtual bool ShouldRenderToolbarItems(PageToolbarItem[] items)
{
if (items.Length != PageLayout.ToolbarItems.Count)
{
return true;
}
return items.Where((t, i) => t.ComponentType != PageLayout.ToolbarItems[i].ComponentType).Any();
}
protected async override Task OnInitializedAsync()
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs

@ -98,7 +98,7 @@ public abstract class AbpTagHelperResourceService : ITransientDependency
protected virtual void AddErrorScript(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, BundleFile file, string bundleName)
{
output.Content.AppendHtml($"<script>console.log(\"%cCould not find the bundle file '{file.FileName}' for the bundle '{bundleName}'!\", 'background: yellow; font-size:20px;');</script>{Environment.NewLine}");
output.Content.AppendHtml($"<script>console.log(\"%cCould not find the bundle file '{file.FileName}' for the bundle '{bundleName}'!\", 'background: yellow; color: black; font-size:20px;');</script>{Environment.NewLine}");
}
protected virtual string GenerateBundleName(List<BundleTagHelperItem> bundleItems)

2
framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor

@ -23,7 +23,7 @@
<EmptyTemplate>
<Row Class="w-100 align-items-center" Style="height: 150px;">
<Column>
<Heading Size="HeadingSize.Is4" Alignment="TextAlignment.Center">No data available</Heading>
<Heading Size="HeadingSize.Is4" TextAlignment="TextAlignment.Center">No data available</Heading>
</Column>
</Row>
</EmptyTemplate>

12
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Values/ValueObject.cs

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.Domain.Values;
@ -30,7 +31,14 @@ public abstract class ValueObject
return false;
}
if (thisValues.Current != null && !thisValues.Current.Equals(otherValues.Current))
if (thisValues.Current is ValueObject currentValueObject && otherValues.Current is ValueObject otherValueObject)
{
if (!currentValueObject.ValueEquals(otherValueObject))
{
return false;
}
}
else if (thisValues.Current != null && !thisValues.Current.Equals(otherValues.Current))
{
return false;
}

63
framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Values/AddressWithZipCode.cs

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
namespace Volo.Abp.Domain.Values;
public class AddressWithZipCode : ValueObject
{
public Guid CityId { get; }
public string Street { get; }
public int Number { get; }
public ZipCode ZipCode { get; }
public string[] Tags { get; }
private AddressWithZipCode()
{
}
public AddressWithZipCode(
Guid cityId,
string street,
int number,
ZipCode zipCode,
params string[] tags)
{
CityId = cityId;
Street = street;
Number = number;
ZipCode = zipCode;
Tags = tags;
}
//Requires to implement this method to return properties.
protected override IEnumerable<object> GetAtomicValues()
{
yield return Street;
yield return CityId;
yield return Number;
yield return ZipCode;
foreach (var tag in Tags)
{
yield return tag;
}
}
}
public class ZipCode : ValueObject
{
public string Code { get; }
public ZipCode(string code)
{
Code = code;
}
protected override IEnumerable<object> GetAtomicValues()
{
yield return Code;
}
}

16
framework/test/Volo.Abp.Ddd.Tests/Volo/Abp/Domain/Values/ValueObject_Tests.cs

@ -37,4 +37,20 @@ public class ValueObject_Tests
emailAddress1.ValueEquals(emailAddress2).ShouldBeFalse();
}
[Fact]
public void ValueObjects_Recursively_ValueEquals()
{
var cityId = Guid.NewGuid();
var address1 = new AddressWithZipCode(cityId, "Baris Manco", 42, new ZipCode("0000001"), "home", "office");
var address2 = new AddressWithZipCode(cityId, "Baris Manco", 42, new ZipCode("0000001"), "home", "office");
address1.ValueEquals(address2).ShouldBeTrue();
address1 = new AddressWithZipCode(cityId, "Baris Manco", 42, new ZipCode("0000001"), "home", "office");
address2 = new AddressWithZipCode(cityId, "Baris Manco", 42, new ZipCode("0000002"), "home", "office");
address1.ValueEquals(address2).ShouldBeFalse();
}
}

2
latest-versions.json

@ -1,6 +1,6 @@
[
{
"version": "8.0.4",
"version": "8.0.5",
"releaseDate": "",
"type": "stable",
"message": ""

4
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json

@ -91,6 +91,8 @@
"DisplayName:IsExpiredDeleterEnabled": "Enable clean up service",
"Description:IsExpiredDeleterEnabled": "If this option is enable expired items deleted automatically.",
"DisplayName:ExpiredDeleterPeriod": "Expired item deletion period",
"Description:ExpiredDeleterPeriod": "Set the number of days after which expired items will be automatically deleted."
"Description:ExpiredDeleterPeriod": "Set the number of days after which expired items will be automatically deleted.",
"ExpiredDeleterPeriodUnit": "day(s)",
"AuditLogsBeforeXWillBeDeleted": "Audit logs before {0} will be deleted."
}
}

2
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs

@ -114,7 +114,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor
l["Cms"],
icon: "far fa-newspaper");
context.Menu.AddItem(cmsMenu);
context.Menu.GetAdministration().AddItem(cmsMenu);
}
foreach (var menu in cmsMenus)

2
npm/ng-packs/package.json

@ -93,7 +93,7 @@
"autoprefixer": "^10.0.0",
"bootstrap": "^5.0.0",
"bootstrap-icons": "^1.0.0",
"chart.js": "^3.0.0",
"chart.js": "^4.0.0",
"cypress": "^7.0.0",
"dotenv": "10.0.0",
"eslint": "8.48.0",

1
npm/ng-packs/packages/components/chart.js/src/chart.component.ts

@ -101,6 +101,7 @@ export class ChartComponent implements AfterViewInit, OnDestroy, OnChanges {
type: this.type as any,
data: this.data,
options: this.options,
plugins: this.plugins
});
};

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorClientModule.cs

@ -81,12 +81,6 @@ public class MyProjectNameBlazorClientModule : AbpModule
});
}
private static void ConfigureUI(WebAssemblyHostBuilder builder)
{
builder.RootComponents.Add<App>("#ApplicationContainer");
builder.RootComponents.Add<HeadOutlet>("head::after");
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)
{
context.Services.AddTransient(sp => new HttpClient

6
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host.Client/MyProjectNameBlazorHostClientModule.cs

@ -76,12 +76,6 @@ public class MyProjectNameBlazorHostClientModule : AbpModule
});
}
private static void ConfigureUI(WebAssemblyHostBuilder builder)
{
builder.RootComponents.Add<App>("#ApplicationContainer");
builder.RootComponents.Add<HeadOutlet>("head::after");
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)
{
context.Services.AddTransient(sp => new HttpClient

Loading…
Cancel
Save