diff --git a/README.md b/README.md index dbf8bce537..ebba20da41 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,10 @@ ABP is a community-driven open source project. See [the contribution guide](http Love ABP Framework? **Please give a star** to this repository :star: +## Discord Channel + +You can use this link to join the ABP Community Discord Server: https://discord.gg/abp + ## ABP Commercial See also [ABP Commercial](https://commercial.abp.io/) if you are looking for pre-built application modules, professional themes, code generation tooling and premium support for the ABP Framework. diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index d1890e1786..1dc0d7c1f7 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -337,18 +337,6 @@ "Expired": "Expired", "TrialLicenseDeletionWarningMessage": "Are you sure you want to delete the trial license? Trial license, organization, support accounts will be deleted!", "LicenseCategoryFilter": "License category", - "Volo.AbpIo.Commercial:030000": "You already used your trial period.", - "Volo.AbpIo.Commercial:030001": "This organization name already exists.", - "Volo.AbpIo.Commercial:030002": "Once activated, trial license cannot be set to requested!", - "Volo.AbpIo.Commercial:030003": "There is no such status!", - "Volo.AbpIo.Commercial:030004": "Status could not be changed due to an unexpected error!", - "Volo.AbpIo.Commercial:030005": "Start and end date can be updated when the trial license is in the -activated- status!", - "Volo.AbpIo.Commercial:030006": "End date must always be greater than start date!", - "Volo.AbpIo.Commercial:030007": "This trial license has already been activated once!", - "Volo.AbpIo.Commercial:030008": "Purchase date can be set only when status is Purchased!", - "Volo.AbpIo.Commercial:030009": "User not found!", - "Volo.AbpIo.Commercial:030010": "To purchase the trial license, first you need to activate your trial license!", - "Volo.AbpIo.Commercial:030011": "You cannot delete a trial license when it is purchased!", "Permission:SendWelcomeEmail": "Send Welcome Email", "SendWelcomeEmail": "Send Welcome Email", "SendWelcomeEmailWarningMessage": "Are you sure you want to send welcome email to the organization members?", @@ -385,12 +373,26 @@ "Menu:Speakers": "Speakers", "ChooseSpeakerImage": "Choose a speaker image...", "SpeakerImage": "Speaker image", + "AddSpeaker": "Add Speaker", "ShowPurchaseItemsOfOrganizations": "Purchase Items", "Enum:OrganizationPurchaseState:0": "Not delivered", "Enum:OrganizationPurchaseState:1": "Delivered", "PurchaseItems": "Purchase Items", "SuccessfullyUpdated": "Successfully updated", "SuccessfullyAdded": "Successfully added", - "PurchaseState": "Purchase State" + "PurchaseState": "Purchase State", + "ShowBetweenDayCount": "Show Between Days", + "PurchaseOrder": "Purchase Order", + "ShowCreateInvoiceOfOrganization": "Create Invoice", + "ShowCreateQuotationOfOrganization": "Create Quotation", + "BookDiscounts": "Book Discounts", + "Permission:BookDiscount": "Book Discount", + "Menu:BookDiscounts": "Book Discounts", + "BookType": "Book Type", + "PurchasePlatform": "Purchase Platform", + "StartTime": "Start Time", + "EndTime": "End Time", + "CreateABookDiscount": "Create a book discount", + "BookDiscountDeletionConfirmationMessage": "Are you sure you want to delete this book discount?" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json index fe9085e427..e898619b64 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json @@ -14,6 +14,18 @@ "Volo.AbpIo.Domain:020002": "Could not delete this NPM Package because \"{Modules}\" Modules are using this package.", "Volo.AbpIo.Domain:020003": "Could not delete this NPM Package because \"{Modules}\" Modules are using this package and \"{NugetPackages}\" Nuget Packages are dependent to this package.", "Volo.AbpIo.Domain:020004": "Could not delete this Nuget Package because \"{Modules}\" Modules are using this package.", + "Volo.AbpIo.Domain:030000": "You have already completed your trial period.", + "Volo.AbpIo.Domain:030001": "This organization name already exists.", + "Volo.AbpIo.Domain:030002": "Once activated, you cannot switch the trial license to -requested- status!", + "Volo.AbpIo.Domain:030003": "There is no such status!", + "Volo.AbpIo.Domain:030004": "Status could not be changed due to an unexpected error!", + "Volo.AbpIo.Domain:030005": "Start and end date can be updated when the trial license is in the -activated- status!", + "Volo.AbpIo.Domain:030006": "The end date must be greater than the start date!", + "Volo.AbpIo.Domain:030007": "This trial license has already been activated!", + "Volo.AbpIo.Domain:030008": "The purchase date can be set only when the status is -purchased-!", + "Volo.AbpIo.Domain:030009": "User not found!", + "Volo.AbpIo.Domain:030010": "To purchase the trial license, you first need to activate your trial license!", + "Volo.AbpIo.Domain:030011": "You cannot delete a trial license when it is purchased!", "WantToLearn?": "Want to learn?", "ReadyToGetStarted?": "Ready to get started?", "JoinOurCommunity": "Join our community", @@ -72,7 +84,7 @@ "WouldLikeToReceiveMarketingMaterials": "I would like to receive marketing materials like product deals & special offers.", "JoinOurMarketingNewsletter": "Join our marketing newsletter", "CommunityPrivacyPolicyConfirmation": "I agree to the Terms & Conditions and Privacy Policy.", - "ABPIO-Common": "ABPIO-Common", + "WouldLikeToReceiveNotification": "I would like to receive the latest news from abp.io websites.", "CommercialNewsletterConfirmationMessage": "I agree to the Terms & Conditions and Privacy Policy.", "FreeDDDEBook": "Free DDD E-Book", "AdditionalServices": "Additional Services", @@ -104,7 +116,15 @@ "WatchTheEvent": "Watch the Event", "RegisterNow": "Register Now", "ThereIsNoEvent": "There is no event.", + "Events": "Events", "Volo.AbpIo.Domain:080000": "There is already a purchase item named \"{Name}\"", - "MasteringAbpFrameworkBook": "Book: Mastering ABP Framework" + "MasteringAbpFrameworkBook": "Book: Mastering ABP Framework", + "ABPIO-CommonPreferenceDefinition": "Get the latest news about ABP Platform like new posts, events and more.", + "BuiltOn": "Built-on", + "AbpFramework": "ABP Framework", + "Volo.AbpIo.Domain:080001": "Start Time can not be greater than End Time", + "Enum:BookType:0": "Mastering ABP Framework", + "Enum:PurchasePlatform:0": "Amazon", + "Enum:PurchasePlatform:1": "Packt" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 8fa96b5ee2..a977671501 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -49,7 +49,7 @@ "IndexPageHeroSection": "A complete web development platformbuilt-on framework", "AbpCommercialShortDescription": "ABP Commercial provides pre-built application modules, rapid application development tooling, professional UI themes, premium support and more.", "LiveDemo": "Live Demo", - "GetLicence": "Get a Licence", + "GetLicence": "Get a License", "Application": "Application", "StartupTemplates": "Startup Templates", "Startup": "Startup", @@ -204,7 +204,7 @@ "TrialPlan": "Do you have a trial plan?", "TrialPlanExplanation": "For now, ABP Commercial doesn't have a trial plan. For the Team licenses we provide 30 days money back guarantee. You can just request a refund in the first 30 days. For the Business and Enterprise licenses, we provide 60% refund in 30 days. This is because Business and Enterprise licenses include the full source code of all the modules and the themes.", "DoYouAcceptBankWireTransfer": "Do you accept bank wire transfers?", - "DoYouAcceptBankWireTransferExplanation": "Yes, we accept bank wire transfers.
After sending the license fee via bank transfer, email us your receipt and the type of license requested at accounting@abp.io, here's our international bank account information:", + "DoYouAcceptBankWireTransferExplanation": "Yes, we accept bank wire transfers.
After sending the license fee via bank transfer, send your receipt and requested license type to accounting@abp.io.
Our international bank account information:", "HowToUpgrade": "How to upgrade existing applications when a new version is available?", "HowToUpgradeExplanation1": "When you create a new application using ABP Commercial, all the modules and theme are used as NuGet and NPM packages. So, you can easily upgrade the packages when a new version is available.", "HowToUpgradeExplanation2": "In addition to the standard NuGet/NPM upgrades, ABP CLI provides an update command that automatically finds and upgrades all ABP related packages in your solution.", @@ -271,7 +271,7 @@ "Enterprise": "Enterprise", "Custom": "Custom", "IncludedDeveloperLicenses": "Included developer licenses", - "CustomLicenceOrAdditionalServices": "Need custom licence or additional services?", + "CustomLicenceOrAdditionalServices": "Need custom license or additional services?", "CustomOrVolumeLicense": "Custom or volume license", "LiveTrainingSupport": "Live training & support", "AndMore": "and more", @@ -495,7 +495,9 @@ "LicenseTypeNotCorrect": "The license type is not correct!", "Trainings": "Trainings", "ChoseTrainingPlaceholder": "Chose the training...", - "ContactUsToGetQuote": "Contact us to get a quote", + "DoYouNeedTrainings": "Do you need one of these trainings?", + "DoYouNeedTraining": "Do you need {0} training?", + "GetInTouchUs": "Get in touch with us", "ForMoreInformationClickHere": "For more information, click here.", "IsGetOnboardingTraining": "Would you like to get onboarding & web application development training?", "OnboardingWebApplicationDevelopmentTrainingMessage": "To schedule your training calendar, please contact {0} after creating the organization", @@ -503,6 +505,7 @@ "AdditionalNote": "Additional Note", "OnboardingTrainingFaqTitle": "Do you have ABP onboarding training?", "OnboardingTrainingFaqExplanation": "Yes, we have ABP Training Services to help you get your ABP project started fast. You will learn about ABP from an ABP core team member and you will get the skills to begin your ABP project. In the onboarding training, we will explain how to set up your development environment, install the required tools, create a fully functional CRUD page. The training will be live and the Zoom application will be used, and we are open to using other online meeting platforms. The language of the training will be English. You can also ask your questions about ABP during the sessions. A convenient time and date will be planned for both parties. To get more information, contact us at info@abp.io.", - "AddBasket": "Add to Basket" + "AddBasket": "Add to Basket", + "SendTrainingRequest": "Send Training Request" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index 60215b5fec..35b755e8c3 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -183,7 +183,7 @@ "InstallABPCLIInfo": "ABP CLI is the fastest way to start a new solution with the ABP framework. Install the ABP CLI using a command line window:", "DifferentLevelOfNamespaces": "You can use different levels of namespaces; e.g. BookStore, Acme.BookStore or Acme.Retail.BookStore.", "ABPCLIExamplesInfo": "The new command creates a layered MVC application with Entity Framework Core as the database provider. However, it has additional options.", - "SeeCliDocumentForMoreInformation": "Check out the ABP CLI document for more options or select the \"Direct Download\" tab above.", + "SeeCliDocumentForMoreInformation": "Check out the ABP CLI document for more options or select the \"Direct Download\" tab above.", "Optional": "Optional", "LocalFrameworkRef": "Keep the local project reference for the framework packages.", "BlobStoring": "BLOB Storing", @@ -214,7 +214,11 @@ "SeeDocs": "See Docs", "None": "None", "Application": "Application", + "ApplicationExplanation": "Creates a fully layered solution based on Domain Driven Design practices. Recommended for long-term projects that need a maintainable and extensible codebase.", + "ApplicationNoLayer": "Application (single layer)", + "ApplicationNoLayerExplanation": "Creates a single-layer web application. Recommended for building an application with a simpler and easy to understand architecture.", "Module": "Module", + "ModuleExplanation": "Creates a reusable, fully layered application module solution. You can use this option to create modules for your modular application.", "PackageName": "Package Name", "LicenseURL": "License URL", "License": "License", @@ -318,6 +322,7 @@ "InstallingTheABPCLI": "Installing the ABP CLI", "CreateYourProjectNow": "Create Your Project Now", "OrderOn": "Order on {0}", - "DownloadFreeDDDBook": "Download Free DDD Book" + "DownloadFreeDDDBook": "Download Free DDD Book", + "WhatIsABPFramework": "What is the ABP Framework?" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json index f9c6d54204..ad8393fab3 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json @@ -214,7 +214,11 @@ "SeeDocs": "Dökümanı Görüntüle", "None": "Hiç", "Application": "Uygulama", + "ApplicationExplanation": "Domain Driven Design pratikleri üzerine oluşturulmuş çok katmanlı bir çözüm oluşturur. Bakıma ve geliştirmeye açık kod tabanına ihtiyaç duyan uzun süreli projeler için önerilir.", + "ApplicationNoLayer": "Uygulama (tek katmanlı)", + "ApplicationNoLayerExplanation": "Tek katmanlı Web uygulaması oluşturur. Daha basit ve anlaması kolay mimari ile uygulama geliştirmek için önerilir.", "Module": "Modül", + "ModuleExplanation": "Tamamen katmanlanmış, tekrar kullanılabilir bir uygulama modülü oluşturur. Uygulamanıza modül yaratmak için bu seçeneği kullanabilirsiniz.", "PackageName": "Paket adı", "LicenseURL": "Lisans Linki", "License": "Lisans", diff --git a/common.props b/common.props index 176e761975..facc92f0bc 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 5.2.1 + 5.3.0 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/ diff --git a/docs/en/Background-Workers-Hangfire.md b/docs/en/Background-Workers-Hangfire.md index 7f832f2c71..4cbaf8cc24 100644 --- a/docs/en/Background-Workers-Hangfire.md +++ b/docs/en/Background-Workers-Hangfire.md @@ -126,4 +126,4 @@ context.ServiceProvider So, it resolves the given background worker and adds to the `IBackgroundWorkerManager`. -While we generally add workers in OnApplicationInitialization, there are no restrictions on that. You can inject IBackgroundWorkerManager anywhere and add workers at runtime. Background worker manager will stop and release all the registered workers when your application is being shut down. \ No newline at end of file +While we generally add workers in OnApplicationInitialization, there are no restrictions on that. You can inject IBackgroundWorkerManager anywhere and add workers at runtime. Background worker manager will stop and release all the registered workers when your application is being shut down. diff --git a/docs/en/Blog-Posts/2022-04-05 v5_2_Release_Stable/POST.md b/docs/en/Blog-Posts/2022-04-05 v5_2_Release_Stable/POST.md new file mode 100644 index 0000000000..ed83f36e19 --- /dev/null +++ b/docs/en/Blog-Posts/2022-04-05 v5_2_Release_Stable/POST.md @@ -0,0 +1,51 @@ +# ABP.IO Platform 5.2 Final Has Been Released! + +[ABP Framework](https://abp.io/) and [ABP Commercial](https://commercial.abp.io/) 5.2 versions have been released today. + +## What's New With 5.2? + +Since all the new features are already explained in details with the [5.2 RC Announcement Post](https://blog.abp.io/abp/ABP.IO-Platform-5-2-RC-Has-Been-Published), I will not repeat all the details again. See the [RC Blog Post](https://blog.abp.io/abp/ABP.IO-Platform-5-2-RC-Has-Been-Published) for all the features and enhancements. + +## Creating New Solutions + +You can create a new solution with the ABP Framework version 5.2 by either using the `abp new` command or using the **direct download** tab on the [get started page](https://abp.io/get-started). + +> See the [getting started document](https://docs.abp.io/en/abp/latest/Getting-Started) for more. + +## How to Upgrade an Existing Solution + +### Install/Update the ABP CLI + +First of all, install the ABP CLI or upgrade to the latest version. + +If you haven't installed yet: + +```bash +dotnet tool install -g Volo.Abp.Cli +``` + +To update an existing installation: + +```bash +dotnet tool update -g Volo.Abp.Cli +``` + +### ABP UPDATE Command + +[ABP CLI](https://docs.abp.io/en/abp/latest/CLI) provides a handy command to update all the ABP related NuGet and NPM packages in your solution with a single command: + +```bash +abp update +``` + +Run this command in the root folder of your solution. + +## Migration Guide + +Check [the migration guide](https://docs.abp.io/en/abp/5.2/Migration-Guides/Abp-5_2) for the applications with the version 5.x upgrading to the version 5.2. + +## About the Next Version + +The next feature version will be 5.3. It is planned to release the 5.3 RC (Release Candidate) on May 03 and the final version on May 31, 2022. You can follow the [release planning here](https://github.com/abpframework/abp/milestones). + +Please [submit an issue](https://github.com/abpframework/abp/issues/new) if you have any problem with this version. diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 491ebee401..8931220705 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -18,13 +18,13 @@ dotnet tool update -g Volo.Abp.Cli ## Global Options -While each command may have a set of options, there are some global options those can be used with any command; +While each command may have a set of options, there are some global options that can be used with any command; * `--skip-cli-version-check`: Skips to check the latest version of the ABP CLI. If you don't specify, it will check the latest version and shows a warning message if there is a newer version of the ABP CLI. ## Commands -Here, the list of all available commands before explaining their details: +Here, is the list of all available commands before explaining their details: * **`help`**: Shows help on the usage of the ABP CLI. * **`new`**: Generates a new solution based on the ABP [startup templates](Startup-Templates/Index.md). @@ -115,6 +115,7 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: * `ef`: Entity Framework Core. * `mongodb`: MongoDB. + * `--pwa`: Specifies to Configure Angular or Blazor WebAssembly project as Progressive Web Application. * `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory. * `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version. * `--preview`: Use latest preview version. diff --git a/docs/en/Caching.md b/docs/en/Caching.md index 064323a9c3..1ea95cec87 100644 --- a/docs/en/Caching.md +++ b/docs/en/Caching.md @@ -258,7 +258,7 @@ ABP's distributed cache interfaces provide methods to perform batch methods thos Distributed cache service provides an interesting feature. Assume that you've updated the price of a book in the database, then set the new price to the cache, so you can use the cached value later. What if you have an exception after setting the cache and you **rollback the transaction** that updates the price of the book? In this case, cache value will be incorrect. -`IDistributedCache<..>` methods gets an optional parameter, named `considerOuw`, which is `false` by default. If you set it to `true`, then the changes you made for the cache are not actually applied to the real cache store, but associated with the current [unit of work](Unit-Of-Work.md). You get the value you set in the same unit of work, but the changes are applied **only if the current unit of work succeed**. +`IDistributedCache<..>` methods gets an optional parameter, named `considerUow`, which is `false` by default. If you set it to `true`, then the changes you made for the cache are not actually applied to the real cache store, but associated with the current [unit of work](Unit-Of-Work.md). You get the value you set in the same unit of work, but the changes are applied **only if the current unit of work succeed**. ### IDistributedCacheSerializer diff --git a/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/POST.md b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/POST.md new file mode 100644 index 0000000000..b16d6bd9f1 --- /dev/null +++ b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/POST.md @@ -0,0 +1,548 @@ +# Handle Concurrency with EF Core in an ABP Framework Project with ASP.NET Core MVC + +In this article, we'll create a basic application to demonstrate how "Concurrency Check/Control" can be implemented in an ABP project. + +## Creating the Solution + +For this article, we will create a simple BookStore application and add CRUD functionality to the pages. Hence we deal with the concurrency situation. + +We can create a new startup template with EF Core as a database provider and MVC for the UI Framework. + +> If you already have a project, you don't need to create a new startup template, you can directly implement the following steps to your project. So you can skip this section. + +We can create a new startup template by using the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI). + +```bash +abp new Acme.BookStore +``` + +After running the above command, our project boilerplate will be downloaded. Then we can open the solution and start the development. + +## Starting the Development + +Let's start with defining our entities. + +### Creating Entities + +Create a `Book.cs` (/Books/Book.cs) class in the `.Domain` layer: + +```csharp +public class Book : AuditedAggregateRoot +{ + public string Name { get; set; } + + public BookType Type { get; set; } + + public DateTime PublishDate { get; set; } + + public float Price { get; set; } +} +``` + +* To enable **Concurrency Check** for our entities, our entities should be implemented the `IHasConcurrencyStamp` interface, directly or indirectly. + +* [Aggregate Root](https://docs.abp.io/en/abp/5.2/Entities#aggregateroot-class) entity classes already implement the `IHasConcurrencyStamp` interface, so if we inherit our entities from one of these entity classes then we won't need to manually implement the `IHasConcurrencyStamp` interface. + +* And we've derived the `Book` entity from `AuditedAggregateRoot` here, so we don't need to implement the `IHasConcurrencyStamp` interface because `AuditedAggregateRoot` class already implemented the `IHasConcurrencyStamp` interface. + +> You can read more details from the [Concurrency Check](https://docs.abp.io/en/abp/5.2/Concurrency-Check) documentation. + +Then, create a `BookType` (/Books/BookType.cs) enum in the `.Domain.Shared` layer: + +```csharp +public enum BookType +{ + Undefined, + Adventure, + Biography, + Dystopia, + Fantastic, + Horror, + Science, + ScienceFiction, + Poetry +} +``` + +### Database Integration + +Open the `BookStoreDbContext` (/EntityFrameworkCore/BookStoreDbContext.cs) class in the `*.EntityFrameworkCore` project and add the following `DbSet` statement: + +```csharp +namespace Acme.BookStore.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class BookStoreDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + //Entities from the modules + + public DbSet Books { get; set; } //add this line +} +``` + +Then we can navigate to the `OnModelCreating` method in the same class and configure our tables/entities: + +```csharp +protected override void OnModelCreating(ModelBuilder builder) +{ + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + ... + + //* Configure your own tables/entities inside here */ + + builder.Entity(b => + { + b.ToTable(BookStoreConsts.DbTablePrefix + "Books", + BookStoreConsts.DbSchema); + b.ConfigureByConvention(); //auto configure for the base class props + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + }); +} +``` + +After the mapping configurations, we can create a new migration and apply changes to the database. + +To do this, open your command line terminal in the directory of the `EntityFrameworkCore` project and run the below command: + +```bash +dotnet ef migrations add Added_Books +``` + +After this command, a new migration will be generated and then we can run the `*.DbMigrator` project to apply the last changes to the database such as creating a new table named `Books` according to the last created migration. + +### Defining DTOs and Application Service Interfaces + +We can start to define the use cases of the application. + +Create the DTO classes (under the **Books** folder) in the `Application.Contracts` project: + +**BookDto.cs** + +```csharp +public class BookDto : AuditedEntityDto, IHasConcurrencyStamp +{ + public string Name { get; set; } + + public BookType Type { get; set; } + + public DateTime PublishDate { get; set; } + + public float Price { get; set; } + + public string ConcurrencyStamp { get; set; } +} +``` + +* The `AuditedEntityDto` class is not implemented from the `IHasConcurrencyStamp` interface, so for the **BookDto** class we need to implement the `IHasConcurrencyStamp`. + +* This is important, because we need to return books with their **ConcurrencyStamp** value. + +**CreateBookDto.cs** + +```csharp +public class CreateBookDto +{ + [Required] + [StringLength(128)] + public string Name { get; set; } + + [Required] + public BookType Type { get; set; } = BookType.Undefined; + + [Required] + [DataType(DataType.Date)] + public DateTime PublishDate { get; set; } = DateTime.Now; + + [Required] + public float Price { get; set; } +} +``` + +**UpdateBookDto.cs** + +```csharp +public class UpdateBookDto : IHasConcurrencyStamp +{ + [Required] + [StringLength(128)] + public string Name { get; set; } + + [Required] + public BookType Type { get; set; } = BookType.Undefined; + + [Required] + [DataType(DataType.Date)] + public DateTime PublishDate { get; set; } = DateTime.Now; + + [Required] + public float Price { get; set; } + + public string ConcurrencyStamp { get; set; } +} +``` + +* Here, we've implemented the `IHasConcurrencyStamp` interface for the **UpdateBookDto** class. + +* We will use this value while updating an existing book. ABP Framework will compare the current book's **ConcurrencyStamp** value with the provided one, if values are matched, this means everything is as it is supposed to be and will update the record. + +* If values are mismatched, then it means the record that we're trying to update is already updated by another user and we need to get the latest changes to be able to make changes on it. + +* Also, in that case, `AbpDbConcurrencyException` will be thrown by the ABP Framework and we can either handle this exception manually or let the ABP Framework handle it on behalf of us and show a user-friendly error message as in the image below. + +![](./optimistic-concurrency.png) + +Create a new `IBookAppService` (/Books/IBookAppService.cs) interface in the `Application.Contracts` project: + +```csharp +public interface IBookAppService : + ICrudAppService +{ +} +``` +* We've implemented the `ICrudAppService` here, because we just need to perform CRUD operations and this interface helps us define common CRUD operation methods. + +### Application Service Implementations + +Create a `BookAppService` (/Books/BookAppService.cs) class inside the `*.Application` project and implement the application service methods, as shown below: + +```csharp +public class BookAppService : + CrudAppService, + IBookAppService +{ + public BookAppService(IRepository repository) + : base(repository) + { + } + + public override async Task UpdateAsync(Guid id, UpdateBookDto input) + { + var book = await Repository.GetAsync(id); + + book.Name = input.Name; + book.Price = input.Price; + book.Type = input.Type; + book.PublishDate = input.PublishDate; + + //set Concurrency Stamp value to the entity + book.ConcurrencyStamp = input.ConcurrencyStamp; + + var updatedBook = await Repository.UpdateAsync(book); + return ObjectMapper.Map(updatedBook); + } +} +``` + +* We've used the `CrudAppService` base class. This class implements all common CRUD operations and if we want to change a method, we can simply override the method and change it to our needs. + +> Normally, you don't need to override the `UpdateAsync` method to do **Concurrency Check**. Because the `UpdateAsync` method of the `CrudAppService` class by default map input values to the entity. But I wanted to override this method to show what we need to do for **Concurrency Check**. + +* We can look closer to the `UpdateAsync` method here, because as we've mentioned earlier we need to pass the provided **ConcurrencyStamp** value to be able to do **Concurrency Check/Control** to our entity while updating. + +* At that point, if the given record is already updated by any other user, a **ConcurrencyStamp** mismatch will occur and `AbpDbConcurrencyException` will be thrown thanks to the **Concurrency Check** system of ABP, data-consistency will be provided and the current record won't be overridden. + +* And if the values are matched, the record will be updated successfully. + +After implementing the application service methods, we can do the related mapping configurations, so open the `BookStoreApplicationAutoMapperProfile.cs` and update the content as below: + +```csharp +public class BookStoreApplicationAutoMapperProfile : Profile +{ + public BookStoreApplicationAutoMapperProfile() + { + CreateMap(); + CreateMap(); + } +} +``` + +### User Interface + +So far, we've applied the all necessary steps for the **Concurrency Check** system, let's see it in action. + +Create a razor page in the `.Web` layer named `Index` (**/Pages/Books/Index.cshtml**), open this file and replace the content with the following code block: + +```html +@page +@using Acme.BookStore.Localization +@using Microsoft.Extensions.Localization +@model Acme.BookStore.Web.Pages.Books.Index + +@section scripts +{ + +} + + + + + + Books + + + + + + + + + + +``` + +* We've defined a table and "New Book" button inside a card element here, we'll fill the table with our book records in the next step by using the **Datatables** library. + +Create an `Index.js` (**/Pages/Books/Index.js**) file and add the following code block: + +```js +$(function () { + var l = abp.localization.getResource('BookStore'); + var createModal = new abp.ModalManager(abp.appPath + 'Books/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'Books/EditModal'); + + var dataTable = $('#BooksTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + serverSide: true, + paging: true, + order: [[1, "asc"]], + searching: false, + scrollX: true, + ajax: abp.libs.datatables.createAjax(acme.bookStore.books.book.getList), + columnDefs: [ + { + title: l('Actions'), + rowAction: { + items: + [ + { + text: l('Edit'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + } + ] + } + }, + { + title: l('Name'), + data: "name" + }, + { + title: l('Type'), + data: "type", + render: function (data) { + return l('Enum:BookType:' + data); + } + }, + { + title: l('PublishDate'), + data: "publishDate", + render: function (data) { + return luxon + .DateTime + .fromISO(data, { + locale: abp.localization.currentCulture.name + }).toLocaleString(); + } + }, + { + title: l('Price'), + data: "price" + }, + { + title: l('CreationTime'), + data: "creationTime", + render: function (data) { + return luxon + .DateTime + .fromISO(data, { + locale: abp.localization.currentCulture.name + }).toLocaleString(luxon.DateTime.DATETIME_SHORT); + } + } + ] + }) + ); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewBookButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); +``` + +* We've used the [Datatables](https://datatables.net/) to list our books. + +* Also defined **create** and **update** modals by using [ABP Modal Manager](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Modals#modalmanager-reference), but we didn't create them yet, so let's create the modals. + +First, create a **CreateModal** razor page and update the **CreateModal.cshtml** and **CreateModal.cshtml.cs** files as below: + +**CreateModal.cshtml** + +```html +@page +@using Acme.BookStore.Web.Pages.Books +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@model CreateModalModel +@{ + Layout = null; +} + + + + + + + + + +``` + +* We've used `abp-dynamic-form` tag-helper and passed it a `Book` model, this tag helper will simply create form contents (inputs, select boxes etc.) on behalf of us. + +* **CreateModal.cshtml.cs** + +```csharp +using System.Threading.Tasks; +using Acme.BookStore.Books; +using Microsoft.AspNetCore.Mvc; + +namespace Acme.BookStore.Web.Pages.Books; + +public class CreateModalModel : BookStorePageModel +{ + [BindProperty] + public CreateBookDto Book { get; set; } + + private readonly IBookAppService _bookAppService; + + public CreateModalModel(IBookAppService bookAppService) + { + _bookAppService = bookAppService; + } + + public void OnGet() + { + Book = new CreateBookDto(); + } + + public async Task OnPostAsync() + { + await _bookAppService.CreateAsync(Book); + return NoContent(); + } +} +``` + +* In this file, we simply define **CreateBookDto** as a bind property and we'll use this class's properties in the form. Thanks to the `abp-dynamic-form` tag-helper we don't need to define all of these form elements one by one, it will generate on behalf of us. + +We can create an **EditModal** razor page and update the **EditModal.cshtml** and **EditModal.cshtml.cs** files as below: + +**EditModal.cshtml** + +```html +@page +@using Acme.BookStore.Web.Pages.Books +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@model EditModalModel +@{ + Layout = null; +} +
+ + + + + + + + + + + + +
+``` + +* Here, we didn't use the `abp-dynamic-form` tag-helper and added all the necessary form elements to our form one by one. + +* As you may have noticed, we've set the input type as **hidden** for the **ConcurrencyStamp** input, because the end-user should not see this value. + +> Instead of doing it like that, we could create a view model class and use the `[HiddenInput]` data attribute for the **ConcurrencyStamp** property and use the `abp-dynamic-form` tag-helper. But to simplify the article I didn't want to do that, if you want you can create a view model and define the necessary data attributes for properties. + +**EditModal.cshtml.cs** + +```csharp +public class EditModalModel : BookStorePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public UpdateBookDto Book { get; set; } + + private readonly IBookAppService _bookAppService; + + public EditModalModel(IBookAppService bookAppService) + { + _bookAppService = bookAppService; + } + + public async Task OnGetAsync() + { + var bookDto = await _bookAppService.GetAsync(Id); + Book = ObjectMapper.Map(bookDto); + } + + public async Task OnPostAsync() + { + await _bookAppService.UpdateAsync(Id, Book); + return NoContent(); + } +} +``` + +Lastly, we can define the necessary mapping configurations and run the application to see the result. + +Open the `BookStoreWebAutoMapperProfile.cs` class and update the content as below: + +```csharp +public class BookStoreWebAutoMapperProfile : Profile +{ + public BookStoreWebAutoMapperProfile() + { + CreateMap(); + } +} +``` + +Then we can run the application, navigate to the **/Books** endpoint and see the result. + +![](concurrency-mismatch.gif) + +* In the image above, we can see that multiple users open the edit model to change a record and try to update the relevant record independently of each other. + +* After the first user updated the record, the second user tries to update the same record without getting the last state of the record. And therefore `AbpDbConcurrencyException` is thrown because **ConcurrencyStamp** values are different from each other. + +* The second user should close and re-open the model to get the last state of the record and then they can make changes to the current record. diff --git a/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/concurrency-mismatch.gif b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/concurrency-mismatch.gif new file mode 100644 index 0000000000..922bb5b7ca Binary files /dev/null and b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/concurrency-mismatch.gif differ diff --git a/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/optimistic-concurrency.png b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/optimistic-concurrency.png new file mode 100644 index 0000000000..85253594c8 Binary files /dev/null and b/docs/en/Community-Articles/2022-04-06-Concurrency-Check-in-ABP-Based-Applications/optimistic-concurrency.png differ diff --git a/docs/en/Community-Articles/2022-04-14-Dependency-Injection/POST.md b/docs/en/Community-Articles/2022-04-14-Dependency-Injection/POST.md index edd74c1591..092fb72dbc 100644 --- a/docs/en/Community-Articles/2022-04-14-Dependency-Injection/POST.md +++ b/docs/en/Community-Articles/2022-04-14-Dependency-Injection/POST.md @@ -18,15 +18,15 @@ public class ElasticsearchExternalLogger : IExternalLogger { public async Task LogAsync(string logText) { - //TODO... + // TODO... } } public class AzureExternalLogger : IExternalLogger { - public Task LogAsync(string logText) + public async Task LogAsync(string logText) { - throw new System.NotImplementedException(); + // TODO... } } ```` diff --git a/docs/en/Modules/Cms-Kit/Blogging.md b/docs/en/Modules/Cms-Kit/Blogging.md index 43ab85e129..12039b1669 100644 --- a/docs/en/Modules/Cms-Kit/Blogging.md +++ b/docs/en/Modules/Cms-Kit/Blogging.md @@ -33,7 +33,12 @@ Blog feature uses some of the other CMS Kit features. You can enable or disable You can select/deselect the desired features for blog posts. -![features-dialog](../../images/cmskit-module-features-dialog.png) +![features-dialog](../../images/cmskit-module-features-dialog-2.png) + +##### Quick Navigation Bar In Blog Post +If you enable "Quick navigation bar in blog posts", it will enabled scroll index as seen below. + +![scroll-index](../../images/cmskit-module-features-scroll-index.png) ### Blog Post Management diff --git a/docs/en/Themes/LeptonXLite/angular.md b/docs/en/Themes/LeptonXLite/angular.md new file mode 100644 index 0000000000..6e4cbef317 --- /dev/null +++ b/docs/en/Themes/LeptonXLite/angular.md @@ -0,0 +1,82 @@ +# LeptonX Lite Angular UI +LeptonX Lite has implementation for the ABP Framework Angular Client. It's a simplified variation of the [LeptonX Theme](https://x.leptontheme.com/). + +> If you are looking for a professional, enterprise ready theme, you can check the [LeptonX Theme](https://x.leptontheme.com/), which is a part of [ABP Commercial](https://commercial.abp.io/). + +> See the [Theming document](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Theming) to learn about themes. + +## Installation + +To add `LeptonX-lite` into your project, + +* Install `@abp/ng.theme.lepton-x` + +`yarn add @abp/ng.theme.lepton-x@preview` + +* Install `bootstrap-icons` + +`yarn add bootstrap-icons` + + +* Then, we need to edit the styles array in `angular.json` to replace the existing style with the new one. + +Add the following style + +```json +"node_modules/bootstrap-icons/font/bootstrap-icons.css", +``` + +* Finally, remove `ThemeBasicModule` from `app.module.ts`, and import the related modules in `app.module.ts` + +```js +import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x'; +import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts'; + +@NgModule({ + imports: [ + // ... + + // do not forget to remove ThemeBasicModule + // ThemeBasicModule.forRoot(), + ThemeLeptonXModule.forRoot(), + SideMenuLayoutModule.forRoot(), + ], + // ... +}) +export class AppModule {} +``` + +Note: If you employ [Resource Owner Password Flow](https://docs.abp.io/en/abp/latest/UI/Angular/Authorization#resource-owner-password-flow) for authorization, you should import the following module as well: + +```js +import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account'; + +@NgModule({ + // ... + imports: [ + // ... + AccountLayoutModule.forRoot(), + // ... + ], + // ... +}) +export class AppModule {} +``` + +To change the logos and brand color of `LeptonX`, simply add the following CSS to the `styles.scss` + +```css +:root { + --lpx-logo: url('/assets/images/logo.png'); + --lpx-logo-icon: url('/assets/images/logo-icon.png'); + --lpx-brand: #edae53; +} +``` + +- `--lpx-logo` is used to place the logo in the menu. +- `--lpx-logo-icon` is a square icon used when the menu is collapsed. +- `--lpx-brand` is a color used throughout the application, especially on active elements. + +### Server Side + +In order to migrate to LeptonX on your server side projects (Host and/or IdentityServer projects), please follow the [Server Side Migration](mvc.md) document. diff --git a/docs/en/Themes/LeptonXLite/blazor.md b/docs/en/Themes/LeptonXLite/blazor.md new file mode 100644 index 0000000000..ddea346585 --- /dev/null +++ b/docs/en/Themes/LeptonXLite/blazor.md @@ -0,0 +1,130 @@ +# LeptonX Lite Blazor UI + +````json +//[doc-params] +{ + "UI": ["Blazor", "BlazorServer"] +} +```` + +LeptonX Lite has implementation for the ABP Framework Blazor WebAssembly & Blazor Server. It's a simplified variation of the [LeptonX Theme](https://x.leptontheme.com/). + +> If you are looking for a professional, enterprise ready theme, you can check the [LeptonX Theme](https://x.leptontheme.com/), which is a part of [ABP Commercial](https://commercial.abp.io/). + +> See the [Theming document](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Theming) to learn about themes. + +## Installation + +{{if UI == "Blazor"}} +- Complete the [MVC Razor Pages Installation](mvc.md#installation) for the **HttpApi.Host** application first. _If the solution is tiered/micro-service, complete the MVC steps for all MVC applications such as **HttpApi.Host** and if identity server is separated, install to the **IdentityServer**_. + +- Add **Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme** package to your **Blazor WebAssembly** application. + ```bash + dotnet add package Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme + ``` + +- Remove the old theme from the **DependsOn** attribute in your module class and add the **AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule** type to the **DependsOn** attribute. + +```diff +[DependsOn( +- typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule), ++ typeof(AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule) +)] +``` + +- Change startup App component with the LeptonX one. + +```csharp +// Make sure the 'App' comes from 'Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite' namespace. +builder.RootComponents.Add("#ApplicationContainer"); +``` + +- Run the `abp bundle` command in your **Blazor** application folder. + +{{end}} + + +{{if UI == "BlazorServer"}} + +- Complete the [MVC Razor Pages Installation](mvc.md#installation) first. _If the solution is tiered/micro-service, complete the MVC steps for all MVC applications such as **HttpApi.Host** and **IdentityServer**_. + +- Add **Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme** package to your **Blazor server** application. + ```bash + dotnet add package Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme + ``` + +- Remove old theme from the **DependsOn** attribute in your module class and add the **AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule** type to the **DependsOn** attribute. + + ```diff + [DependsOn( + - typeof(AbpAspNetCoreComponentsServerBasicThemeModule), + + typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule) + )] + ``` + +- Update AbpBundlingOptions + ```diff + options.StyleBundles.Configure( + - BlazorBasicThemeBundles.Styles.Global, + + BlazorLeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/blazor-global-styles.css"); + //You can remove the following line if you don't use Blazor CSS isolation for components + bundle.AddFiles("/MyProjectName.Blazor.styles.css"); + }); + ``` + +- Update `_Host.cshtml` file. _(located under **Pages** folder by default.)_ + + - Add following usings to Locate **App** and **BlazorLeptonXLiteThemeBundles** classes. + ```csharp + @using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite + @using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling + ``` + - Then replace script & style bundles as following: + ```diff + - + + + ``` + + ```diff + - + + + ``` + +{{end}} + + +--- + +## Customization + +### Toolbars +LeptonX Lite includes separeted toolbars for desktop & mobile. You can manage toolbars independently. Toolbar names can be accessible in the **LeptonXLiteToolbars** class. + +- `LeptonXLiteToolbars.Main` +- `LeptonXLiteToolbars.MainMobile` + +```csharp +public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context) +{ + if (context.Toolbar.Name == LeptonXLiteToolbars.Main) + { + context.Toolbar.Items.Add(new ToolbarItem(typeof(MyDesktopComponent))); + } + + if (context.Toolbar.Name == LeptonXLiteToolbars.MainMobile) + { + context.Toolbar.Items.Add(new ToolbarItem(typeof(MyMobileComponent))); + } + + return Task.CompletedTask; +} +``` + +{{if UI == "BlazorServer"}} + +> _You can visit the [Toolbars Documentation](https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars) for better understanding._ + +{{end}} diff --git a/docs/en/Themes/LeptonXLite/mvc.md b/docs/en/Themes/LeptonXLite/mvc.md new file mode 100644 index 0000000000..b5575cba49 --- /dev/null +++ b/docs/en/Themes/LeptonXLite/mvc.md @@ -0,0 +1,67 @@ +# LeptonX Lite MVC UI +LeptonX Lite has implementation for the ABP Framework Razor Pages. It's a simplified variation of the [LeptonX Theme](https://x.leptontheme.com/). + +> If you are looking for a professional, enterprise ready theme, you can check the [LeptonX Theme](https://x.leptontheme.com/), which is a part of [ABP Commercial](https://commercial.abp.io/). + +> See the [Theming document](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Theming) to learn about themes. + +## Installation + +- Add **Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite** package to your **Web** application. + +```bash +abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite +``` + +- Make sure the old theme is removed and LeptonX is added in your Module class. + +```diff +[DependsOn( +- typeof(AbpAspNetCoreMvcUiBasicThemeModule), ++ typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule) +)] +``` + +- Update AbpBundlingOptions + +```diff +Configure(options => +{ + options.StyleBundles.Configure( +- BasicThemeBundles.Styles.Global, ++ LeptonXLiteThemeBundles.Styles.Global + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); +}); +``` + +--- + +## Customization + +### Toolbars +LeptonX Lite includes separeted toolbars for desktop & mobile. You can manage toolbars independently. Toolbar names can be accessible in the **LeptonXLiteToolbars** class. + +- `LeptonXLiteToolbars.Main` +- `LeptonXLiteToolbars.MainMobile` + +```csharp +public class MyProjectNameMainToolbarContributor : IToolbarContributor +{ + public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context) + { + if (context.Toolbar.Name == LeptonXLiteToolbars.Main) + { + context.Toolbar.Items.Add(new ToolbarItem(typeof(MyDesktopComponent))); + } + + if (context.Toolbar.Name == LeptonXLiteToolbars.MainMobile) + { + context.Toolbar.Items.Add(new ToolbarItem(typeof(MyMobileComponent))); + } + } +} +``` diff --git a/docs/en/UI/Angular/Page-Toolbar-Extensions.md b/docs/en/UI/Angular/Page-Toolbar-Extensions.md index 7e63950224..1edc9594fb 100644 --- a/docs/en/UI/Angular/Page-Toolbar-Extensions.md +++ b/docs/en/UI/Angular/Page-Toolbar-Extensions.md @@ -21,9 +21,9 @@ The following code prepares a constant named `identityToolbarActionContributors` import { eIdentityComponents, - IdentityToolbarActionContributors, - IdentityUserDto, + IdentityToolbarActionContributors } from '@abp/ng.identity'; +import { IdentityUserDto } from '@abp/ng.identity/proxy'; import { ToolbarAction, ToolbarActionList } from '@abp/ng.theme.shared/extensions'; const logUserNames = new ToolbarAction({ @@ -93,7 +93,7 @@ We need to have a component before we can pass it to the toolbar action contribu ```js // src/app/click-me-button.component.ts -import { IdentityUserDto } from '@abp/ng.identity'; +import { IdentityUserDto } from '@abp/ng.identity/proxy'; import { ActionData, EXTENSIONS_ACTION_DATA } from '@abp/ng.theme.shared/extensions'; import { Component, Inject } from '@angular/core'; @@ -127,9 +127,9 @@ The following code prepares a constant named `identityToolbarActionContributors` import { eIdentityComponents, - IdentityToolbarActionContributors, - IdentityUserDto, + IdentityToolbarActionContributors } from '@abp/ng.identity'; +import { IdentityUserDto } from '@abp/ng.identity/proxy'; import { ToolbarActionList, ToolbarComponent } from '@abp/ng.theme.shared/extensions'; import { ClickMeButtonComponent } from './click-me-button.component'; @@ -362,7 +362,7 @@ export function reorderUserContributors( ) { // drop "New User" button const newUserActionNode = actionList.dropByValue( - 'AbpIdentity::NewUser', + 'AbpIdentity::NewUser', (action, text) => action['text'] === text, ); diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index b81f0b6efd..d021824d7f 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -704,6 +704,10 @@ { "text": "The Basic Theme", "path": "UI/AspNetCore/Basic-Theme.md" + }, + { + "text": "LeptonX Lite", + "path": "Themes/LeptonXLite/mvc.md" } ] }, @@ -817,6 +821,10 @@ "text": "The Basic Theme", "path": "UI/Blazor/Basic-Theme.md" }, + { + "text": "The Basic Theme", + "path": "Themes/LeptonXLite/blazor.md" + }, { "text": "Branding", "path": "UI/Blazor/Branding.md" @@ -1071,6 +1079,10 @@ { "text": "The Basic Theme", "path": "UI/Angular/Basic-Theme.md" + }, + { + "text": "LeptonX Lite", + "path": "Themes/LeptonXLite/angular.md" } ] }, diff --git a/docs/en/images/cmskit-module-features-dialog-2.png b/docs/en/images/cmskit-module-features-dialog-2.png new file mode 100644 index 0000000000..b6dd409e0a Binary files /dev/null and b/docs/en/images/cmskit-module-features-dialog-2.png differ diff --git a/docs/en/images/cmskit-module-features-scroll-index.png b/docs/en/images/cmskit-module-features-scroll-index.png new file mode 100644 index 0000000000..0bc3dedcc5 Binary files /dev/null and b/docs/en/images/cmskit-module-features-scroll-index.png differ diff --git a/docs/zh-Hans/Caching.md b/docs/zh-Hans/Caching.md index 7e7a314dab..d8f064a24e 100644 --- a/docs/zh-Hans/Caching.md +++ b/docs/zh-Hans/Caching.md @@ -1,164 +1,180 @@ # 缓存 -ABP框架扩展了ASP.NET Core的分布式缓存系统. +ABP框架扩展了 [ASP.NET Core的分布式缓存系统](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed). -## Volo.Abp.Caching Package +## 安装 -> 默认情况下启动模板已经安装了这个包,所以大部分情况下你不需要手动安装. +> 默认情况下 [启动模板](Startup-Templates/Application.md) 已经安装了这个包. 所以大部分情况下你不需要手动安装. -Volo.Abp.Caching是缓存系统的核心包.使用包管理控制台(PMC)安装到项目: +[Volo.Abp.Caching](https://www.nuget.org/packages/Volo.Abp.Caching)是缓存系统的核心包. 可以使用 [ABP CLI](CLI.md) 的add-package命令将其安装到项目中: ``` -Install-Package Volo.Abp.Caching +abp add-package Volo.Abp.Caching ``` +你需要在包含 `csproj` 文件的文件夹中的命令行终端上运行此命令(请参阅 [其他选项](https://abp.io/package-detail/Volo.Abp.Caching) 安装). -然后将 **AbpCachingModule** 依赖添加到你的模块: +## 使用方式 -```c# -using Volo.Abp.Modularity; -using Volo.Abp.Caching; - -namespace MyCompany.MyProject -{ - [DependsOn(typeof(AbpCachingModule))] - public class MyModule : AbpModule - { - //... - } -} -``` - -## `IDistributedCache` 接口 +### `IDistributedCache` 接口 -ASP.NET Core 定义了 `IDistributedCache` 接口用于 get/set 缓存值 . 但是会有以下问题: +ASP.NET Core 定义了 `IDistributedCache` 接口用于 get/set 缓存值. 但是会有以下问题: * 它适用于 **byte 数组** 而不是 .NET 对象. 因此你需要对缓存的对象进行**序列化/反序列化**. -* 它为所有的缓存项提供了 **单个 key 池** , 因此 ; +* 它为所有的缓存项提供了 **单个 key 池** , 因此; * 你需要注意键区分 **不同类型的对象**. * 你需要注意**不同租户**(参见[多租户](Multi-Tenancy.md))的缓存项. > `IDistributedCache` 定义在 `Microsoft.Extensions.Caching.Abstractions` 包中. 这使它不仅适用于ASP.NET Core应用程序, 也可用于**任何类型的程序**. -> `IDistributedCache` 接口的默认实现是 `MemoryDistributedCache` 它使用**内存**工作. 参见 [ASP.NET Core文档](https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed) 了解如何切换到 **Redis** 或其他缓存提供程序. +> `IDistributedCache` 接口的默认实现是 `MemoryDistributedCache` 它使用**内存**工作. 参见 [ASP.NET Core文档](https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed) 了解如何切换到 **Redis** 或其他缓存提供程序. 此外, 如果要将Redis用作分布式缓存服务器, [Redis缓存](Redis-Cache.md) 文档. 有关更多信息, 参见 [ASP.NET Core 分布式缓存文档](https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed). -## `IDistributedCache` 接口 +### `IDistributedCache` 接口 ABP框架在[Volo.Abp.Caching](https://www.nuget.org/packages/Volo.Abp.Caching/)包定义了通用的泛型 `IDistributedCache` 接口. `TCacheItem` 是存储在缓存中的对象类型. -`IDistributedCache` 解决了上述中的问题; +`IDistributedCache` 接口解决了上述中的问题; * 它在内部 **序列化/反序列化** 缓存对象. 默认使用 **JSON** 序列化, 但可以替换[依赖注入](Dependency-Injection.md)系统中 `IDistributedCacheSerializer` 服务的实现来覆盖默认的处理. -* 它根据缓存中对象类型自动向缓存key添加 **缓存名称** 前缀. 默认缓存名是缓存对象类的全名(如果你的类名以`CacheItem` 结尾, 那么`CacheItem` 会被忽略,不应用到缓存名称上). 你也可以在缓存类上使用 `CacheName` 设置换缓存的名称. -* 它自动将当前的**租户id**添加到缓存键中, 以区分不同租户的缓存项 (只有在你的应用程序是[多租户](Multi-Tenancy.md)的情况下生效). 在缓存类上应用 `IgnoreMultiTenancy` attribute, 可以在所有的租户间共享缓存. -* 允许为每个应用程序定义 **全局缓存键前缀** ,不同的应用程序可以在共享的分布式缓存中拥有自己的隔离池. +* 它根据缓存中对象类型自动向缓存key添加 **缓存名称** 前缀. 默认缓存名是缓存对象类的全名(如果你的类名以`CacheItem` 结尾, 那么`CacheItem` 会被忽略,不应用到缓存名称上). 你也可以在缓存类上使用 **`CacheName` 特性** 设置缓存的名称. +* 它自动将**当前的租户id**添加到缓存键中, 以区分不同租户的缓存项 (只有在你的应用程序是[多租户](Multi-Tenancy.md)的情况下生效). 如果要在多租户应用程序中的所有租户之间共享缓存对象, 请在缓存项类上定义`IgnoreMultiTenancy`特性以禁用此选项. +* 允许为每个应用程序定义 **全局缓存键前缀** , 不同的应用程序可以在共享的分布式缓存中拥有自己的隔离池. +* 它可以在任何可能绕过缓存的情况下 **容忍错误** 的发生. 这在缓存服务器出现临时问题时非常有用. +* 它有 `GetManyAsync` 和 `SetManyAsync` 等方法, 可以显著提高**批处理**的性能. -### 使用方式 - -缓存中存储项的示例类: +**示例: 在缓存中存储图书名称和价格** ````csharp -public class BookCacheItem +namespace MyProject { - public string Name { get; set; } + public class BookCacheItem + { + public string Name { get; set; } - public float Price { get; set; } + public float Price { get; set; } + } } ```` 你可以注入 `IDistributedCache` 服务用于 get/set `BookCacheItem` 对象. -使用示例: - ````csharp -public class BookService : ITransientDependency -{ - private readonly IDistributedCache _cache; - - public BookService(IDistributedCache cache) - { - _cache = cache; - } - - public async Task GetAsync(Guid bookId) - { - return await _cache.GetOrAddAsync( - bookId.ToString(), //Cache key - async () => await GetBookFromDatabaseAsync(bookId), - () => new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddHours(1) - } - ); - } +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Distributed; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; - private Task GetBookFromDatabaseAsync(Guid bookId) +namespace MyProject +{ + public class BookService : ITransientDependency { - //TODO: get from database + private readonly IDistributedCache _cache; + + public BookService(IDistributedCache cache) + { + _cache = cache; + } + + public async Task GetAsync(Guid bookId) + { + return await _cache.GetOrAddAsync( + bookId.ToString(), //缓存键 + async () => await GetBookFromDatabaseAsync(bookId), + () => new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddHours(1) + } + ); + } + + private Task GetBookFromDatabaseAsync(Guid bookId) + { + //TODO: 从数据库获取数据 + } } } ```` -* 示例服务代码中的 `GetOrAddAsync()` 方法从缓存中获取图书项. +* 示例服务代码中的 `GetOrAddAsync()` 方法从缓存中获取图书项. `GetOrAddAsync`是ABP框架在 ASP.NET Core 分布式缓存方法中添增的附加方法. * 如果没有在缓存中找到图书,它会调用工厂方法 (本示例中是 `GetBookFromDatabaseAsync`)从原始数据源中获取图书项. * `GetOrAddAsync` 有一个可选参数 `DistributedCacheEntryOptions` , 可用于设置缓存的生命周期. -`IDistributedCache` 的其他方法与ASP.NET Core的`IDistributedCache` 接口相同, 你可以参考 [ASP.NET Core文档](https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed). +`IDistributedCache` 与ASP.NET Core的`IDistributedCache` 接口拥有相同的方法, 你可以参考 [ASP.NET Core文档](https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed). -## `IDistributedCache` 接口 +### `IDistributedCache` 接口 -`IDistributedCache` 接口默认了键是 `string` 类型 (如果你的键不是string类型需要进行手动类型转换). `IDistributedCache` 将键的类型泛型化试图简化手动转换的操作. +`IDistributedCache` 接口默认了**缓存键**是 `string` 类型 (如果你的键不是string类型需要进行手动类型转换). 但当缓存键的类型不是`string`时, 可以使用`IDistributedCache`. -### 使用示例 +**示例: 在缓存中存储图书名称和价格** 示例缓存项 ````csharp -public class BookCacheItem +using Volo.Abp.Caching; + +namespace MyProject { - public string Name { get; set; } + [CacheName("Books")] + public class BookCacheItem + { + public string Name { get; set; } - public float Price { get; set; } + public float Price { get; set; } + } } ```` -用法示例 (这里假设你的键类型是 `Guid`): +* 在本例中使用`CacheName`特性给`BookCacheItem`类设置缓存名称. -````csharp -public class BookService : ITransientDependency -{ - private readonly IDistributedCache _cache; +你可以注入 `IDistributedCache` 服务用于 get/set `BookCacheItem` 对象. - public BookService(IDistributedCache cache) - { - _cache = cache; - } +````csharp +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Distributed; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; - public async Task GetAsync(Guid bookId) - { - return await _cache.GetOrAddAsync( - bookId, //Guid type used as the cache key - async () => await GetBookFromDatabaseAsync(bookId), - () => new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddHours(1) - } - ); - } - private Task GetBookFromDatabaseAsync(Guid bookId) +namespace MyProject +{ + public class BookService : ITransientDependency { - //TODO: get from database + private readonly IDistributedCache _cache; + + public BookService(IDistributedCache cache) + { + _cache = cache; + } + + public async Task GetAsync(Guid bookId) + { + return await _cache.GetOrAddAsync( + bookId, //Guid类型作为缓存键 + async () => await GetBookFromDatabaseAsync(bookId), + () => new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddHours(1) + } + ); + } + private Task GetBookFromDatabaseAsync(Guid bookId) + { + //TODO: 从数据库获取数据 + } } } ```` * 示例服务中 `GetOrAddAsync()` 方法获取缓存的图书项. -* 我们采用了 `Guid` 做为键,在 `_cache_GetOrAddAsync()` 方法中传入 `Guid` 类型的bookid. +* 我们采用了 `Guid` 做为键, 在 `_cache_GetOrAddAsync()` 方法中传入 `Guid` 类型的bookid. + +#### 复杂类型的缓存键 -`IDistributedCache` 在内部使用键对象的 `ToString()` 方法转换类型为string. 如果你的将复杂对象做为键,那么需要重写类的 `ToString` 方法. +`IDistributedCache` 在内部使用键对象的 `ToString()` 方法转换类型为string. 如果你的将复杂对象做为缓存键,那么需要重写类的 `ToString` 方法. -示例: +举例一个作为缓存键的类: ````csharp public class UserInOrganizationCacheKey @@ -187,23 +203,72 @@ public class BookService : ITransientDependency { _cache = cache; } - + ... } ```` +## 配置 + +### AbpDistributedCacheOptions +`AbpDistributedCacheOptions` 是配置缓存的主要[Option类](Options.md). + +**示例:为应用程序设置缓存键前缀** + +```csharp +Configure(options => +{ + options.KeyPrefix = "MyApp1"; +}); +``` +> 在[模块类](Module-Development-Basics.md)的`ConfigureServices`方法中添加代码. + +#### 可用选项 + +* `HideErrors` (`bool`, 默认: `true`): 启用/禁用隐藏从缓存服务器写入/读取值时的错误. +* `KeyPrefix` (`string`, 默认: `null`): 如果你的缓存服务器由多个应用程序共同使用, 则可以为应用程序的缓存键设置一个前缀. 在这种情况下, 不同的应用程序不能覆盖彼此的缓存内容. +* `GlobalCacheEntryOptions` (`DistributedCacheEntryOptions`): 用于设置保存缓内容却没有指定选项时, 默认的分布式缓存选项 (例如 `AbsoluteExpiration` 和 `SlidingExpiration`). `SlidingExpiration`的默认值设置为20分钟. + +## 错误处理 + +当为你的对象设计缓存时, 通常会首先尝试从缓存中获取值. 如果在缓存中找不到该值, 则从**来源**查询对象. 它可能在**数据库**中, 或者可能需要通过HTTP调用远程服务器. + +在大多数情况下, 你希望**容忍缓存错误**; 如果缓存服务器出现错误, 也不希望取消该操作. 相反, 你可以默默地隐藏(并记录)错误并**从来源查询**. 这就是ABP框架默认的功能. + +ABP的分布式缓存 [异常处理](Exception-Handling.md), 默认记录并隐藏错误. 有一个全局修改该功能的选项(参见下面的选项内容). + +所有的`IDistributedCache` (和 `IDistributedCache`)方法都有一个可选的参数`hideErrors`, 默认值为`null`. 如果此参数设置为`null`, 则全局生效, 否则你可以选择单个方法调用时隐藏或者抛出异常. + ## 批量操作 ABP的分布式缓存接口定义了以下批量操作方法,当你需要在一个方法中调用多次缓存操作时,这些方法可以提高性能 -* `SetManyAsync` 和 `SetMany` 方法可以用来设置多个值. +* `SetManyAsync` 和 `SetMany` 方法可以用来向缓存中设置多个值. * `GetManyAsync` 和 `GetMany` 方法可以用来从缓存中获取多个值. * `GetOrAddManyAsync` 和 `GetOrAddMany` 方法可以用来从缓存中获取并添加缺少的值. * `RefreshManyAsync` 和 `RefreshMany` 方法可以来用重置多个值的滚动过期时间. -* `RemoveManyAsync` 和 `RemoveMany` 方法呆以用来删除多个值. +* `RemoveManyAsync` 和 `RemoveMany` 方法可以用来从缓存中删除多个值. > 这些不是标准的ASP.NET Core缓存方法, 所以某些提供程序可能不支持. [ABP Redis集成包](Redis-Cache.md)实现了它们. 如果提供程序不支持,会回退到 `SetAsync` 和 `GetAsync` ... 方法(循环调用). -### DistributedCacheOptions +## 高级主题 + +### 工作单元级别的缓存 + +分布式缓存服务提供了一个有趣的功能. 假设你已经更新了数据库中某本书的价格, 然后将新价格设置到缓存中, 以便以后使用缓存的值. 如果设置缓存后出现异常, 并且更新图书价格的**事务被回滚了**, 该怎么办?在这种情况下, 缓存值是错误的. + +`IDistributedCache<..>`方法提供一个可选参数, `considerUow`, 默认为`false`. 如果将其设置为`true`, 则你对缓存所做的更改不会应用于真正的缓存存储, 而是与当前的[工作单元](Unit-Of-Work.md)关联. 你将获得在同一工作单元中设置的缓存值, 但**仅当前工作单元成功时**更改才会生效. + +### IDistributedCacheSerializer + +`IDistributedCacheSerializer`服务用于序列化和反序列化缓存内容. 默认实现是`Utf8JsonDistributedCacheSerializer`类, 它使用`IJsonSerializer`服务将对象转换为[JSON](Json-Serialization.md), 反之亦然. 然后, 它使用UTC8编码将JSON字符串转换为分布式缓存接受的字节数组. + +如果你想实现自己的序列化逻辑, 可以自己实现并[替换](Dependency-Injection.md) 此服务. + +### IDistributedCacheKeyNormalizer + +默认情况下, `IDistributedCacheKeyNormalizer`是由`DistributedCacheKeyNormalizer`类实现的. 它将缓存名称、应用程序缓存前缀和当前租户id添加到缓存键中. 如果需要更高级的键规范化, 可以自己实现并[替换](Dependency-Injection.md)此服务. + +## 另请参阅 -TODO +* [Redis 缓存](Redis-Cache.md) diff --git a/docs/zh-Hans/Distributed-Event-Bus-Kafka-Integration.md b/docs/zh-Hans/Distributed-Event-Bus-Kafka-Integration.md index f621a95fae..171fe3c23b 100644 --- a/docs/zh-Hans/Distributed-Event-Bus-Kafka-Integration.md +++ b/docs/zh-Hans/Distributed-Event-Bus-Kafka-Integration.md @@ -1,10 +1,10 @@ # 分布式事件总线Kafka集成 -> 本文解释了**如何配置[Kafka](https://kafka.apache.org/)**做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. +> 本文解释了 **如何配置[Kafka](https://kafka.apache.org/)** 做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. ## 安装 -使用ABP CLI添加[Volo.Abp.EventBus.Kafka[Volo.Abp.EventBus.Kafka](https://www.nuget.org/packages/Volo.Abp.EventBus.Kafka)NuGet包到你的项目: +使用ABP CLI添加[Volo.Abp.EventBus.Kafka](https://www.nuget.org/packages/Volo.Abp.EventBus.Kafka)NuGet包到你的项目: * 安装[ABP CLI](https://docs.abp.io/en/abp/latest/CLI),如果你还没有安装. * 在你想要安装 `Volo.Abp.EventBus.Kafka` 包的 `.csproj` 文件目录打开命令行(终端). @@ -18,7 +18,7 @@ ### `appsettings.json` 文件配置 -这是配置Kafka设置最简单的方法. 它也非常强大,因为你可以使用[由AspNet Core支持的](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/)的任何其他配置源(如环境变量). +这是配置Kafka设置最简单的方法. 它也非常强大,因为你可以使用[由AspNet Core支持](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/)的任何其他配置源(如环境变量). **示例:最小化配置与默认配置连接到本地的Kafka服务器** @@ -160,4 +160,4 @@ Configure(options => }); ```` -使用这些选项类可以与 `appsettings.json` 组合在一起. 在代码中配置选项属性会覆盖配置文件中的值. \ No newline at end of file +使用这些选项类可以与 `appsettings.json` 组合在一起. 在代码中配置选项属性会覆盖配置文件中的值. diff --git a/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md index ab7cb68bd7..1cd6b5b9dd 100644 --- a/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md +++ b/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -1,10 +1,10 @@ # 分布式事件总线RabbitMQ集成 -> 本文解释了**如何配置[RabbitMQ](https://www.rabbitmq.com/)**做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. +> 本文解释了 **如何配置[RabbitMQ](https://www.rabbitmq.com/)** 做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. ## 安装 -使用ABP CLI添加[Volo.Abp.EventBus.RabbitMQ[Volo.Abp.EventBus.RabbitMQ](https://www.nuget.org/packages/Volo.Abp.EventBus.RabbitMQ)NuGet包到你的项目: +使用ABP CLI添加[Volo.Abp.EventBus.RabbitMQ](https://www.nuget.org/packages/Volo.Abp.EventBus.RabbitMQ)NuGet包到你的项目: * 安装[ABP CLI](https://docs.abp.io/en/abp/latest/CLI),如果你还没有安装. * 在你想要安装 `Volo.Abp.EventBus.RabbitMQ` 包的 `.csproj` 文件目录打开命令行(终端). @@ -18,7 +18,7 @@ ### `appsettings.json` 文件配置 -这是配置RabbitMQ设置最简单的方法. 它也非常强大,因为你可以使用[由AspNet Core支持的](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/)的任何其他配置源(如环境变量). +这是配置RabbitMQ设置最简单的方法. 它也非常强大,因为你可以使用[由AspNet Core支持](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/)的任何其他配置源(如环境变量). **示例:最小化配置与默认配置连接到本地的RabbitMQ服务器** @@ -151,4 +151,4 @@ Configure(options => }); ```` -使用这些选项类可以与 `appsettings.json` 组合在一起. 在代码中配置选项属性会覆盖配置文件中的值. \ No newline at end of file +使用这些选项类可以与 `appsettings.json` 组合在一起. 在代码中配置选项属性会覆盖配置文件中的值. diff --git a/docs/zh-Hans/Distributed-Event-Bus-Rebus-Integration.md b/docs/zh-Hans/Distributed-Event-Bus-Rebus-Integration.md index 409b935ace..64fce06d1b 100644 --- a/docs/zh-Hans/Distributed-Event-Bus-Rebus-Integration.md +++ b/docs/zh-Hans/Distributed-Event-Bus-Rebus-Integration.md @@ -1,10 +1,10 @@ # 分布式事件总线Rebus集成 -> 本文解释了**如何配置[Rebus](http://mookid.dk/category/rebus/)**做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. +> 本文解释了 **如何配置[Rebus](http://mookid.dk/category/rebus/)** 做为分布式总线提供程序. 参阅[分布式事件总线文档](Distributed-Event-Bus.md)了解如何使用分布式事件总线系统. ## 安装 -使用ABP CLI添加[Volo.Abp.EventBus.Rebus[Volo.Abp.EventBus.Rebus](https://www.nuget.org/packages/Volo.Abp.EventBus.Rebus)NuGet包到你的项目: +使用ABP CLI添加[Volo.Abp.EventBus.Rebus](https://www.nuget.org/packages/Volo.Abp.EventBus.Rebus)NuGet包到你的项目: * 安装[ABP CLI](https://docs.abp.io/en/abp/latest/CLI),如果你还没有安装. * 在你想要安装 `Volo.Abp.EventBus.Rebus` 包的 `.csproj` 文件目录打开命令行(终端). diff --git a/docs/zh-Hans/Distributed-Event-Bus.md b/docs/zh-Hans/Distributed-Event-Bus.md index f16aa0610f..e59fa5e726 100644 --- a/docs/zh-Hans/Distributed-Event-Bus.md +++ b/docs/zh-Hans/Distributed-Event-Bus.md @@ -264,7 +264,7 @@ Configure(options => 因此可以实现 `IDistributedEventHandler>` 订阅事件. 但是订阅这样的通用事件不是一个好方法,你可以为实体类型定义对应的ETO. -**示例: 为 `Product` 声明使用 `ProductDto`** +**示例: 为 `Product` 声明使用 `ProductEto`** ````csharp Configure(options => diff --git a/docs/zh-Hans/Domain-Services.md b/docs/zh-Hans/Domain-Services.md index 9c9bb7dfd2..a617aea645 100644 --- a/docs/zh-Hans/Domain-Services.md +++ b/docs/zh-Hans/Domain-Services.md @@ -1,3 +1,128 @@ -# ABP Documentation +# 领域服务 -待添加 +## 介绍 + +在 [领域驱动设计](Domain-Driven-Design.md) (DDD) 解决方案中,核心业务逻辑通常在聚合 ([实体](Entities.md)) 和领域服务中实现. 在以下情况下特别需要创建领域服务 + +* 你实现了依赖于某些服务(如存储库或其他外部服务)的核心域逻辑. +* 你需要实现的逻辑与多个聚合/实体相关,因此它不适合任何聚合. + +## ABP 领域服务基础设施 + +领域服务是简单的无状态类. 虽然你不必从任何服务或接口派生,但 ABP 框架提供了一些有用的基类和约定. + +### DomainService 和 IDomainService + +从 `DomainService` 基类派生领域服务或直接实现 `IDomainService` 接口. + +**示例: 创建从 `DomainService` 基类派生的领域服务.** + +````csharp +using Volo.Abp.Domain.Services; +namespace MyProject.Issues +{ + public class IssueManager : DomainService + { + + } +} +```` + +当你这样做时: + +* ABP 框架自动将类注册为瞬态生命周期到依赖注入系统. +* 你可以直接使用一些常用服务作为基础属性,而无需手动注入 (例如 [ILogger](Logging.md) and [IGuidGenerator](Guid-Generation.md)). + +> 建议使用 `Manager` 或 `Service` 后缀命名领域服务. 我们通常使用如上面示例中的 `Manager` 后缀. +**示例: 实现将问题分配给用户的领域逻辑** + +````csharp +public class IssueManager : DomainService +{ + private readonly IRepository _issueRepository; + public IssueManager(IRepository issueRepository) + { + _issueRepository = issueRepository; + } + + public async Task AssignAsync(Issue issue, AppUser user) + { + var currentIssueCount = await _issueRepository + .CountAsync(i => i.AssignedUserId == user.Id); + + //Implementing a core business validation + if (currentIssueCount >= 3) + { + throw new IssueAssignmentException(user.UserName); + } + issue.AssignedUserId = user.Id; + } +} +```` + +问题是定义如下所示的 [聚合根](Entities.md): + +````csharp +public class Issue : AggregateRoot +{ + public Guid? AssignedUserId { get; internal set; } + + //... +} +```` + +* 使用 `internal` 的 set 确保外层调用者不能直接在调用 set ,并强制始终使用 `IssueManager` 为 `User` 分配 `Issue`. + +### 使用领域服务 + +领域服务通常用于 [应用程序服务](Application-Services.md). + +**示例: 使用 `IssueManager` 将问题分配给用户** + +````csharp +using System; +using System.Threading.Tasks; +using MyProject.Users; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +namespace MyProject.Issues +{ + public class IssueAppService : ApplicationService, IIssueAppService + { + private readonly IssueManager _issueManager; + private readonly IRepository _userRepository; + private readonly IRepository _issueRepository; + public IssueAppService( + IssueManager issueManager, + IRepository userRepository, + IRepository issueRepository) + { + _issueManager = issueManager; + _userRepository = userRepository; + _issueRepository = issueRepository; + } + public async Task AssignAsync(Guid id, Guid userId) + { + var issue = await _issueRepository.GetAsync(id); + var user = await _userRepository.GetAsync(userId); + await _issueManager.AssignAsync(issue, user); + await _issueRepository.UpdateAsync(issue); + } + } +} +```` + +由于 `IssueAppService` 在应用层, 它不能直接将问题分配给用户.因此,它使用 `IssueManager`. + +## 应用程序服务与领域服务 + +虽然应用服务和领域服务都实现了业务规则,但存在根本的逻辑和形式差异; +虽然 [应用服务](Application-Services.md) 和领域服务都实现了业务规则,但存在根本的逻辑和形式差异: + +* 应用程序服务实现应用程序的 **用例** (典型 Web 应用程序中的用户交互), 而领域服务实现 **核心的、用例独立的领域逻辑**. +* 应用程序服务获取/返回 [数据传输对象](Data-Transfer-Objects.md), 领域服务方法通常获取和返回 **领域对象** ([实体](Entities.md), [值对象](Value-Objects.md)). +* 领域服务通常由应用程序服务或其他领域服务使用,而应用程序服务由表示层或客户端应用程序使用. + +## 生命周期 + +领域服务的生命周期是 [瞬态](https://docs.abp.io/en/abp/latest/Dependency-Injection) 的,它们会自动注册到依赖注入服务. diff --git a/docs/zh-Hans/Modules/Background-Jobs.md b/docs/zh-Hans/Modules/Background-Jobs.md index b183febd80..fe021f1a56 100644 --- a/docs/zh-Hans/Modules/Background-Jobs.md +++ b/docs/zh-Hans/Modules/Background-Jobs.md @@ -1,3 +1,55 @@ -# Background Jobs Module +# 后台作业模块 -待添加 \ No newline at end of file +后台作业模块实现了 `IBackgroundJobStore` 接口,并且可以使用ABP框架的默认后台作业管理.如果你不想使用这个模块,那么你需要自己实现 `IBackgroundJobStore` 接口. + +> 本文档仅介绍后台作业模块,该模块将后台作业持久化到数据库.有关后台作业系统的更多信息,请参阅[后台作业](../Background-Jobs.md)文档. + +## 如何使用 + +当你使用ABP框架[创建一个新的解决方案](https://abp.io/get-started)时,这个模块是(作为NuGet/NPM包)预先安装的.你可以继续将其作为软件包使用并轻松获取更新,也可以将其源代码包含到解决方案中(请参阅 `get-source` [CLI](../CLI.md)命令)以开发自定义模块. + +### 源代码 + +此模块的源代码可在[此处](https://github.com/abpframework/abp/tree/dev/modules/background-jobs)访问.源代码是由[MIT](https://choosealicense.com/licenses/mit/)授权的,所以你可以自由使用和定制它. + +## 内部结构 + +### 领域层 + +#### 聚合 + +- `BackgroundJobRecord` (聚合根): 表示后台工作记录. + +#### 仓储 + +为该模块定义了以下自定义仓储: + +- `IBackgroundJobRepository` + +### 数据库提供程序 + +#### 通用 + +##### 表/集合的前缀与架构 + +默认情况下,所有表/集合都使用 `Abp` 前缀.如果需要更改表前缀或设置架构名称(如果数据库提供程序支持),请在 `BackgroundJobsDbProperties` 类上设置静态属性. + +##### 连接字符串 + +此模块使用 `AbpBackgroundJobs` 作为连接字符串名称.如果不使用此名称定义连接字符串,它将返回 `Default` 连接字符串.有关详细信息,请参阅[连接字符串](https://docs.abp.io/en/abp/latest/Connection-Strings)文档. + +#### Entity Framework Core + +##### 表 + +- **AbpBackgroundJobs** + +#### MongoDB + +##### 集合 + +- **AbpBackgroundJobs** + +## 另请参阅 + +* [后台作业系统](../Background-Jobs.md) diff --git a/docs/zh-Hans/Specifications.md b/docs/zh-Hans/Specifications.md index f927c80255..40a473dbc0 100644 --- a/docs/zh-Hans/Specifications.md +++ b/docs/zh-Hans/Specifications.md @@ -1,3 +1,257 @@ ## 规约 -TODO.. \ No newline at end of file +规约模式用于为实体和其他业务对象定义 **命名、可复用、可组合和可测试的过滤器** . + +> 规约是领域层的一部分. + +## 安装 + +> 这个包 **已经安装** 在启动模板中.所以,大多数时候你不需要手动去安装. + +添加 [Volo.Abp.Specifications](https://abp.io/package-detail/Volo.Abp.Specifications) 包到你的项目. 如果当前文件夹是你的项目的根目录(`.csproj`)时,你可以在命令行终端中使用 [ABP CLI](CLI.md) *add package* 命令: + +````bash +abp add-package Volo.Abp.Specifications +```` + +## 定义规约 + +假设你定义了如下的顾客实体: + +````csharp +using System; +using Volo.Abp.Domain.Entities; + +namespace MyProject +{ + public class Customer : AggregateRoot + { + public string Name { get; set; } + + public byte Age { get; set; } + + public long Balance { get; set; } + + public string Location { get; set; } + } +} +```` + +你可以创建一个由 `Specification` 派生的新规约类. + +**例如:规定选择一个18岁以上的顾客** + +````csharp +using System; +using System.Linq.Expressions; +using Volo.Abp.Specifications; + +namespace MyProject +{ + public class Age18PlusCustomerSpecification : Specification + { + public override Expression> ToExpression() + { + return c => c.Age >= 18; + } + } +} +```` + +你只需通过定义一个lambda[表达式](https://docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/lambda-expressions)来定义规约. + +> 你也可以直接实现`ISpecification`接口,但是基类`Specification`做了大量简化. + +## 使用规约 + +这里有两种常见的规约用例. + +### IsSatisfiedBy + +`IsSatisfiedBy` 方法可以用于检查单个对象是否满足规约. + +**例如:如果顾客不满足年龄规定,则抛出异常** + +````csharp +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace MyProject +{ + public class CustomerService : ITransientDependency + { + public async Task BuyAlcohol(Customer customer) + { + if (!new Age18PlusCustomerSpecification().IsSatisfiedBy(customer)) + { + throw new Exception( + "这位顾客不满足年龄规定!" + ); + } + + //TODO... + } + } +} +```` + +### ToExpression & Repositories + +`ToExpression()` 方法可用于将规约转化为表达式.通过这种方式,你可以使用规约在**数据库查询时过滤实体**. + +````csharp +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; + +namespace MyProject +{ + public class CustomerManager : DomainService, ITransientDependency + { + private readonly IRepository _customerRepository; + + public CustomerManager(IRepository customerRepository) + { + _customerRepository = customerRepository; + } + + public async Task> GetCustomersCanBuyAlcohol() + { + var queryable = await _customerRepository.GetQueryableAsync(); + var query = queryable.Where( + new Age18PlusCustomerSpecification().ToExpression() + ); + + return await AsyncExecuter.ToListAsync(query); + } + } +} +```` + +> 规约被正确地转换为SQL/数据库查询语句,并且在DBMS端高效执行.虽然它与规约无关,但如果你想了解有关 `AsyncExecuter` 的更多信息,请参阅[仓储](Repositories.md)文档. + +实际上,没有必要使用 `ToExpression()` 方法,因为规约会自动转换为表达式.这也会起作用: + +````csharp +var queryable = await _customerRepository.GetQueryableAsync(); +var query = queryable.Where( + new Age18PlusCustomerSpecification() +); +```` + +## 编写规约 + +规约有一个强大的功能是,它们可以与`And`、`Or`、`Not`以及`AndNot`扩展方法组合使用. + +假设你有另一个规约,定义如下: + +```csharp +using System; +using System.Linq.Expressions; +using Volo.Abp.Specifications; + +namespace MyProject +{ + public class PremiumCustomerSpecification : Specification + { + public override Expression> ToExpression() + { + return (customer) => (customer.Balance >= 100000); + } + } +} +``` + +你可以将 `PremiumCustomerSpecification` 和 `Age18PlusCustomerSpecification` 结合起来,查询优质成人顾客的数量,如下所示: + +````csharp +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using Volo.Abp.Specifications; + +namespace MyProject +{ + public class CustomerManager : DomainService, ITransientDependency + { + private readonly IRepository _customerRepository; + + public CustomerManager(IRepository customerRepository) + { + _customerRepository = customerRepository; + } + + public async Task GetAdultPremiumCustomerCountAsync() + { + return await _customerRepository.CountAsync( + new Age18PlusCustomerSpecification() + .And(new PremiumCustomerSpecification()).ToExpression() + ); + } + } +} +```` + +如果你想让这个组合成为一个可复用的规约,你可以创建这样一个组合的规约类,它派生自`AndSpecification`: + +````csharp +using Volo.Abp.Specifications; + +namespace MyProject +{ + public class AdultPremiumCustomerSpecification : AndSpecification + { + public AdultPremiumCustomerSpecification() + : base(new Age18PlusCustomerSpecification(), + new PremiumCustomerSpecification()) + { + } + } +} +```` + +现在,你就可以向下面一样重新编写 `GetAdultPremiumCustomerCountAsync` 方法: + +````csharp +public async Task GetAdultPremiumCustomerCountAsync() +{ + return await _customerRepository.CountAsync( + new AdultPremiumCustomerSpecification() + ); +} +```` + +> 你可以从这些例子中看到规约的强大之处.如果你之后想要更改 `PremiumCustomerSpecification` ,比如将余额从 `100.000` 修改为 `200.000` ,所有查询语句和合并的规约都将受到本次更改的影响.这是减少代码重复的好方法! + +## 讨论 + +虽然规约模式通常与C#的lambda表达式相比较,算是一种更老的方式.一些开发人员可能认为不再需要它,我们可以直接将表达式传入到仓储或领域服务中,如下所示: + +````csharp +var count = await _customerRepository.CountAsync(c => c.Balance > 100000 && c.Age => 18); +```` + +自从ABP的[仓储](Repositories.md)支持表达式,这是一个完全有效的用法.你不必在应用程序中定义或使用任何规约,可以直接使用表达式. + +所以,规约的意义是什么?为什么或者应该在什么时候考虑去使用它? + +### 何时使用? + +使用规约的一些好处: + +- **可复用**:假设你在代码库的许多地方都需要用到优质顾客过滤器.如果使用表达式而不创建规约,那么如果以后更改“优质顾客”的定义会发生什么?假设你想将最低余额从100000美元更改为250000美元,并添加另一个条件,成为顾客超过3年.如果使用了规约,只需修改一个类.如果在任何其他地方重复(复制/粘贴)相同的表达式,则需要更改所有的表达式. +- **可组合**:可以组合多个规约来创建新规约.这是另一种可复用性. +- **命名**:`PremiumCustomerSpecification` 更好地解释了为什么使用规约,而不是复杂的表达式.因此,如果在你的业务中使用了一个有意义的表达式,请考虑使用规约. +- **可测试**:规约是一个单独(且易于)测试的对象. + +### 什么时侯不要使用? + +- **没有业务含义的表达式**:不要对与业务无关的表达式和操作使用规约. +- **报表**:如果只是创建报表,不要创建规约,而是直接使用 `IQueryable` 和LINQ表达式.你甚至可以使用普通SQL、视图或其他工具生成报表.DDD不关心报表,因此从性能角度来看,查询底层数据存储的方式可能很重要. diff --git a/docs/zh-Hans/Testing.md b/docs/zh-Hans/Testing.md new file mode 100644 index 0000000000..5bb72803c8 --- /dev/null +++ b/docs/zh-Hans/Testing.md @@ -0,0 +1,768 @@ +# 自动化测试 + +## 介绍 + +ABP框架的设计考虑了可测试性. 有一些不同级别的自动化测试: + +* **单元测试**: 通常只测试一个类(或者一起测试几个类). 这些测试会很快. 然而, 你通常需要处理对服务依赖项的模拟. +* **集成测试**: 你通常会测试一个服务, 但这一次你不会模拟基本的基础设施和服务, 以查看它们是否正确地协同工作. +* **用户界面测试**: 测试应用程序的UI, 就像用户与应用程序交互一样. + +### 单元测试 vs 集成测试 + +与单元测试相比, 集成测试有一些显著的**优势**: + +* **编写更加简单** 因为你不需要模拟和处理依赖关系. +* 你的测试代码运行于所有真正的服务和基础设施(包括数据库映射和查询), 因此它更接近于**真正的应用程序测试**. + +同时它们有一些缺点: + +* 与单元测试相比, 它们**更慢**, 因为所有的基础设施都准备好了测试用例. +* 服务中的一个bug可能会导致多个测试用例失败, 因此在某些情况下, 可能会**更难找到真正的问题**. + +我们建议混合使用: 在必要的地方编写单元测试或集成测试, 并且有效的编写和维护它. + +## 应用程序启动模板 + +测试基础设施提供[应用程序启动模板](Startup-Templates/Application.md) , 并已经正确安装和配置. + +### 测试项目 + +请参见Visual Studio中的以下解决方案: + +![solution-test-projects](images/solution-test-projects.png) + +按层级系统分为多个测试项目: + +* `Domain.Tests` 用于测试领域层对象 (例如[领域服务](Domain-Services.md) 和 [实体](Entities.md)). +* `Application.Tests` 用于测试应用层对象 (例如[应用服务](Application-Services.md)). +* `EntityFrameworkCore.Tests` 用于测试你的自定义仓储实现或EF Core映射(如果你使用其他[数据访问](Data-Access.md))的话, 该项目将有所不同). +* `Web.Tests` 用于测试UI层(如页面、控制器和视图组件). 该项目仅适用于MVC / Razor页面应用程序. +* `TestBase` 包含一些由其他项目共享/使用的类. + +> `HttpApi.Client.ConsoleTestApp` 不是自动化测试的应用程序. 它是一个示例的控制台应用程序, 展示了如何从.NET控制台应用程序中调用HTTP API. + +以下的部分将介绍这些项目中包含的基类和其他基础设施. + +### 测试基础设施 + +解决方案中已经安装了以下库: + +* [xUnit](https://xunit.net/) 作为测试框架. +* [NSubstitute](https://nsubstitute.github.io/) 用于模拟. +* [Shouldly](https://github.com/shouldly/shouldly) 用于断言. + +虽然你可以用自己喜欢的工具替换它们, 但本文档和示例将基于这些工具. + +## 测试资源管理器 + +你可以在Visual Studio中使用测试资源管理器查看和运行测试. 其他IDE, 请参阅它们自己的文档. + +### 打开测试资源管理器 + +打开*测试*菜单下的*测试资源管理器*(如果尚未打开): + +![vs-test-explorer](images/vs-test-explorer.png) + +### 运行测试 + +然后, 你可以单击在视图中运行所有测试或运行按钮来运行测试. 初始启动模板为你提供了一些测试用例: + +![vs-startup-template-tests](images/vs-startup-template-tests.png) + +### 并行运行测试 + +支持并行运行测试. **强烈建议**并行运行所有测试, 这比逐个运行测试要快得多. + +要启用它, 请单击设置(齿轮)按钮附近的插入符号图标, 然后选择*并行运行测试*. + +![vs-run-tests-in-parallel](images/vs-run-tests-in-parallel.png) + +## 单元测试 + +对于单元测试, 不需要太多的配置. 通常会实例化你的类, 并对要测试的对象提供一些预先配置的模拟对象. + +### 没有依赖项的类 + +要测试的类没有依赖项是最简单的情况, 你可以直接实例化类, 调用其方法并做出断言. + +#### 示例: 测试实体 + +假设你有一个 `Issue` [实体](Entities.md), 如下所示: + +````csharp +using System; +using Volo.Abp.Domain.Entities; + +namespace MyProject.Issues +{ + public class Issue : AggregateRoot + { + public string Title { get; set; } + public string Description { get; set; } + public bool IsLocked { get; set; } + public bool IsClosed { get; private set; } + public DateTime? CloseDate { get; private set; } + + public void Close() + { + IsClosed = true; + CloseDate = DateTime.UtcNow; + } + + public void Open() + { + if (!IsClosed) + { + return; + } + + if (IsLocked) + { + throw new IssueStateException("You can not open a locked issue!"); + } + + IsClosed = true; + CloseDate = null; + } + } +} + +```` + +请注意, `IsClosed`和`CloseDate`属性具有私有setter, 可以使用`Open()`和`Close()`方法强制执行某些业务逻辑: + +* 无论何时关闭issue, `CloseDate`都应设置为[当前时间](Timing.md). +* 如果issue被锁定, 则无法重新打开. 如果它被重新打开, `CloseDate`应该设置为`null`. + +由于`Issue`实体是领域层的一部分, 所以我们应该在`Domain.Tests`项目中测试它. 在`Domain.Tests`项目中创建一个`Issue_Tests`类: + +````csharp +using Shouldly; +using Xunit; + +namespace MyProject.Issues +{ + public class Issue_Tests + { + [Fact] + public void Should_Set_The_CloseDate_Whenever_Close_An_Issue() + { + // Arrange + + var issue = new Issue(); + issue.CloseDate.ShouldBeNull(); // null at the beginning + + // Act + + issue.Close(); + + // Assert + + issue.IsClosed.ShouldBeTrue(); + issue.CloseDate.ShouldNotBeNull(); + } + } +} +```` + +这个测试遵循AAA(Arrange-Act-Assert)模式: + +* **Arrange** 部分创建一个`Issue`实体, 并确保`CloseDate`在初始值为`null`. +* **Act** 部分执行我们想要测试的方法. +* **Assert** 部分检查`Issue`属性是否与我们预期的相同. + +`[Fact]`属性由[xUnit](https://xunit.net/)并将方法标记为测试方法. `Should...`扩展方法由[Shouldly](https://github.com/shouldly/shouldly)提供. 你可以直接使用xUnit中的`Assert`类, 使用Shouldly让它更舒适、更直观. + +当你执行测试时, 你将看到它成功通过: + +![issue-first-test](images/issue-first-test.png) + +让我们再添加两种测试方法: + +````csharp +[Fact] +public void Should_Allow_To_ReOpen_An_Issue() +{ + // Arrange + + var issue = new Issue(); + issue.Close(); + + // Act + + issue.Open(); + + // Assert + + issue.IsClosed.ShouldBeFalse(); + issue.CloseDate.ShouldBeNull(); +} + +[Fact] +public void Should_Not_Allow_To_ReOpen_A_Locked_Issue() +{ + // Arrange + + var issue = new Issue(); + issue.Close(); + issue.IsLocked = true; + + // Act & Assert + + Assert.Throws(() => + { + issue.Open(); + }); +} +```` + +`Assert.Throws` 检查执行的代码是否匹配引发的异常. + +> 有关这些库的更多信息, 请参阅xUnit & Shoudly的文档. + +### 具有依赖项的类 + +如果你的服务中有依赖项, 并且你想对该服务进行单元测试, 那么你需要模拟这些依赖项. + +#### 示例: 测试领域服务 + +假设你有一个`IssueManager` [领域服务](Domain-Services.md), 定义如下: + +````csharp +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Services; + +namespace MyProject.Issues +{ + public class IssueManager : DomainService + { + public const int MaxAllowedOpenIssueCountForAUser = 3; + + private readonly IIssueRepository _issueRepository; + + public IssueManager(IIssueRepository issueRepository) + { + _issueRepository = issueRepository; + } + + public async Task AssignToUserAsync(Issue issue, Guid userId) + { + var issueCount = await _issueRepository.GetIssueCountOfUserAsync(userId); + + if (issueCount >= MaxAllowedOpenIssueCountForAUser) + { + throw new BusinessException( + code: "IM:00392", + message: $"You can not assign more" + + $"than {MaxAllowedOpenIssueCountForAUser} issues to a user!" + ); + } + + issue.AssignedUserId = userId; + } + } +} +```` + +`IssueManager`依赖于`IssueRepository`服务, 在本例中将模拟该服务. + +**业务逻辑**: 示例`AssignToUserAsync`不允许向用户分配超过3个issue (`MaxAllowedOpenIssueCountForAUser`常量). 在这种情况下, 如果要分配issue, 首先需要取消现有issue的分配. + +下面的测试用例给出一个有效的赋值: + +````csharp +using System; +using System.Threading.Tasks; +using NSubstitute; +using Shouldly; +using Volo.Abp; +using Xunit; + +namespace MyProject.Issues +{ + public class IssueManager_Tests + { + [Fact] + public async Task Should_Assign_An_Issue_To_A_User() + { + // Arrange + + var userId = Guid.NewGuid(); + + var fakeRepo = Substitute.For(); + fakeRepo.GetIssueCountOfUserAsync(userId).Returns(1); + + var issueManager = new IssueManager(fakeRepo); + + var issue = new Issue(); + + // Act + + await issueManager.AssignToUserAsync(issue, userId); + + //Assert + + issue.AssignedUserId.ShouldBe(userId); + await fakeRepo.Received(1).GetIssueCountOfUserAsync(userId); + } + } +} +```` + +* `Substitute.For` 创建一个模拟(假)对象, 该对象被传递到`IssueManager`构造函数中. +* `fakeRepo.GetIssueCountOfUserAsync(userId).Returns(1)` 确保仓储中的`GetIssueContofuseRasync`方法返回`1`. +* `issueManager.AssignToUserAsync` 不会引发任何异常, 因为仓储统计当前分配的issue数量并且返回`1`. +* `issue.AssignedUserId.ShouldBe(userId);` 行检查`AssignedUserId`的值是否正确. +* `await fakeRepo.Received(1).GetIssueCountOfUserAsync(userId);` 检查 `IssueManager` 实际只调用了 `GetIssueCountOfUserAsync` 方法一次. + +让我们添加第二个测试, 看看它是否能阻止将issue分配给超过分配数量的用户: + +````csharp +[Fact] +public async Task Should_Not_Allow_To_Assign_Issues_Over_The_Limit() +{ + // Arrange + + var userId = Guid.NewGuid(); + + var fakeRepo = Substitute.For(); + fakeRepo + .GetIssueCountOfUserAsync(userId) + .Returns(IssueManager.MaxAllowedOpenIssueCountForAUser); + + var issueManager = new IssueManager(fakeRepo); + + // Act & Assert + + var issue = new Issue(); + + await Assert.ThrowsAsync(async () => + { + await issueManager.AssignToUserAsync(issue, userId); + }); + + issue.AssignedUserId.ShouldBeNull(); + await fakeRepo.Received(1).GetIssueCountOfUserAsync(userId); +} +```` + +> 有关模拟的更多信息, 请参阅[NSubstitute](https://nsubstitute.github.io/)文档. + +模拟单个依赖项相对容易. 但是, 当依赖关系增长时, 设置测试对象和模拟所有依赖关系变得越来越困难. 请参阅不需要模拟依赖项的*Integration Tests*部分. + +### 提示: 共享测试类构造函数 + +[xUnit](https://xunit.net/) 为每个测试方法创建一个**新测试类实例**(本例中为`IssueManager_Tests`). 因此, 你可以将一些*Arrange*代码移动到构造函数中, 以减少代码重复. 构造函数将针对每个测试用例执行, 并且不会相互影响, 即使它们是并行工作. + +**示例: 重构`IssueManager_Tests`以减少代码重复** + +````csharp +using System; +using System.Threading.Tasks; +using NSubstitute; +using Shouldly; +using Volo.Abp; +using Xunit; + +namespace MyProject.Issues +{ + public class IssueManager_Tests + { + private readonly Guid _userId; + private readonly IIssueRepository _fakeRepo; + private readonly IssueManager _issueManager; + private readonly Issue _issue; + + public IssueManager_Tests() + { + _userId = Guid.NewGuid(); + _fakeRepo = Substitute.For(); + _issueManager = new IssueManager(_fakeRepo); + _issue = new Issue(); + } + + [Fact] + public async Task Should_Assign_An_Issue_To_A_User() + { + // Arrange + _fakeRepo.GetIssueCountOfUserAsync(_userId).Returns(1); + + // Act + await _issueManager.AssignToUserAsync(_issue, _userId); + + //Assert + _issue.AssignedUserId.ShouldBe(_userId); + await _fakeRepo.Received(1).GetIssueCountOfUserAsync(_userId); + } + + [Fact] + public async Task Should_Not_Allow_To_Assign_Issues_Over_The_Limit() + { + // Arrange + _fakeRepo + .GetIssueCountOfUserAsync(_userId) + .Returns(IssueManager.MaxAllowedOpenIssueCountForAUser); + + // Act & Assert + await Assert.ThrowsAsync(async () => + { + await _issueManager.AssignToUserAsync(_issue, _userId); + }); + + _issue.AssignedUserId.ShouldBeNull(); + await _fakeRepo.Received(1).GetIssueCountOfUserAsync(_userId); + } + } +} +```` + +> 保持测试代码整洁, 以创建可维护的测试组件. + +## 集成测试 + +> 你还可以按照[Web应用程序开发教程](Tutorials/Part-1.md)学习开发全栈应用程序, 包括集成测试. + +### 集成测试基础 + +ABP为编写集成测试提供了完整的基础设施. 所有ABP基础设施和服务都将在你的测试中执行. 应用程序启动模板附带了为你预先配置的必要基础设施; + +#### 数据库 + +启动模板使用EF Core配置**内存中的SQLite**数据库(对于MongoDB, 它使用[Mongo2Go](https://github.com/Mongo2Go/Mongo2Go)). 因此, 所有配置和查询都是针对真实数据库执行的, 你甚至可以测试数据库事务. + +使用内存中的SQLite数据库有两个主要优点: + +* 它比外部DBMS更快. +* 它会为每个测试用例创建一个**新的数据库**, 这样测试就不会相互影响. + +> **提示**: 不要将EF Core的内存数据库用于高级集成测试. 它不是一个真正的DBMS, 在细节上有很多不同. 例如, 它不支持事务和回滚场景, 因此无法真正测试失败的场景. 另一方面, 内存中的SQLite是一个真正的DBMS, 支持SQL数据库的基本功能. + +### 种子数据 + +针对空数据库编写测试是不现实的. 在大多数情况下, 需要在数据库中保存一些初始数据. 例如, 如果你编写了一个查询、更新和删除产品的测试类, 那么在执行测试用例之前, 在数据库中有一些产品数据会很有帮助. + +ABP的[种子数据](Data-Seeding.md)系统是一种强大的初始化数据的方法. 应用程序启动模板在`.TestBase`项目中有一个*YourProject*TestDataSeedContributor类. 你可以在其中添加, 以获得可用于每个测试方法的初始数据. + +**示例: 创建一些Issue作为种子数据** + +````csharp +using System.Threading.Tasks; +using MyProject.Issues; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace MyProject +{ + public class MyProjectTestDataSeedContributor + : IDataSeedContributor, ITransientDependency + { + private readonly IIssueRepository _issueRepository; + + public MyProjectTestDataSeedContributor(IIssueRepository issueRepository) + { + _issueRepository = issueRepository; + } + + public async Task SeedAsync(DataSeedContext context) + { + await _issueRepository.InsertAsync( + new Issue + { + Title = "Test issue one", + Description = "Test issue one description", + AssignedUserId = TestData.User1Id + }); + + await _issueRepository.InsertAsync( + new Issue + { + Title = "Test issue two", + Description = "Test issue two description", + AssignedUserId = TestData.User1Id + }); + + await _issueRepository.InsertAsync( + new Issue + { + Title = "Test issue three", + Description = "Test issue three description", + AssignedUserId = TestData.User1Id + }); + + await _issueRepository.InsertAsync( + new Issue + { + Title = "Test issue four", + Description = "Test issue four description", + AssignedUserId = TestData.User2Id + }); + } + } +} +```` + +还创建了一个静态类来存储用户的 `Id`: + +````csharp +using System; + +namespace MyProject +{ + public static class TestData + { + public static Guid User1Id = Guid.Parse("41951813-5CF9-4204-8B18-CD765DBCBC9B"); + public static Guid User2Id = Guid.Parse("2DAB4460-C21B-4925-BF41-A52750A9B999"); + } +} +```` + +通过这种方式, 我们可以使用这些已知Issue和用户的`Id`来运行测试. + +### 示例: 测试领域服务 + +`AbpIntegratedTest`类 (定义在[Volo.Abp.TestBase](https://www.nuget.org/packages/Volo.Abp.TestBase)) 用于编写集成到ABP框架的测试. `T`是用于设置和初始化应用程序的根模块的类型. + +应用程序启动模板在每个测试项目中都有基类, 因此你可以从这些基类派生, 以使其更简单. + +`IssueManager`测试将被重写成集成测试 + +````csharp +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp; +using Xunit; + +namespace MyProject.Issues +{ + public class IssueManager_Integration_Tests : MyProjectDomainTestBase + { + private readonly IssueManager _issueManager; + private readonly Issue _issue; + + public IssueManager_Integration_Tests() + { + _issueManager = GetRequiredService(); + _issue = new Issue + { + Title = "Test title", + Description = "Test description" + }; + } + + [Fact] + public async Task Should_Not_Allow_To_Assign_Issues_Over_The_Limit() + { + // Act & Assert + await Assert.ThrowsAsync(async () => + { + await _issueManager.AssignToUserAsync(_issue, TestData.User1Id); + }); + + _issue.AssignedUserId.ShouldBeNull(); + } + + [Fact] + public async Task Should_Assign_An_Issue_To_A_User() + { + // Act + await _issueManager.AssignToUserAsync(_issue, TestData.User2Id); + + //Assert + _issue.AssignedUserId.ShouldBe(TestData.User2Id); + } + } +} +```` + +* 第一个测试方法将issue分配给User1, 其中User1已经分配了种子数据代码中的3个issue. 因此, 它抛出了一个`BusinessException`. +* 第二种测试方法将issue分配给User2, User2只分配了一个issue. 因此, 该方法成功了. + +这个类通常位于`.Domain.Tests`项目中, 因为它测试位于`.Domain`项目中的类. 它派生自`MyProjectDomainTestBase`, 并已经为正确运行测试进行了配置. + +编写这样一个集成测试类非常简单. 另一个好处是, 在以后向`IssueManager`类添加另一个依赖项时, 不需要更改测试类. + +### 示例: 测试应用服务 + +测试[应用服务](Application-Services.md)并没有太大的不同. 假设你已经创建了一个`IssueAppService`, 定义如下: + +````csharp +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace MyProject.Issues +{ + public class IssueAppService : ApplicationService, IIssueAppService + { + private readonly IIssueRepository _issueRepository; + + public IssueAppService(IIssueRepository issueRepository) + { + _issueRepository = issueRepository; + } + + public async Task> GetListAsync() + { + var issues = await _issueRepository.GetListAsync(); + + return ObjectMapper.Map, List>(issues); + } + } +} +```` + +*(假设你还定义了`IIssueAppService`和`IssueDto`, 并在`Issue`和`IssueDto`之间创建了[对象映射](Object-To-Object-Mapping.md))* + +现在, 你可以在`.Application.Tests`项目中编写一个测试类: + +````csharp +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace MyProject.Issues +{ + public class IssueAppService_Tests : MyProjectApplicationTestBase + { + private readonly IIssueAppService _issueAppService; + + public IssueAppService_Tests() + { + _issueAppService = GetRequiredService(); + } + + [Fact] + public async Task Should_Get_All_Issues() + { + //Act + var issueDtos = await _issueAppService.GetListAsync(); + + //Assert + issueDtos.Count.ShouldBeGreaterThan(0); + } + } +} +```` + +就这么简单. 此测试方法测试的所有内容, 包括应用服务、EF Core映射、对象到对象映射和仓储实现. 通过这种方式, 你可以完全测试解决方案的应用层和领域层. + +### 处理集成测试中的工作单元 + +ABP的[工作单元](Unit-Of-Work.md)系统控制应用程序中的数据库连接和事务管理. 它可以在你编写应用程序代码时无缝工作, 因此你可能没有意识到它. + +在ABP框架中, 所有数据库操作都必须在一个工作单元作用域内执行. 当你测试[应用服务](Application-Services.md)方法时, 工作单元的作用域将是应用服务方法的作用域. 如果你正在测试[仓储](Repositories.md)方法, 那么工作单元作用域将是你的仓储方法的作用域. + +在某些情况下, 你可能需要手动控制工作单元作用域. 可以考虑下面的测试方法: + +````csharp +public class IssueRepository_Tests : MyProjectDomainTestBase +{ + private readonly IRepository _issueRepository; + + public IssueRepository_Tests() + { + _issueRepository = GetRequiredService>(); + } + + public async Task Should_Query_By_Title() + { + IQueryable queryable = await _issueRepository.GetQueryableAsync(); + var issue = queryable.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + } +} +```` + +我们正在使用`_issueRepository.GetQueryableAsync`获取`IQueryable` 对象. 然后, 我们使用`FirstOrDefaultAsync`方法按标题查询issue. 此时执行数据库查询, 你将会得到一个异常, 表明没有起作用的工作单元. + +要使该测试正常工作, 你应该手动启动工作单元作用域, 如下所示: + +````csharp +public class IssueRepository_Tests : MyProjectDomainTestBase +{ + private readonly IRepository _issueRepository; + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public IssueRepository_Tests() + { + _issueRepository = GetRequiredService>(); + _unitOfWorkManager = GetRequiredService(); + } + + public async Task Should_Query_By_Title() + { + using (var uow = _unitOfWorkManager.Begin()) + { + IQueryable queryable = await _issueRepository.GetQueryableAsync(); + var issue = queryable.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + await uow.CompleteAsync(); + } + } +} +```` + +我们已经使用了`IUnitOfWorkManager`服务来创建一个工作单元作用域, 然后在该作用域内调用了`FirstOrDefaultAsync`方法, 所以不再有问题了. + +> 请注意, 我们测试了`FirstOrDefaultAsync`来演示工作单元的问题. 作为一个好的标准, 编写自己的代码. + +### 使用DbContext + +在某些情况下, 你可能希望使用Entity Framework的`DbContext`对象来执行测试方法中的数据库操作. 在这种情况下, 可以使用`IDbContextProvider`服务在工作单元内获取`DbContext`实例. + +下面的示例展示了如何在测试方法中创建`DbContext`对象: + +````csharp +public class MyDbContext_Tests : MyProjectDomainTestBase +{ + private readonly IDbContextProvider _dbContextProvider; + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public IssueRepository_Tests() + { + _dbContextProvider = GetRequiredService>(); + _unitOfWorkManager = GetRequiredService(); + } + + public async Task Should_Query_By_Title() + { + using (var uow = _unitOfWorkManager.Begin()) + { + var dbContext = await _dbContextProvider.GetDbContextAsync(); + var issue = await dbContext.Issues.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + await uow.CompleteAsync(); + } + } +} +```` + +就像我们在*集成测试中处理工作单元*一节中所做的那样, 我们应该在起作用的工作单元内执行`DbContext`操作. + +对于[MongoDB](MongoDB.md), 你可以使用`IMongoDbContextProvider`服务获取`DbContext`对象, 并在测试方法中直接使用MongoDB APIs. + +## 用户界面测试 + +一般来说, 有两种类型的UI测试: + +### 非可视化测试 + +此类测试完全取决于UI框架的选择: + +* 对于MVC / Razor页面UI, 通常向服务器发出请求, 获取HTML, 并测试返回的结果中是否存在一些预期的DOM元素. +* Angular有自己的基础设施和实践来测试组件、视图和服务. + +请参阅以下文档以了解非可视化UI测试: + +* [Testing in ASP.NET Core MVC / Razor Pages](UI/AspNetCore/Testing.md) +* [Testing in Angular](UI/Angular/Testing.md) +* [Testing in Blazor](UI/Blazor/Testing.md) + +### 可视化测试 + +与真实用户一样, 可视化测试用于与应用程序UI交互. 它全面测试应用程序, 包括页面和组件的外观. + +可视化UI测试超出了ABP框架的范围. 行业中有很多工具(比如[Selenium](https://www.selenium.dev/))可以用来测试应用程序的UI. diff --git a/docs/zh-Hans/UI/Angular/Testing.md b/docs/zh-Hans/UI/Angular/Testing.md new file mode 100644 index 0000000000..c176d82247 --- /dev/null +++ b/docs/zh-Hans/UI/Angular/Testing.md @@ -0,0 +1,380 @@ +# Angular UI 单元测试 + +ABP Angular UI的测试与其他Angular应用程序一样. 所以, [这里的指南](https://angular.io/guide/testing)也适用于ABP. 也就是说, 我们想指出一些**特定于ABP Angular应用程序的单元测试内容**. + +## 设置 + +在Angular中, 单元测试默认使用[Karma](https://karma-runner.github.io/)和[Jasmine](https://jasmine.github.io). 虽然我们更喜欢Jest, 但我们选择不偏离这些默认设置, 因此**你下载的应用程序模板将预先配置Karma和Jasmine**. 你可以在根目录中的 _karma.conf.js_ 文件中找到Karma配置. 你什么都不用做. 添加一个spec文件并运行`npm test`即可. + +## 基础 + +简化版的spec文件如下所示: + +```js +import { CoreTestingModule } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { MyComponent } from "./my.component"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [MyComponent], + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + ], + }).compileComponents(); + }) + ); + + beforeEach(() => { + fixture = TestBed.createComponent(MyComponent); + fixture.detectChanges(); + }); + + it("should be initiated", () => { + expect(fixture.componentInstance).toBeTruthy(); + }); +}); +``` + +如果你看一下导入内容, 你会注意到我们已经准备了一些测试模块来取代内置的ABP模块. 这对于模拟某些特性是必要的, 否则这些特性会破坏你的测试. 请记住**使用测试模块**并**调用其`withConfig`静态方法**. + +## 提示 + +### Angular测试库 + +虽然你可以使用Angular TestBed测试代码, 但你可以找到一个好的替代品[Angular测试库](https://testing-library.com/docs/angular-testing-library/intro). + +上面的简单示例可以用Angular测试库编写, 如下所示: + +```js +import { CoreTestingModule } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture } from "@angular/core/testing"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { render } from "@testing-library/angular"; +import { MyComponent } from "./my.component"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + beforeEach(async () => { + const result = await render(MyComponent, { + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + ], + providers: [ + /* mock providers here */ + ], + }); + + fixture = result.fixture; + }); + + it("should be initiated", () => { + expect(fixture.componentInstance).toBeTruthy(); + }); +}); +``` + +正如你所见, 二者非常相似. 当我们使用查询和触发事件时, 真正的区别就显现出来了. + +```js +// other imports +import { getByLabelText, screen } from "@testing-library/angular"; +import userEvent from "@testing-library/user-event"; + +describe("MyComponent", () => { + beforeEach(/* removed for sake of brevity */); + + it("should display advanced filters", () => { + const filters = screen.getByTestId("author-filters"); + const nameInput = getByLabelText(filters, /name/i) as HTMLInputElement; + expect(nameInput.offsetWidth).toBe(0); + + const advancedFiltersBtn = screen.getByRole("link", { name: /advanced/i }); + userEvent.click(advancedFiltersBtn); + + expect(nameInput.offsetWidth).toBeGreaterThan(0); + + userEvent.type(nameInput, "fooo{backspace}"); + expect(nameInput.value).toBe("foo"); + }); +}); +``` + +**Angular测试库中的查询遵循可维护测试**, 用户事件库提供了与DOM的**类人交互**, 并且该库通常有**清晰的API**简化组件测试. 下面提供一些有用的链接: + +- [查询](https://testing-library.com/docs/dom-testing-library/api-queries) +- [用户事件](https://testing-library.com/docs/ecosystem-user-event) +- [范例](https://github.com/testing-library/angular-testing-library/tree/main/apps/example-app/src/app/examples) + +### 在每个Spec之后清除DOM + +需要记住的一点是, Karma在真实的浏览器实例中运行测试. 这意味着, 你将能够看到测试代码的结果, 但也会遇到与文档正文连接的组件的问题, 这些组件可能无法在每次测试后都清除, 即使你配置了Karma也一样无法清除. + +我们准备了一个简单的函数, 可以在每次测试后清除所有剩余的DOM元素. + +```js +// other imports +import { clearPage } from "@abp/ng.core/testing"; + +describe("MyComponent", () => { + let fixture: ComponentFixture; + + afterEach(() => clearPage(fixture)); + + beforeEach(async () => { + const result = await render(MyComponent, { + /* removed for sake of brevity */ + }); + fixture = result.fixture; + }); + + // specs here +}); +``` + +请确保你使用它, 否则Karma将无法删除对话框, 并且你将有多个模态对话框、确认框等的副本. + +### 等待 + +一些组件, 特别是在检测周期之外工作的模态对话框. 换句话说, 你无法在打开这些组件后立即访问这些组件插入的DOM元素. 同样, 插入的元素在关闭时也不会立即销毁. + +为此, 我们准备了一个`wait`函数. + +```js +// other imports +import { wait } from "@abp/ng.core/testing"; + +describe("MyComponent", () => { + beforeEach(/* removed for sake of brevity */); + + it("should open a modal", async () => { + const openModalBtn = screen.getByRole("button", { name: "Open Modal" }); + userEvent.click(openModalBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + + expect(modal).toBeTruthy(); + + /* wait again after closing the modal */ + }); +}); +``` + +`wait`函数接受第二个参数, 即超时(默认值为`0`). 但是尽量不要使用它. 使用大于`0`的超时通常表明某些不正确事情发生了. + +## 测试示例 + +下面是一个测试示例. 它并没有涵盖所有内容, 但却能够对测试有一个更好的了解. + +```js +import { clearPage, CoreTestingModule, wait } from "@abp/ng.core/testing"; +import { ThemeBasicTestingModule } from "@abp/ng.theme.basic/testing"; +import { ThemeSharedTestingModule } from "@abp/ng.theme.shared/testing"; +import { ComponentFixture } from "@angular/core/testing"; +import { + NgbCollapseModule, + NgbDatepickerModule, + NgbDropdownModule, +} from "@ng-bootstrap/ng-bootstrap"; +import { NgxValidateCoreModule } from "@ngx-validate/core"; +import { CountryService } from "@proxy/countries"; +import { + findByText, + getByLabelText, + getByRole, + getByText, + queryByRole, + render, + screen, +} from "@testing-library/angular"; +import userEvent from "@testing-library/user-event"; +import { BehaviorSubject, of } from "rxjs"; +import { CountryComponent } from "./country.component"; + +const list$ = new BehaviorSubject({ + items: [{ id: "ID_US", name: "United States of America" }], + totalCount: 1, +}); + +describe("Country", () => { + let fixture: ComponentFixture; + + afterEach(() => clearPage(fixture)); + + beforeEach(async () => { + const result = await render(CountryComponent, { + imports: [ + CoreTestingModule.withConfig(), + ThemeSharedTestingModule.withConfig(), + ThemeBasicTestingModule.withConfig(), + NgxValidateCoreModule, + NgbCollapseModule, + NgbDatepickerModule, + NgbDropdownModule, + ], + providers: [ + { + provide: CountryService, + useValue: { + getList: () => list$, + }, + }, + ], + }); + + fixture = result.fixture; + }); + + it("should display advanced filters", () => { + const filters = screen.getByTestId("country-filters"); + const nameInput = getByLabelText(filters, /name/i) as HTMLInputElement; + expect(nameInput.offsetWidth).toBe(0); + + const advancedFiltersBtn = screen.getByRole("link", { name: /advanced/i }); + userEvent.click(advancedFiltersBtn); + + expect(nameInput.offsetWidth).toBeGreaterThan(0); + + userEvent.type(nameInput, "fooo{backspace}"); + expect(nameInput.value).toBe("foo"); + + userEvent.click(advancedFiltersBtn); + expect(nameInput.offsetWidth).toBe(0); + }); + + it("should have a heading", () => { + const heading = screen.getByRole("heading", { name: "Countries" }); + expect(heading).toBeTruthy(); + }); + + it("should render list in table", async () => { + const table = await screen.findByTestId("country-table"); + + const name = getByText(table, "United States of America"); + expect(name).toBeTruthy(); + }); + + it("should display edit modal", async () => { + const actionsBtn = screen.queryByRole("button", { name: /actions/i }); + userEvent.click(actionsBtn); + + const editBtn = screen.getByRole("button", { name: /edit/i }); + userEvent.click(editBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const modalHeading = queryByRole(modal, "heading", { name: /edit/i }); + expect(modalHeading).toBeTruthy(); + + const closeBtn = getByText(modal, "×"); + userEvent.click(closeBtn); + + await wait(fixture); + + expect(screen.queryByRole("dialog")).toBeFalsy(); + }); + + it("should display create modal", async () => { + const newBtn = screen.getByRole("button", { name: /new/i }); + userEvent.click(newBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const modalHeading = queryByRole(modal, "heading", { name: /new/i }); + + expect(modalHeading).toBeTruthy(); + }); + + it("should validate required name field", async () => { + const newBtn = screen.getByRole("button", { name: /new/i }); + userEvent.click(newBtn); + + await wait(fixture); + + const modal = screen.getByRole("dialog"); + const nameInput = getByRole(modal, "textbox", { + name: /^name/i, + }) as HTMLInputElement; + + userEvent.type(nameInput, "x"); + userEvent.type(nameInput, "{backspace}"); + + const nameError = await findByText(modal, /required/i); + expect(nameError).toBeTruthy(); + }); + + it("should delete a country", () => { + const getSpy = spyOn(fixture.componentInstance.list, "get"); + const deleteSpy = jasmine.createSpy().and.returnValue(of(null)); + fixture.componentInstance.service.delete = deleteSpy; + + const actionsBtn = screen.queryByRole("button", { name: /actions/i }); + userEvent.click(actionsBtn); + + const deleteBtn = screen.getByRole("button", { name: /delete/i }); + userEvent.click(deleteBtn); + + const confirmText = screen.getByText("AreYouSure"); + expect(confirmText).toBeTruthy(); + + const confirmBtn = screen.getByRole("button", { name: "Yes" }); + userEvent.click(confirmBtn); + + expect(deleteSpy).toHaveBeenCalledWith(list$.value.items[0].id); + expect(getSpy).toHaveBeenCalledTimes(1); + }); +}); +``` + +## CI配置 + +你的CI环境需要不同的配置. 要为单元测试设置新的配置, 请在测试项目中找到 _angular.json_ 文件, 或者如下所示添加一个: + +```json +// angular.json + +"test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { /* several options here */ }, + "configurations": { + "production": { + "karmaConfig": "karma.conf.prod.js" + } + } +} +``` + +现在你可以复制 _karma.conf.js_ 作为 _karma.conf.prod.js_ 并在其中使用你喜欢的任何配置. 请查看[Karma配置文档](http://karma-runner.github.io/5.2/config/configuration-file.html)配置选项. + +最后, 不要忘记使用以下命令运行CI测试: + +```sh +npm test -- --prod +``` + +## 另请参阅 + +- [ABP Community Video - Unit Testing with the Angular UI](https://community.abp.io/articles/unit-testing-with-the-angular-ui-p4l550q3) diff --git a/docs/zh-Hans/UI/AspNetCore/Testing.md b/docs/zh-Hans/UI/AspNetCore/Testing.md new file mode 100644 index 0000000000..e5b09353fb --- /dev/null +++ b/docs/zh-Hans/UI/AspNetCore/Testing.md @@ -0,0 +1,220 @@ +# ASP.NET Core MVC / Razor Pages: 测试 + +> 你可以参考[ASP.NET Core集成测试文档](https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests)了解ASP.NET Core集成测试的详细内容. 本文档解释了ABP框架提供的附加测试基础设施. + +## 应用程序启动模板 + +应用程序启动模板的`.Web`项目其中包含应用程序的UI视图/页面/组件, 并提供`.Web.Tests`项目来测试这些内容. + +![aspnetcore-web-tests-in-solution](../../images/aspnetcore-web-tests-in-solution.png) + +## 测试Razor页面 + +假设你已经创建了一个名为`Issues.cshtml`的Razor页面, 包含以下内容; + +**Issues.cshtml.cs** + +````csharp +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.RazorPages; +using MyProject.Issues; + +namespace MyProject.Web.Pages +{ + public class IssuesModel : PageModel + { + public List Issues { get; set; } + + private readonly IIssueAppService _issueAppService; + + public IssuesModel(IIssueAppService issueAppService) + { + _issueAppService = issueAppService; + } + + public async Task OnGetAsync() + { + Issues = await _issueAppService.GetListAsync(); + } + } +} +```` + +**Issues.cshtml** + +````html +@page +@model MyProject.Web.Pages.IssuesModel +

Issue List

+ + + + + + + + + @foreach (var issue in Model.Issues) + { + + + + + } + +
IssueClosed?
@issue.Title + @if (issue.IsClosed) + { + Closed + } + else + { + Open + } +
+```` + +本页仅创建一个包含issue的表格: + +![issue-list](../../images/issue-list.png) + +你可以在`.Web.Tests`项目中编写一个测试类如下所示: + +````csharp +using System.Threading.Tasks; +using HtmlAgilityPack; +using Shouldly; +using Xunit; + +namespace MyProject.Pages +{ + public class Issues_Tests : MyProjectWebTestBase + { + [Fact] + public async Task Should_Get_Table_Of_Issues() + { + // Act + + var response = await GetResponseAsStringAsync("/Issues"); + + //Assert + + var htmlDocument = new HtmlDocument(); + htmlDocument.LoadHtml(response); + + var tableElement = htmlDocument.GetElementbyId("IssueTable"); + tableElement.ShouldNotBeNull(); + + var trNodes = tableElement.SelectNodes("//tbody/tr"); + trNodes.Count.ShouldBeGreaterThan(0); + } + } +} +```` + +`GetResponseAsStringAsync`是一个快捷方法, 它来自执行HTTP GET请求的基类, 检查生成的HTTP状态是否为`200`, 并将响应作为`string`返回. + +> 你可以使用`Client`对象(类型为`HttpClient`)对服务器执行任何类型的请求, 并读取响应.`GetResponseAsStringAsync`只是一种快捷方法. + +本例使用[HtmlAgilityPack](https://html-agility-pack.net/)库来解析传入的HTML并测试它是否包含issue表格. + +> 本例假设的数据库中存在一些初始issue. 请参阅[测试文档](../../Testing.md)的*种子数据*部分, 了解如何设置种子数据, 以便可以假定数据库中有一些可用的初始数据. + +## 控制器测试 + +测试控制器也不例外. 只需使用正确的URL向服务器执行请求, 获取响应并做出断言. + +### 查看结果 + +如果控制器返回一个视图, 你可以使用类似的代码来测试返回的HTML. 参见上面的Razor页面示例. + +### 对象结果 + +如果控制器返回对象结果, 则可以使用`GetResponseAsObjectAsync`方法. + +假设你有一个如下定义的控制器: + +````csharp +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using MyProject.Issues; +using Volo.Abp.AspNetCore.Mvc; + +namespace MyProject.Web.Controllers +{ + [Route("api/issues")] + public class IssueController : AbpController + { + private readonly IIssueAppService _issueAppService; + + public IssueController(IIssueAppService issueAppService) + { + _issueAppService = issueAppService; + } + + [HttpGet] + public async Task> GetAsync() + { + return await _issueAppService.GetListAsync(); + } + } +} +```` + +你可以编写测试代码来调用API并获得结果: + +````csharp +using System.Collections.Generic; +using System.Threading.Tasks; +using MyProject.Issues; +using Shouldly; +using Xunit; + +namespace MyProject.Pages +{ + public class Issues_Tests : MyProjectWebTestBase + { + [Fact] + public async Task Should_Get_Issues_From_Api() + { + var issues = await GetResponseAsObjectAsync>("/api/issues"); + + issues.ShouldNotBeNull(); + issues.Count.ShouldBeGreaterThan(0); + } + } +} +```` + +## 测试JavaScript代码 + +ABP框架不提供任何基础设施来测试JavaScript代码. 你可以使用任何测试框架和工具来测试JavaScript代码. + +## 测试基础设施 + +[Volo.Abp.AspNetCore.TestBase](https://www.nuget.org/packages/Volo.Abp.AspNetCore.TestBase) 提供了集成到ABP框架和ASP.NET Core的测试基础设施. + +> Volo.Abp.AspNetCore.TestBase 已经安装在 `.Web.Tests` 项目中. + +此包提供的`AbpAspNetCoreIntegratedTestBase`作为派生测试类的基类. 上面使用的`MyProjectWebTestBase`继承自`AbpAspNetCoreIntegratedTestBase`, 因此我们间接继承了`AbpAspNetCoreIntegratedTestBase`. + +### 基本属性 + +`AbpAspNetCoreIntegratedTestBase` 提供了测试中使用的以下基本属性: + +* `Server`: 在测试中托管web应用程序的`TestServer`实例. +* `Client`: 为执行对测试服务器的请求配置`HttpClient`实例. +* `ServiceProvider`: 可以在你需要时处理服务提供服务. + +### 基本方法 + +`AbpAspNetCoreIntegratedTestBase` 提供了以下方法, 如果需要自定义测试服务器, 可以重写这些方法: + +* `ConfigureServices` 仅为派生测试类注册/替换服务时可以重写使用. +* `CreateHostBuilder` 可用于自定义生成 `IHostBuilder`. + +另请参阅 + +* [总览/服务器端测试](../../Testing.md) diff --git a/docs/zh-Hans/docs-nav.json b/docs/zh-Hans/docs-nav.json index db0fc10aed..fa38a203d0 100644 --- a/docs/zh-Hans/docs-nav.json +++ b/docs/zh-Hans/docs-nav.json @@ -515,6 +515,10 @@ "text": "自定义/扩展UI", "path": "UI/AspNetCore/Customization-User-Interface.md" }, + { + "text": "测试", + "path": "UI/AspNetCore/Testing.md" + }, { "text": "主题化", "path": "UI/AspNetCore/Theming.md" @@ -536,6 +540,10 @@ "text": "服务代理", "path": "UI/Angular/Service-Proxies.md" }, + { + "text": "单元测试", + "path": "UI/Angular/Testing.md" + }, { "text": "HTTP请求", "path": "UI/Angular/HTTP-Requests.md" @@ -682,6 +690,10 @@ } ] }, + { + "text": "测试", + "path": "Testing.md" + }, { "text": "示例", "items": [ diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index f3e495c814..94a2e79415 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -403,6 +403,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.DistributedLocking EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.BackgroundWorkers.Hangfire", "src\Volo.Abp.BackgroundWorkers.Hangfire\Volo.Abp.BackgroundWorkers.Hangfire.csproj", "{E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Gdpr.Abstractions", "src\Volo.Abp.Gdpr.Abstractions\Volo.Abp.Gdpr.Abstractions.csproj", "{3683340D-92F5-4B14-B77B-34A163333309}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1201,6 +1203,10 @@ Global {E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB}.Release|Any CPU.Build.0 = Release|Any CPU + {3683340D-92F5-4B14-B77B-34A163333309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3683340D-92F5-4B14-B77B-34A163333309}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3683340D-92F5-4B14-B77B-34A163333309}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3683340D-92F5-4B14-B77B-34A163333309}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1404,6 +1410,7 @@ Global {CA805B77-D50C-431F-B3CB-1111C9C6E807} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {C4F54FB5-C828-414D-BA03-E8E7A10C784D} = {447C8A77-E5F0-4538-8687-7383196D04EA} {E5FCE710-C5A3-4F94-B9C9-BD1E99252BFB} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {3683340D-92F5-4B14-B77B-34A163333309} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs index 01dc489c54..2aedea2608 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs @@ -13,6 +13,20 @@ public static class AbpClaimActionCollectionExtensions claimActions.DeleteClaim("name"); claimActions.RemoveDuplicate(AbpClaimTypes.UserName); } + + if (AbpClaimTypes.Name != "given_name") + { + claimActions.MapJsonKey(AbpClaimTypes.Name, "given_name"); + claimActions.DeleteClaim("given_name"); + claimActions.RemoveDuplicate(AbpClaimTypes.Name); + } + + if (AbpClaimTypes.SurName != "family_name") + { + claimActions.MapJsonKey(AbpClaimTypes.SurName, "family_name"); + claimActions.DeleteClaim("family_name"); + claimActions.RemoveDuplicate(AbpClaimTypes.SurName); + } if (AbpClaimTypes.Email != "email") { diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs index 02b292a984..894ba470a8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs @@ -57,8 +57,7 @@ public static class AbpOpenIdConnectExtensions if (receivedContext.Request.Cookies.ContainsKey(tenantKey)) { - receivedContext.TokenEndpointRequest.SetParameter(tenantKey, - receivedContext.Request.Cookies[tenantKey]); + receivedContext.TokenEndpointRequest?.SetParameter(tenantKey, receivedContext.Request.Cookies[tenantKey]); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor index e6959f1d3a..c9c704b471 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor @@ -7,7 +7,7 @@ @if(Options.Value.RenderPageTitle) { -

@PageLayout.Title

+
@PageLayout.Title
} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationDto.cs index 9b6a66992f..eb29c5c7cb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationDto.cs @@ -17,6 +17,8 @@ public class ApplicationConfigurationDto public ApplicationFeatureConfigurationDto Features { get; set; } + public ApplicationGlobalFeatureConfigurationDto GlobalFeatures { get; set; } + public MultiTenancyInfoDto MultiTenancy { get; set; } public CurrentTenantDto CurrentTenant { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationGlobalFeatureConfigurationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationGlobalFeatureConfigurationDto.cs new file mode 100644 index 0000000000..e911cd911d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationGlobalFeatureConfigurationDto.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +[Serializable] +public class ApplicationGlobalFeatureConfigurationDto +{ + public HashSet EnabledFeatures { get; set; } + + public Dictionary> ModuleEnabledFeatures { get; set; } + + public ApplicationGlobalFeatureConfigurationDto() + { + EnabledFeatures = new HashSet(); + ModuleEnabledFeatures = new Dictionary>(); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs index bf370840a9..92bfc9ddb3 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs @@ -268,7 +268,6 @@ public class AbpInputTagHelperService : AbpTagHelperService } var label = new TagBuilder("label"); - label.AddCssClass("form-label"); label.Attributes.Add("for", GetIdAttributeValue(inputTag)); label.InnerHtml.AppendHtml(TagHelper.Label); @@ -291,15 +290,10 @@ public class AbpInputTagHelperService : AbpTagHelperService { if (IsOutputHidden(inputTag)) { - return ""; - } - - if (isCheckbox) - { - return ""; + return string.Empty; } - var text = ""; + string text; if (!string.IsNullOrEmpty(TagHelper.InfoText)) { @@ -314,7 +308,7 @@ public class AbpInputTagHelperService : AbpTagHelperService } else { - return ""; + return string.Empty; } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json index 25516ba765..f3259dbb54 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json @@ -1,7 +1,7 @@ { "culture": "en", "texts": { - "GivenTenantIsNotExist": "Given tenant is not exist: {0}", + "GivenTenantIsNotExist": "Given tenant does not exist: {0}", "GivenTenantIsNotAvailable": "Given tenant is not available: {0}", "Tenant": "Tenant", "Switch": "switch", diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index c205e15321..22b919c91c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -36,6 +36,7 @@ using Volo.Abp.Http; using Volo.Abp.DynamicProxy; using Volo.Abp.GlobalFeatures; using Volo.Abp.Http.Modeling; +using Volo.Abp.Http.ProxyScripting.Generators.JQuery; using Volo.Abp.Json; using Volo.Abp.Localization; using Volo.Abp.Modularity; @@ -185,6 +186,11 @@ public class AbpAspNetCoreMvcModule : AbpModule endpointContext.Endpoints.MapRazorPages(); }); }); + + Configure(options => + { + options.DisableModule("abp"); + }); } public override void PostConfigureServices(ServiceConfigurationContext context) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs index 6ecd9fc195..bfa2e6a285 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs @@ -14,6 +14,7 @@ using Volo.Abp.AspNetCore.Mvc.MultiTenancy; using Volo.Abp.Authorization; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Features; +using Volo.Abp.GlobalFeatures; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; using Volo.Abp.Settings; @@ -87,6 +88,7 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp { Auth = await GetAuthConfigAsync(), Features = await GetFeaturesConfigAsync(), + GlobalFeatures = await GetGlobalFeaturesConfigAsync(), Localization = await GetLocalizationConfigAsync(), CurrentUser = GetCurrentUser(), Setting = await GetSettingConfigAsync(), @@ -284,6 +286,24 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp return result; } + protected virtual Task GetGlobalFeaturesConfigAsync() + { + var result = new ApplicationGlobalFeatureConfigurationDto(); + + foreach (var enabledFeatureName in GlobalFeatureManager.Instance.GetEnabledFeatureNames()) + { + result.EnabledFeatures.AddIfNotContains(enabledFeatureName); + } + + foreach (var module in GlobalFeatureManager.Instance.Modules) + { + result.ModuleEnabledFeatures.AddIfNotContains(new KeyValuePair>(module.Key, module.Value.GetFeatures().Select(x => x.FeatureName).ToList())); + } + + return Task.FromResult(result); + } + + protected virtual async Task GetTimingConfigAsync() { var windowsTimeZoneId = await _settingProvider.GetOrNullAsync(TimingSettingNames.TimeZone); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs index f62b16b19b..5c5e7ed6c0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentOutputFormatter.cs @@ -18,13 +18,14 @@ public class RemoteStreamContentOutputFormatter : OutputFormatter return typeof(IRemoteStreamContent).IsAssignableFrom(type); } - public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext context) + public async override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) { var remoteStream = (IRemoteStreamContent)context.Object; if (remoteStream != null) { context.HttpContext.Response.ContentType = remoteStream.ContentType; + context.HttpContext.Response.ContentLength = remoteStream.ContentLength; if (!remoteStream.FileName.IsNullOrWhiteSpace()) { diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs index 91b5019199..d85bad82eb 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs @@ -21,25 +21,25 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency Clock = clock; } - public void SetCreationProperties(object targetObject) + public virtual void SetCreationProperties(object targetObject) { SetCreationTime(targetObject); SetCreatorId(targetObject); } - public void SetModificationProperties(object targetObject) + public virtual void SetModificationProperties(object targetObject) { SetLastModificationTime(targetObject); SetLastModifierId(targetObject); } - public void SetDeletionProperties(object targetObject) + public virtual void SetDeletionProperties(object targetObject) { SetDeletionTime(targetObject); SetDeleterId(targetObject); } - private void SetCreationTime(object targetObject) + protected virtual void SetCreationTime(object targetObject) { if (!(targetObject is IHasCreationTime objectWithCreationTime)) { @@ -52,7 +52,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency } } - private void SetCreatorId(object targetObject) + protected virtual void SetCreatorId(object targetObject) { if (!CurrentUser.Id.HasValue) { @@ -95,7 +95,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency } } - private void SetLastModificationTime(object targetObject) + protected virtual void SetLastModificationTime(object targetObject) { if (targetObject is IHasModificationTime objectWithModificationTime) { @@ -103,7 +103,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency } } - private void SetLastModifierId(object targetObject) + protected virtual void SetLastModifierId(object targetObject) { if (!(targetObject is IModificationAuditedObject modificationAuditedObject)) { @@ -137,7 +137,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency modificationAuditedObject.LastModifierId = CurrentUser.Id; } - private void SetDeletionTime(object targetObject) + protected virtual void SetDeletionTime(object targetObject) { if (targetObject is IHasDeletionTime objectWithDeletionTime) { @@ -148,7 +148,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency } } - private void SetDeleterId(object targetObject) + protected virtual void SetDeleterId(object targetObject) { if (!(targetObject is IDeletionAuditedObject deletionAuditedObject)) { diff --git a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj index 9f028d31ee..32f9da017c 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj +++ b/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Abp.AutoMapper Volo.Abp.AutoMapper $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; @@ -21,7 +21,7 @@ - +
diff --git a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs index 6ed44a6300..18fef842da 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs +++ b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs @@ -1,5 +1,6 @@ using System; using AutoMapper; +using AutoMapper.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Auditing; @@ -49,7 +50,7 @@ public class AbpAutoMapperModule : AbpModule { foreach (var profileType in options.ValidatingProfiles) { - config.AssertConfigurationIsValid(((Profile)Activator.CreateInstance(profileType)).ProfileName); + config.Internal().AssertConfigurationIsValid(((Profile)Activator.CreateInstance(profileType)).ProfileName); } } diff --git a/framework/src/Volo.Abp.AzureServiceBus/Volo/Abp/AzureServiceBus/ConnectionPool.cs b/framework/src/Volo.Abp.AzureServiceBus/Volo/Abp/AzureServiceBus/ConnectionPool.cs index 5f9d9eacfd..d616e1264f 100644 --- a/framework/src/Volo.Abp.AzureServiceBus/Volo/Abp/AzureServiceBus/ConnectionPool.cs +++ b/framework/src/Volo.Abp.AzureServiceBus/Volo/Abp/AzureServiceBus/ConnectionPool.cs @@ -47,7 +47,7 @@ public class ConnectionPool : IConnectionPool, ISingletonDependency connectionName, new Lazy(() => { var config = _options.Connections.GetOrDefault(connectionName); - return new ServiceBusAdministrationClient(config.ConnectionString); + return new ServiceBusAdministrationClient(config.ConnectionString, config.Admin); }) ).Value; } diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerBase.cs b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerBase.cs index 466fbe457f..dfeda11df8 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerBase.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerBase.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace Volo.Abp.BackgroundWorkers.Hangfire; @@ -7,6 +8,16 @@ public abstract class HangfireBackgroundWorkerBase : BackgroundWorkerBase, IHang public string RecurringJobId { get; set; } public string CronExpression { get; set; } + + public TimeZoneInfo TimeZone { get; set; } + + public string Queue { get; set; } public abstract Task DoWorkAsync(); + + protected HangfireBackgroundWorkerBase() + { + TimeZone = null; + Queue = "default"; + } } diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs index 89d6105967..b2cb275dab 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs @@ -40,12 +40,13 @@ public class HangfireBackgroundWorkerManager : IBackgroundWorkerManager, ISingle var unProxyWorker = ProxyHelper.UnProxy(hangfireBackgroundWorker); if (hangfireBackgroundWorker.RecurringJobId.IsNullOrWhiteSpace()) { - RecurringJob.AddOrUpdate(() => ((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(), hangfireBackgroundWorker.CronExpression); + RecurringJob.AddOrUpdate(() => ((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(), + hangfireBackgroundWorker.CronExpression, hangfireBackgroundWorker.TimeZone, hangfireBackgroundWorker.Queue); } else { RecurringJob.AddOrUpdate(hangfireBackgroundWorker.RecurringJobId, () => ((IHangfireBackgroundWorker)unProxyWorker).DoWorkAsync(), - hangfireBackgroundWorker.CronExpression); + hangfireBackgroundWorker.CronExpression, hangfireBackgroundWorker.TimeZone, hangfireBackgroundWorker.Queue); } } else @@ -79,7 +80,7 @@ public class HangfireBackgroundWorkerManager : IBackgroundWorkerManager, ISingle var adapterType = typeof(HangfirePeriodicBackgroundWorkerAdapter<>).MakeGenericType(ProxyHelper.GetUnProxiedType(worker)); var workerAdapter = Activator.CreateInstance(adapterType) as IHangfireBackgroundWorker; - RecurringJob.AddOrUpdate(() => workerAdapter.DoWorkAsync(), GetCron(period.Value)); + RecurringJob.AddOrUpdate(() => workerAdapter.DoWorkAsync(), GetCron(period.Value), workerAdapter.TimeZone, workerAdapter.Queue); } return Task.CompletedTask; diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfirePeriodicBackgroundWorkerAdapter.cs b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfirePeriodicBackgroundWorkerAdapter.cs index 483210ace6..8fe24f10ed 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfirePeriodicBackgroundWorkerAdapter.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfirePeriodicBackgroundWorkerAdapter.cs @@ -17,7 +17,7 @@ public class HangfirePeriodicBackgroundWorkerAdapter : HangfireBackgrou _doWorkMethod = typeof(TWorker).GetMethod("DoWork", BindingFlags.Instance | BindingFlags.NonPublic); } - public override async Task DoWorkAsync() + public async override Task DoWorkAsync() { var workerContext = new PeriodicBackgroundWorkerContext(ServiceProvider); var worker = ServiceProvider.GetRequiredService(); diff --git a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorker.cs b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorker.cs index 0b8c89e95b..7402d8427a 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorker.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorker.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace Volo.Abp.BackgroundWorkers.Hangfire; @@ -7,6 +8,10 @@ public interface IHangfireBackgroundWorker : IBackgroundWorker string RecurringJobId { get; set; } string CronExpression { get; set; } + + TimeZoneInfo TimeZone { get; set; } + + string Queue { get; set; } Task DoWorkAsync(); } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index e7ea795eee..c674ec3612 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -11,6 +11,7 @@ CurrentPage="@CurrentPage" PageSize="@PageSize" Responsive="@Responsive" + Striped Class="@Class"> diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs index f0c8fa8aff..c7fe013b3c 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs @@ -94,6 +94,11 @@ public partial class UiMessageAlert : ComponentBase, IDisposable Options = e.Options; Callback = e.Callback; + await ShowMessageAlert(); + } + + protected virtual async Task ShowMessageAlert() + { await InvokeAsync(ModalRef.Show); } diff --git a/framework/src/Volo.Abp.BlobStoring.Minio/Volo.Abp.BlobStoring.Minio.csproj b/framework/src/Volo.Abp.BlobStoring.Minio/Volo.Abp.BlobStoring.Minio.csproj index 822189c677..a78b131962 100644 --- a/framework/src/Volo.Abp.BlobStoring.Minio/Volo.Abp.BlobStoring.Minio.csproj +++ b/framework/src/Volo.Abp.BlobStoring.Minio/Volo.Abp.BlobStoring.Minio.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + net6.0 Volo.Abp.BlobStoring.Minio Volo.Abp.BlobStoring.Minio $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; @@ -15,7 +15,7 @@ - + diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Args/CommandLineArgumentParser.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Args/CommandLineArgumentParser.cs index ea8541cbb9..1b060a8dbc 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Args/CommandLineArgumentParser.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Args/CommandLineArgumentParser.cs @@ -98,7 +98,7 @@ public class CommandLineArgumentParser : ICommandLineArgumentParser, ITransientD { if (argument.Length <= 1) { - throw new ArgumentException("Should specify an option name after '--' prefix!"); + throw new ArgumentException("Should specify an option name after '-' prefix!"); } return argument.RemovePreFix("-"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index c244abd719..526ae77363 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -10,7 +10,9 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Commands.Services; +using Volo.Abp.Cli.LIbs; using Volo.Abp.Cli.ProjectBuilding; +using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectModification; using Volo.Abp.Cli.Utils; using Volo.Abp.DependencyInjection; @@ -21,8 +23,6 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien { public const string Name = "new"; - public ILogger Logger { get; set; } - protected TemplateProjectBuilder TemplateProjectBuilder { get; } public ITemplateInfoProvider TemplateInfoProvider { get; } @@ -30,13 +30,13 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien , ITemplateInfoProvider templateInfoProvider, ConnectionStringProvider connectionStringProvider, SolutionPackageVersionFinder solutionPackageVersionFinder, - ICmdHelper cmdHelper) - : base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper) + ICmdHelper cmdHelper, + IInstallLibsService installLibsService, + AngularPwaSupportAdder angularPwaSupportAdder) + : base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, installLibsService, angularPwaSupportAdder) { TemplateProjectBuilder = templateProjectBuilder; TemplateInfoProvider = templateInfoProvider; - - Logger = NullLogger.Instance; } public async Task ExecuteAsync(CommandLineArgs commandLineArgs) @@ -79,7 +79,9 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'"); RunGraphBuildForMicroserviceServiceTemplate(projectArgs); - RunInstallLibsForWebTemplate(projectArgs); + await RunInstallLibsForWebTemplateAsync(projectArgs); + ConfigurePwaSupportForAngular(projectArgs); + OpenRelatedWebPage(projectArgs, template, isTiered, commandLineArgs); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index d638a21f87..6e280d7dc3 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Linq; +using System.Threading.Tasks; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; using Microsoft.Extensions.Logging; @@ -8,6 +9,7 @@ using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.Cli.ProjectModification; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Commands.Services; +using Volo.Abp.Cli.LIbs; using Volo.Abp.Cli.ProjectBuilding; using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Templates.App; @@ -22,13 +24,22 @@ public abstract class ProjectCreationCommandBase public ConnectionStringProvider ConnectionStringProvider { get; } public SolutionPackageVersionFinder SolutionPackageVersionFinder { get; } public ICmdHelper CmdHelper { get; } + public IInstallLibsService InstallLibsService { get; } + public AngularPwaSupportAdder AngularPwaSupportAdder { get; } public ILogger Logger { get; set; } - public ProjectCreationCommandBase(ConnectionStringProvider connectionStringProvider, SolutionPackageVersionFinder solutionPackageVersionFinder, ICmdHelper cmdHelper) + public ProjectCreationCommandBase( + ConnectionStringProvider connectionStringProvider, + SolutionPackageVersionFinder solutionPackageVersionFinder, + ICmdHelper cmdHelper, + IInstallLibsService installLibsService, + AngularPwaSupportAdder angularPwaSupportAdder) { ConnectionStringProvider = connectionStringProvider; SolutionPackageVersionFinder = solutionPackageVersionFinder; CmdHelper = cmdHelper; + InstallLibsService = installLibsService; + AngularPwaSupportAdder = angularPwaSupportAdder; Logger = NullLogger.Instance; } @@ -48,6 +59,12 @@ public abstract class ProjectCreationCommandBase Logger.LogInformation("Preview: yes"); } + var pwa = commandLineArgs.Options.ContainsKey(Options.ProgressiveWebApp.Short); + if (pwa) + { + Logger.LogInformation("Progressive Web App: yes"); + } + var databaseProvider = GetDatabaseProvider(commandLineArgs); if (databaseProvider != DatabaseProvider.NotSpecified) { @@ -162,7 +179,8 @@ public abstract class ProjectCreationCommandBase gitHubVoloLocalRepositoryPath, templateSource, commandLineArgs.Options, - connectionString + connectionString, + pwa ); } @@ -307,14 +325,27 @@ public abstract class ProjectCreationCommandBase } } - protected virtual void RunInstallLibsForWebTemplate(ProjectBuildArgs projectArgs) + protected async Task RunInstallLibsForWebTemplateAsync(ProjectBuildArgs projectArgs) { if (AppTemplateBase.IsAppTemplate(projectArgs.TemplateName) || ModuleTemplateBase.IsModuleTemplate(projectArgs.TemplateName) || AppNoLayersTemplateBase.IsAppNoLayersTemplate(projectArgs.TemplateName) || MicroserviceServiceTemplateBase.IsMicroserviceTemplate(projectArgs.TemplateName)) { - CmdHelper.RunCmd("abp install-libs", projectArgs.OutputFolder); + Logger.LogInformation("Installing client-side packages..."); + await InstallLibsService.InstallLibsAsync(projectArgs.OutputFolder); + } + } + + protected void ConfigurePwaSupportForAngular(ProjectBuildArgs projectArgs) + { + var isAngular = projectArgs.UiFramework == UiFramework.Angular; + var isPwa = projectArgs.Pwa; + + if (isAngular && isPwa) + { + Logger.LogInformation("Adding PWA Support to Angular app."); + AngularPwaSupportAdder.AddPwaSupport(projectArgs.OutputFolder); } } @@ -476,5 +507,10 @@ public abstract class ProjectCreationCommandBase { public const string Long = "preview"; } + + public static class ProgressiveWebApp + { + public const string Short = "pwa"; + } } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs index 2ce5ba8209..22311bb986 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs @@ -83,15 +83,18 @@ public abstract class ProxyCommandBase : IConsoleCommand, ITransientDependenc sb.AppendLine("Options:"); sb.AppendLine(""); sb.AppendLine("-m|--module (default: 'app') The name of the backend module you wish to generate proxies for."); - sb.AppendLine("-t|--type The name of generate type (csharp, js, ng)."); sb.AppendLine("-wd|--working-directory Execution directory."); sb.AppendLine("-u|--url API definition URL from."); - sb.AppendLine("-a|--api-name (default: 'default') The name of the API endpoint defined in the /src/environments/environment.ts."); - sb.AppendLine("-s|--source (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from."); - sb.AppendLine("-o|--output JavaScript file path or folder to place generated code in."); - sb.AppendLine("-p|--prompt Asks the options from the command line prompt (for the missing options)"); - sb.AppendLine("--target (default: 'defaultProject') Angular project name to place generated code in."); - sb.AppendLine("--folder (default: 'ClientProxies') Folder name to place generated CSharp code in."); + sb.AppendLine("-t|--type The name of generate type (csharp, js, ng)."); + sb.AppendLine(" csharp"); + sb.AppendLine(" --folder (default: 'ClientProxies') Folder name to place generated CSharp code in."); + sb.AppendLine(" js"); + sb.AppendLine(" -o|--output JavaScript file path or folder to place generated code in."); + sb.AppendLine(" ng"); + sb.AppendLine(" -a|--api-name (default: 'default') The name of the API endpoint defined in the /src/environments/environment.ts."); + sb.AppendLine(" -s|--source (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from."); + sb.AppendLine(" -p|--prompt Asks the options from the command line prompt (for the missing options)"); + sb.AppendLine(" --target (default: 'defaultProject') Angular project name to place generated code in."); sb.AppendLine(""); sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index 0e797e682f..aabd5c6dfd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs @@ -1,33 +1,53 @@ using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.NetworkInformation; using System.Text; +using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Newtonsoft.Json.Linq; using NuGet.Versioning; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Commands.Services; +using Volo.Abp.Cli.Http; using Volo.Abp.Cli.NuGet; using Volo.Abp.Cli.Utils; using Volo.Abp.DependencyInjection; +using Volo.Abp.Http; +using Volo.Abp.Json; +using Volo.Abp.Threading; namespace Volo.Abp.Cli.Commands; public class SuiteCommand : IConsoleCommand, ITransientDependency { public const string Name = "suite"; - + public ICmdHelper CmdHelper { get; } private readonly AbpNuGetIndexUrlService _nuGetIndexUrlService; private readonly NuGetService _nuGetService; + private readonly CliHttpClientFactory _cliHttpClientFactory; private const string SuitePackageName = "Volo.Abp.Suite"; public ILogger Logger { get; set; } - public SuiteCommand(AbpNuGetIndexUrlService nuGetIndexUrlService, NuGetService nuGetService, ICmdHelper cmdHelper) + private const string AbpSuiteHost = "http://localhost:3000"; + + public SuiteCommand( + AbpNuGetIndexUrlService nuGetIndexUrlService, + NuGetService nuGetService, + ICmdHelper cmdHelper, + CliHttpClientFactory cliHttpClientFactory) { CmdHelper = cmdHelper; _nuGetIndexUrlService = nuGetIndexUrlService; _nuGetService = nuGetService; + _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger.Instance; } @@ -48,6 +68,18 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency RunSuite(); break; + case "generate": + await InstallSuiteIfNotInstalledAsync(); + var suiteProcess = StartSuite(); + System.Threading.Thread.Sleep(500); //wait for initialization of the app + await GenerateCrudPageAsync(commandLineArgs); + if (suiteProcess != null) + { + KillSuite(); + } + + break; + case "install": await InstallSuiteAsync(version, preview); break; @@ -63,6 +95,115 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency } } + private async Task GenerateCrudPageAsync(CommandLineArgs args) + { + var entityFile = args.Options.GetOrNull(Options.Crud.Entity.Short, Options.Crud.Entity.Long); + var solutionFile = args.Options.GetOrNull(Options.Crud.Solution.Short, Options.Crud.Solution.Long); + + if (entityFile.IsNullOrEmpty() || !entityFile.EndsWith(".json") || !File.Exists(entityFile) || + solutionFile.IsNullOrEmpty() || !solutionFile.EndsWith(".sln")) + { + throw new UserFriendlyException("Invalid Arguments!"); + } + + Logger.LogInformation("Generating CRUD Page..."); + + var client = _cliHttpClientFactory.CreateClient(false); + var solutionId = await GetSolutionIdAsync(client, solutionFile); + + if (!solutionId.HasValue) + { + return; + } + + var entityContent = new StringContent( + File.ReadAllText(entityFile), + Encoding.UTF8, + MimeTypes.Application.Json + ); + + var responseMessage = await client.PostAsync( + $"{AbpSuiteHost}/api/abpSuite/crudPageGenerator/{solutionId.ToString()}/save-and-generate-entity", + entityContent + ); + + var response = await responseMessage.Content.ReadAsStringAsync(); + + if (!response.IsNullOrWhiteSpace()) + { + Logger.LogError(response); + } + else + { + Logger.LogInformation("CRUD page generation successfully completed."); + } + } + + private async Task GetSolutionIdAsync(HttpClient client, string solutionPath) + { + var timeIntervals = new List(); + for (var i = 0; i < 10; i++) + { + timeIntervals.Add(TimeSpan.FromSeconds(5)); + } + + var responseMessage = await client.GetHttpResponseMessageWithRetryAsync( + "http://localhost:3000/api/abpSuite/solutions", + _cliHttpClientFactory.GetCancellationToken(TimeSpan.FromMinutes(10)), + Logger, + timeIntervals.ToArray()); + + var response = await responseMessage.Content.ReadAsStringAsync(); + JArray solutions; + + try + { + solutions = (JArray)(JObject.Parse(response)["solutions"]); + } + catch (Exception) + { + Logger.LogError(response); + return await AddSolutionToSuiteAsync(client, solutionPath); + } + + foreach (JObject solution in solutions) + { + if (solution["path"].ToString() == solutionPath) + { + return Guid.Parse(solution["id"].ToString()); + } + } + + return await AddSolutionToSuiteAsync(client, solutionPath); + } + + private async Task AddSolutionToSuiteAsync(HttpClient client, string solutionPath) + { + var entityContent = new StringContent( + "{\"Path\": \"" + solutionPath.Replace("\\", "\\\\") + "\"}", + Encoding.UTF8, + MimeTypes.Application.Json + ); + + var responseMessage = await client.PostAsync( + "http://localhost:3000/api/abpSuite/addSolution", + entityContent, + _cliHttpClientFactory.GetCancellationToken(TimeSpan.FromMinutes(10)) + ); + + var response = await responseMessage.Content.ReadAsStringAsync(); + + try + { + return Guid.Parse(JObject.Parse(response)["id"].ToString()); + } + catch (Exception) + { + Logger.LogError(response); + return null; + } + } + private async Task InstallSuiteIfNotInstalledAsync() { var currentSuiteVersionAsString = GetCurrentSuiteVersion(); @@ -132,7 +273,8 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency } CmdHelper.RunCmd( - $"dotnet tool install {SuitePackageName}{versionOption} --add-source {nugetIndexUrl} -g", out int exitCode + $"dotnet tool install {SuitePackageName}{versionOption} --add-source {nugetIndexUrl} -g", + out int exitCode ); if (exitCode == 0) @@ -155,7 +297,8 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency private void ShowSuiteManualInstallCommand() { Logger.LogInformation("You can also run the following command to install ABP Suite."); - Logger.LogInformation("dotnet tool install -g Volo.Abp.Suite --add-source https://nuget.abp.io//v3/index.json"); + Logger.LogInformation( + "dotnet tool install -g Volo.Abp.Suite --add-source https://nuget.abp.io//v3/index.json"); } private async Task UpdateSuiteAsync(string version = null, bool preview = false) @@ -202,7 +345,8 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency } CmdHelper.RunCmd( - $"dotnet tool update {SuitePackageName}{versionOption} --add-source {nugetIndexUrl} -g", out int exitCode + $"dotnet tool update {SuitePackageName}{versionOption} --add-source {nugetIndexUrl} -g", + out int exitCode ); if (exitCode != 0) @@ -231,7 +375,8 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency private void ShowSuiteManualUpdateCommand() { Logger.LogError("You can also run the following command to update ABP Suite."); - Logger.LogError("dotnet tool update -g Volo.Abp.Suite --add-source https://nuget.abp.io//v3/index.json"); + Logger.LogError( + "dotnet tool update -g Volo.Abp.Suite --add-source https://nuget.abp.io//v3/index.json"); } private void RemoveSuite() @@ -258,6 +403,56 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency CmdHelper.RunCmd("abp-suite"); } + private Process StartSuite() + { + try + { + if (!GlobalToolHelper.IsGlobalToolInstalled("abp-suite")) + { + Logger.LogWarning("ABP Suite is not installed! To install it you can run the command: \"abp suite install\""); + return null; + } + } + catch (Exception ex) + { + Logger.LogWarning("Couldn't check ABP Suite installed status: " + ex.Message); + } + + if (IsSuiteAlreadyRunning()) + { + return null; + } + + return CmdHelper.RunCmdAndGetProcess("abp-suite --no-browser"); + } + + private bool IsSuiteAlreadyRunning() + { + var ipGP = IPGlobalProperties.GetIPGlobalProperties(); + var endpoints = ipGP.GetActiveTcpListeners(); + return endpoints.Any(e => e.Port == 3000); + } + + private void KillSuite() + { + try + { + var suiteProcesses = (from p in Process.GetProcesses() + where p.ProcessName.ToLower().Contains("abp-suite") + select p); + + foreach (var suiteProcess in suiteProcesses) + { + suiteProcess.Kill(); + Logger.LogInformation("Suite closed."); + } + } + catch (Exception ex) + { + Logger.LogInformation("Cannot close Suite." + ex.Message); + } + } + public string GetUsageInfo() { var sb = new StringBuilder(); @@ -306,5 +501,20 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency public const string Long = "version"; public const string Short = "v"; } + + public static class Crud + { + public static class Solution + { + public const string Long = "solution"; + public const string Short = "s"; + } + + public static class Entity + { + public const string Long = "entity"; + public const string Short = "e"; + } + } } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveFileStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveFileStep.cs new file mode 100644 index 0000000000..203a927536 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveFileStep.cs @@ -0,0 +1,21 @@ +using System; + +namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; + +public class RemoveFileStep : ProjectBuildPipelineStep +{ + private readonly string _filePath; + public RemoveFileStep(string filePath) + { + _filePath = filePath; + } + + public override void Execute(ProjectBuildContext context) + { + var fileToRemove = context.Files.Find(x => x.Name.EndsWith(_filePath)); + if (fileToRemove != null) + { + context.Files.Remove(fileToRemove); + } + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs index 437721f30c..8115182b04 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/TemplateCodeDeleteStep.cs @@ -8,7 +8,12 @@ public class TemplateCodeDeleteStep : ProjectBuildPipelineStep { foreach (var file in context.Files) { - if (file.Name.EndsWith(".cs") || file.Name.EndsWith(".csproj") || file.Name.EndsWith(".cshtml") || file.Name.EndsWith(".json") || file.Name.EndsWith(".gitignore")) + if (file.Name.EndsWith(".cs") || + file.Name.EndsWith(".csproj") || + file.Name.EndsWith(".cshtml") || + file.Name.EndsWith(".json") || + file.Name.EndsWith(".gitignore") || + file.Name.EndsWith(".html")) { file.RemoveTemplateCode(context.Symbols); file.RemoveTemplateCodeMarkers(); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs index 6d9b754cba..3c057454f6 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/ProjectBuildArgs.cs @@ -40,6 +40,8 @@ public class ProjectBuildArgs [NotNull] public string OutputFolder { get; set; } + public bool Pwa { get; set; } + [NotNull] public Dictionary ExtraProperties { get; set; } @@ -57,7 +59,8 @@ public class ProjectBuildArgs [CanBeNull] string voloGitHubLocalRepositoryPath = null, [CanBeNull] string templateSource = null, Dictionary extraProperties = null, - [CanBeNull] string connectionString = null) + [CanBeNull] string connectionString = null, + bool pwa = false) { SolutionName = Check.NotNull(solutionName, nameof(solutionName)); TemplateName = templateName; @@ -73,5 +76,6 @@ public class ProjectBuildArgs TemplateSource = templateSource; ExtraProperties = extraProperties ?? new Dictionary(); ConnectionString = connectionString; + Pwa = pwa; } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index 20b72cdc50..3dd6ece476 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -289,6 +289,19 @@ public abstract class AppTemplateBase : TemplateInfo steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); } + + if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.ProgressiveWebApp.Short)) + { + context.Symbols.Add("PWA"); + } + else + { + steps.Add(new RemoveFileStep("/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.js")); + steps.Add(new RemoveFileStep("/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.published.js")); + steps.Add(new RemoveFileStep("/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/manifest.json")); + steps.Add(new RemoveFileStep("/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-192.png")); + steps.Add(new RemoveFileStep("/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-512.png")); + } } protected void ConfigureWithBlazorServerUi(ProjectBuildContext context, List steps) @@ -365,6 +378,11 @@ public abstract class AppTemplateBase : TemplateInfo steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); } + + if (context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.ProgressiveWebApp.Short)) + { + context.Symbols.Add("PWA"); + } } protected void RemoveUnnecessaryPorts(ProjectBuildContext context, List steps) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularPwaSupportAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularPwaSupportAdder.cs new file mode 100644 index 0000000000..891ac28ecb --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularPwaSupportAdder.cs @@ -0,0 +1,35 @@ +using System; +using System.IO; +using System.Linq; +using Volo.Abp.Cli.Utils; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Cli.ProjectModification; + +public class AngularPwaSupportAdder : ITransientDependency +{ + protected ICmdHelper CmdHelper { get; } + protected PackageJsonFileFinder PackageJsonFileFinder { get; } + + public AngularPwaSupportAdder( + ICmdHelper cmdHelper, + PackageJsonFileFinder packageJsonFileFinder) + { + CmdHelper = cmdHelper; + PackageJsonFileFinder = packageJsonFileFinder; + } + + public virtual void AddPwaSupport(string rootDirectory) + { + var fileList = PackageJsonFileFinder.Find(rootDirectory).Where(x => File.Exists(x.RemovePostFix("package.json") + "angular.json")).ToList(); + + fileList.ForEach(AddPwaSupportToProject); + } + + protected virtual void AddPwaSupportToProject(string filePath) + { + var directory = Path.GetDirectoryName(filePath).EnsureEndsWith(Path.DirectorySeparatorChar); + + CmdHelper.RunCmd("ng add @angular/pwa --skip-confirmation", workingDirectory: directory); + } +} diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs index 2ade6dbd77..64517b1900 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs @@ -14,6 +14,7 @@ using NuGet.Versioning; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Commands; using Volo.Abp.Cli.Http; +using Volo.Abp.Cli.LIbs; using Volo.Abp.Cli.Utils; using Volo.Abp.DependencyInjection; using Volo.Abp.IO; @@ -25,7 +26,7 @@ public class NpmPackagesUpdater : ITransientDependency { public ILogger Logger { get; set; } protected ICancellationTokenProvider CancellationTokenProvider { get; } - public InstallLibsCommand InstallLibsCommand { get; } + public IInstallLibsService InstallLibsService { get; } public ICmdHelper CmdHelper { get; } private readonly PackageJsonFileFinder _packageJsonFileFinder; @@ -38,13 +39,13 @@ public class NpmPackagesUpdater : ITransientDependency NpmGlobalPackagesChecker npmGlobalPackagesChecker, ICancellationTokenProvider cancellationTokenProvider, CliHttpClientFactory cliHttpClientFactory, - InstallLibsCommand ınstallLibsCommand, + IInstallLibsService installLibsService, ICmdHelper cmdHelper) { _packageJsonFileFinder = packageJsonFileFinder; _npmGlobalPackagesChecker = npmGlobalPackagesChecker; CancellationTokenProvider = cancellationTokenProvider; - InstallLibsCommand = ınstallLibsCommand; + InstallLibsService = installLibsService; CmdHelper = cmdHelper; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger.Instance; @@ -306,10 +307,8 @@ public class NpmPackagesUpdater : ITransientDependency protected virtual async Task RunInstallLibsAsync(string fileDirectory) { - var args = new CommandLineArgs("install-libs"); - args.Options.Add(InstallLibsCommand.Options.WorkingDirectory.Short, fileDirectory); - - await InstallLibsCommand.ExecuteAsync(args); + Logger.LogInformation("Installing client-side packages..."); + await InstallLibsService.InstallLibsAsync(fileDirectory); } protected virtual void RunYarn(string fileDirectory) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs index 828b143192..36f33e1f6e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs @@ -12,6 +12,7 @@ using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Commands; using Volo.Abp.Cli.Commands.Services; using Volo.Abp.Cli.Http; +using Volo.Abp.Cli.LIbs; using Volo.Abp.Cli.ProjectBuilding; using Volo.Abp.Cli.Utils; using Volo.Abp.DependencyInjection; @@ -26,7 +27,7 @@ public class ProjectNpmPackageAdder : ITransientDependency public SourceCodeDownloadService SourceCodeDownloadService { get; } public AngularSourceCodeAdder AngularSourceCodeAdder { get; } public IRemoteServiceExceptionHandler RemoteServiceExceptionHandler { get; } - public InstallLibsCommand InstallLibsCommand { get; } + public IInstallLibsService InstallLibsService { get; } public ICmdHelper CmdHelper { get; } private readonly CliHttpClientFactory _cliHttpClientFactory; public ILogger Logger { get; set; } @@ -36,14 +37,14 @@ public class ProjectNpmPackageAdder : ITransientDependency SourceCodeDownloadService sourceCodeDownloadService, AngularSourceCodeAdder angularSourceCodeAdder, IRemoteServiceExceptionHandler remoteServiceExceptionHandler, - InstallLibsCommand ınstallLibsCommand, + IInstallLibsService installLibsService, ICmdHelper cmdHelper) { JsonSerializer = jsonSerializer; SourceCodeDownloadService = sourceCodeDownloadService; AngularSourceCodeAdder = angularSourceCodeAdder; RemoteServiceExceptionHandler = remoteServiceExceptionHandler; - InstallLibsCommand = ınstallLibsCommand; + InstallLibsService = installLibsService; CmdHelper = cmdHelper; _cliHttpClientFactory = cliHttpClientFactory; Logger = NullLogger.Instance; @@ -142,9 +143,8 @@ public class ProjectNpmPackageAdder : ITransientDependency return; } - await InstallLibsCommand.ExecuteAsync( - new CommandLineArgs("install-libs") - ); + Logger.LogInformation("Installing client-side packages..."); + await InstallLibsService.InstallLibsAsync(directory); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs index 08d8fa182d..45e0684b4a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionFileModifier.cs @@ -10,13 +10,30 @@ namespace Volo.Abp.Cli.ProjectModification; public class SolutionFileModifier : ITransientDependency { + public static Encoding DefaultEncoding = Encoding.UTF8; + public async Task RemoveProjectFromSolutionFileAsync(string solutionFile, string projectName) { - var solutionFileContent = File.ReadAllText(solutionFile); - solutionFileContent.NormalizeLineEndings(); - var lines = solutionFileContent.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None); - File.WriteAllText(solutionFile, - RemoveProject(lines.ToList(), projectName).JoinAsString(Environment.NewLine)); + using (var fileStream = File.Open(solutionFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) + { + using (var sr = new StreamReader(fileStream, Encoding.Default, true)) + { + var solutionFileContent = await sr.ReadToEndAsync(); + solutionFileContent.NormalizeLineEndings(); + + var lines = solutionFileContent.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None); + var updatedContent = RemoveProject(lines.ToList(), projectName).JoinAsString(Environment.NewLine); + + fileStream.Seek(0, SeekOrigin.Begin); + fileStream.SetLength(0); + + using (var sw = new StreamWriter(fileStream, DefaultEncoding)) + { + await sw.WriteAsync(updatedContent); + await sw.FlushAsync(); + } + } + } } public async Task AddModuleToSolutionFileAsync(ModuleWithMastersInfo module, string solutionFile) @@ -33,8 +50,8 @@ public class SolutionFileModifier : ITransientDependency { var srcFolderId = await AddNewFolderAndGetIdOrGetExistingIdAsync(solutionFile, "src"); - var file = File.ReadAllText(solutionFile); - var lines = file.Split(Environment.NewLine).ToList(); + var solutionFileContent = File.ReadAllText(solutionFile); + var lines = solutionFileContent.Split(Environment.NewLine).ToList(); if (lines.Any(l => l.Contains($"\"{package.Name}\""))) { @@ -64,7 +81,7 @@ public class SolutionFileModifier : ITransientDependency lines.InsertAfter(l => l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); - File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); + File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines), DefaultEncoding); } private List RemoveProject(List solutionFileLines, string projectName) @@ -137,7 +154,7 @@ public class SolutionFileModifier : ITransientDependency Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name, "test"), "*.csproj", SearchOption.AllDirectories).ToList(); - } + } foreach (var projectPath in projectsUnderModule) { @@ -174,7 +191,7 @@ public class SolutionFileModifier : ITransientDependency lines.InsertAfter(l => l.Contains("GlobalSection") && l.Contains("NestedProjects"), newPreSolutionLine); } - File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); + File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines), Encoding.UTF8); if (module.MasterModuleInfos != null) { @@ -219,7 +236,7 @@ public class SolutionFileModifier : ITransientDependency .Split(" ").Last(); } - File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines)); + File.WriteAllText(solutionFile, string.Join(Environment.NewLine, lines), Encoding.UTF8); return folderId; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index dfed250f1a..2bfcad2d32 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -100,7 +100,7 @@ public class SolutionModuleAdder : ITransientDependency Check.NotNull(solutionFile, nameof(solutionFile)); Check.NotNull(moduleName, nameof(moduleName)); - await PublishEventAsync(1, "Retriving module info..."); + await PublishEventAsync(1, "Retrieving module info..."); var module = await GetModuleInfoAsync(moduleName, newTemplate, newProTemplate); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs index 900930d472..98ad57f4b4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/VoloNugetPackagesVersionUpdater.cs @@ -9,6 +9,7 @@ using Volo.Abp.Cli.NuGet; using Volo.Abp.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using System.Text; namespace Volo.Abp.Cli.ProjectModification; @@ -17,6 +18,7 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency private readonly NuGetService _nuGetService; private readonly MyGetPackageListFinder _myGetPackageListFinder; public ILogger Logger { get; set; } + public static Encoding DefaultEncoding = Encoding.UTF8; public VoloNugetPackagesVersionUpdater(NuGetService nuGetService, MyGetPackageListFinder myGetPackageListFinder) { @@ -41,17 +43,30 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency async Task UpdateAsync(string filePath) { - var fileContent = File.ReadAllText(filePath); - var updatedContent = await UpdateVoloPackagesAsync(fileContent, - includePreviews, - includeReleaseCandidates, - switchToStable, - latestVersionFromNuget, - latestReleaseCandidateVersionFromNuget, - latestVersionFromMyGet, - version); - - File.WriteAllText(filePath, updatedContent); + using (var fs = File.Open(filePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) + { + using (var sr = new StreamReader(fs, Encoding.Default, true)) + { + var fileContent = await sr.ReadToEndAsync(); + + var updatedContent = await UpdateVoloPackagesAsync(fileContent, + includePreviews, + includeReleaseCandidates, + switchToStable, + latestVersionFromNuget, + latestReleaseCandidateVersionFromNuget, + latestVersionFromMyGet, + version); + + fs.Seek(0, SeekOrigin.Begin); + fs.SetLength(0); + using (var sw = new StreamWriter(fs, DefaultEncoding)) + { + await sw.WriteAsync(updatedContent); + await sw.FlushAsync(); + } + } + } } Task.WaitAll(projectPaths.Select(UpdateAsync).ToArray()); @@ -70,27 +85,54 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency var latestReleaseCandidateVersionFromNuget = await _nuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Core", includeReleaseCandidates: true); var latestVersionFromMyGet = await GetLatestVersionFromMyGet("Volo.Abp.Core"); - var fileContent = File.ReadAllText(projectPath); + using (var fs = File.Open(projectPath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) + { + using (var sr = new StreamReader(fs, Encoding.Default, true)) + { + var fileContent = await sr.ReadToEndAsync(); + + var updatedContent = await UpdateVoloPackagesAsync(fileContent, + includeNightlyPreviews, + includeReleaseCandidates, + switchToStable, + latestVersionFromNuget, + latestReleaseCandidateVersionFromNuget, + latestVersionFromMyGet, + version); - var updatedContent = await UpdateVoloPackagesAsync(fileContent, - includeNightlyPreviews, - includeReleaseCandidates, - switchToStable, - latestVersionFromNuget, - latestReleaseCandidateVersionFromNuget, - latestVersionFromMyGet, - version); + fs.Seek(0, SeekOrigin.Begin); + fs.SetLength(0); - File.WriteAllText(projectPath, updatedContent); + using (var sw = new StreamWriter(fs, sr.CurrentEncoding)) + { + await sw.WriteAsync(updatedContent); + await sw.FlushAsync(); + } + } + } } } protected virtual async Task UpdateInternalAsync(string projectPath, bool includeNightlyPreviews = false, bool includeReleaseCandidates = false, bool switchToStable = false) { - var fileContent = File.ReadAllText(projectPath); - var updatedContent = await UpdateVoloPackagesAsync(fileContent, includeNightlyPreviews, includeReleaseCandidates, switchToStable); + using (var fs = File.Open(projectPath, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) + { + using (var sr = new StreamReader(fs, Encoding.Default, true)) + { + var fileContent = await sr.ReadToEndAsync(); + + var updatedContent = await UpdateVoloPackagesAsync(fileContent, includeNightlyPreviews, includeReleaseCandidates, switchToStable); - File.WriteAllText(projectPath, updatedContent); + fs.Seek(0, SeekOrigin.Begin); + fs.SetLength(0); + + using (var sw = new StreamWriter(fs, sr.CurrentEncoding)) + { + await sw.WriteAsync(updatedContent); + await sw.FlushAsync(); + } + } + } } protected virtual async Task SpecifiedVersionExists(string version, string packageId) @@ -210,7 +252,7 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency } catch (Exception ex) { - Logger.LogError("Cannot update Volo.* packages! An error occured while updating the package \"{0}\". Error: {1}", packageId, ex.Message); + Logger.LogError("Cannot update Volo.* packages! An error occurred while updating the package \"{0}\". Error: {1}", packageId, ex.Message); Logger.LogException(ex); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs index 483d047e86..741390dc73 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs @@ -58,6 +58,22 @@ public class CmdHelper : ICmdHelper, ITransientDependency } } + public Process RunCmdAndGetProcess(string command, string workingDirectory = null) + { + var procStartInfo = new ProcessStartInfo( + GetFileName(), + GetArguments(command) + ); + + if (!string.IsNullOrEmpty(workingDirectory)) + { + procStartInfo.WorkingDirectory = workingDirectory; + procStartInfo.CreateNoWindow = false; + } + + return Process.Start(procStartInfo); + } + public string RunCmdAndGetOutput(string command, string workingDirectory = null) { return RunCmdAndGetOutput(command, out int _, workingDirectory); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs index 984b705d33..648215d24f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs @@ -1,4 +1,6 @@ -namespace Volo.Abp.Cli.Utils; +using System.Diagnostics; + +namespace Volo.Abp.Cli.Utils; public interface ICmdHelper { @@ -12,6 +14,8 @@ public interface ICmdHelper void RunCmd(string command, string workingDirectory = null); + Process RunCmdAndGetProcess(string command, string workingDirectory = null); + void RunCmd(string command, out int exitCode, string workingDirectory = null); string RunCmdAndGetOutput(string command, string workingDirectory = null); diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs index 72e7870125..286b9a8c76 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposeServicesAttribute.cs @@ -15,7 +15,7 @@ public class ExposeServicesAttribute : Attribute, IExposedServiceTypesProvider public ExposeServicesAttribute(params Type[] serviceTypes) { - ServiceTypes = serviceTypes ?? new Type[0]; + ServiceTypes = serviceTypes ?? Type.EmptyTypes; } public Type[] GetExposedServiceTypes(Type targetType) @@ -49,6 +49,10 @@ public class ExposeServicesAttribute : Attribute, IExposedServiceTypesProvider foreach (var interfaceType in type.GetTypeInfo().GetInterfaces()) { var interfaceName = interfaceType.Name; + if (interfaceType.IsGenericType) + { + interfaceName = interfaceType.Name.Left(interfaceType.Name.IndexOf('`')); + } if (interfaceName.StartsWith("I")) { diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs index d4d4a5bed0..dded0d794e 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs @@ -57,8 +57,6 @@ public static class CultureHelper public static string GetBaseCultureName(string cultureName) { - return cultureName.Contains("-") - ? cultureName.Left(cultureName.IndexOf("-", StringComparison.Ordinal)) - : cultureName; + return new CultureInfo(cultureName).Parent.Name; } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/DistributedEvents/PostgreSqlDbContextEventOutbox.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/DistributedEvents/PostgreSqlDbContextEventOutbox.cs index e5f2e0c4b6..7c5ef12fa7 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/DistributedEvents/PostgreSqlDbContextEventOutbox.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/DistributedEvents/PostgreSqlDbContextEventOutbox.cs @@ -13,7 +13,7 @@ public class PostgreSqlDbContextEventOutbox : DbContextEventOutbox : IDesignTimeDbContextFactory + where TModule : AbpModule + where TContext : DbContext +{ + public virtual TContext CreateDbContext(string[] args) + { + return AsyncHelper.RunSync(() => CreateDbContextAsync(args)); + } + + protected virtual async Task CreateDbContextAsync(string[] args) + { + var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(BuildConfiguration()); + ConfigureServices(options.Services); + }); + + await application.InitializeAsync(); + + return application.ServiceProvider.GetRequiredService(); + } + + protected virtual void ConfigureServices(IServiceCollection services) + { + + } + + protected abstract IConfigurationRoot BuildConfiguration(); +} diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/DbContextEventOutbox.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/DbContextEventOutbox.cs index 29ed8c3e27..c2816ea4c3 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/DbContextEventOutbox.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DistributedEvents/DbContextEventOutbox.cs @@ -56,4 +56,15 @@ public class DbContextEventOutbox : IDbContextEventOutbox ids) + { + var dbContext = (IHasEventOutbox)await DbContextProvider.GetDbContextAsync(); + var outgoingEvents = await dbContext.OutgoingEvents.Where(x => ids.Contains(x.Id)).ToListAsync(); + if (outgoingEvents.Any()) + { + dbContext.RemoveRange(outgoingEvents); + } + } } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventHandler.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventHandler.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventHandler.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventHandler.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandler.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandler.cs similarity index 83% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandler.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandler.cs index bbb35b8124..e313545b81 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandler.cs +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandler.cs @@ -3,7 +3,7 @@ using Volo.Abp.EventBus.Distributed; namespace Volo.Abp.EventBus; /// -/// Undirect base interface for all event handlers. +/// Indirect base interface for all event handlers. /// Implement or instead of this one. /// public interface IEventHandler diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventHandler.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventHandler.cs similarity index 81% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventHandler.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventHandler.cs index 94ebb31188..76f2053411 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventHandler.cs +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventHandler.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; +// ReSharper disable once CheckNamespace (Keeping for backward compability) namespace Volo.Abp.EventBus; -//TODO: Move to the right namespace in v3.0 public interface ILocalEventHandler : IEventHandler { /// diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpAzureEventBusOptions.cs b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpAzureEventBusOptions.cs index a6aa2f9857..57fa4b7f48 100644 --- a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpAzureEventBusOptions.cs +++ b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpAzureEventBusOptions.cs @@ -7,4 +7,6 @@ public class AbpAzureEventBusOptions public string SubscriberName { get; set; } public string TopicName { get; set; } + + public bool IsServiceBusDisabled { get; set; } } diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpEventBusAzureModule.cs b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpEventBusAzureModule.cs index 64c8b2fcd3..129004c871 100644 --- a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpEventBusAzureModule.cs +++ b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AbpEventBusAzureModule.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.AzureServiceBus; using Volo.Abp.Modularity; @@ -19,9 +20,15 @@ public class AbpEventBusAzureModule : AbpModule public override void OnApplicationInitialization(ApplicationInitializationContext context) { - context - .ServiceProvider - .GetRequiredService() - .Initialize(); + var options = context.ServiceProvider.GetRequiredService>().Value; + + if (!options.IsServiceBusDisabled) + { + context + .ServiceProvider + .GetRequiredService() + .Initialize(); + } + } } diff --git a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs index d8a3d1341a..86500cf434 100644 --- a/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs @@ -71,6 +71,10 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen private async Task ProcessEventAsync(ServiceBusReceivedMessage message) { var eventName = message.Subject; + if (eventName == null) + { + return; + } var eventType = _eventTypes.GetOrDefault(eventName); if (eventType == null) { @@ -87,12 +91,33 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen await TriggerHandlersAsync(eventType, eventData); } - public override async Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) + public async override Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) { await PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, outgoingEvent.Id); } - public override async Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig) + public async override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig) + { + var outgoingEventArray = outgoingEvents.ToArray(); + + var publisher = await _publisherPool.GetAsync( + _options.TopicName, + _options.ConnectionName); + + using var messageBatch = await publisher.CreateMessageBatchAsync(); + + foreach (var outgoingEvent in outgoingEventArray) + { + if (!messageBatch.TryAddMessage(new ServiceBusMessage(outgoingEvent.EventData) { Subject = outgoingEvent.EventName })) + { + throw new AbpException("The message is too large to fit in the batch. Set AbpEventBusBoxesOptions.OutboxWaitingEventMaxCount to reduce the number"); + } + } + + await publisher.SendMessagesAsync(messageBatch); + } + + public async override Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig) { var eventType = _eventTypes.GetOrDefault(incomingEvent.EventName); if (eventType == null) @@ -180,7 +205,7 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen .Locking(factories => factories.Clear()); } - protected override async Task PublishToEventBusAsync(Type eventType, object eventData) + protected async override Task PublishToEventBusAsync(Type eventType, object eventData) { await PublishAsync(EventNameAttribute.GetNameOrDefault(eventType), eventData); } diff --git a/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs index a19b01311c..4dba728c51 100644 --- a/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/KafkaDistributedEventBus.cs @@ -79,12 +79,7 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen return; } - string messageId = null; - - if (message.Headers.TryGetLastBytes("messageId", out var messageIdBytes)) - { - messageId = System.Text.Encoding.UTF8.GetString(messageIdBytes); - } + var messageId = message.GetMessageId(); if (await AddToInboxAsync(messageId, eventName, eventType, message.Value)) { @@ -164,7 +159,7 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Clear()); } - protected override async Task PublishToEventBusAsync(Type eventType, object eventData) + protected async override Task PublishToEventBusAsync(Type eventType, object eventData) { await PublishAsync( eventType, @@ -198,7 +193,43 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen ); } - public override async Task ProcessFromInboxAsync( + public override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig) + { + var producer = ProducerPool.Get(); + var outgoingEventArray = outgoingEvents.ToArray(); + producer.BeginTransaction(); + try + { + foreach (var outgoingEvent in outgoingEventArray) + { + var messageId = outgoingEvent.Id.ToString("N"); + var headers = new Headers + { + { "messageId", System.Text.Encoding.UTF8.GetBytes(messageId)} + }; + + producer.Produce( + AbpKafkaEventBusOptions.TopicName, + new Message + { + Key = outgoingEvent.EventName, + Value = outgoingEvent.EventData, + Headers = headers + }); + } + + producer.CommitTransaction(); + } + catch (Exception e) + { + producer.AbortTransaction(); + throw; + } + + return Task.CompletedTask; + } + + public async override Task ProcessFromInboxAsync( IncomingEventInfo incomingEvent, InboxConfig inboxConfig) { @@ -241,13 +272,29 @@ public class KafkaDistributedEventBus : DistributedEventBusBase, ISingletonDepen return PublishAsync(topicName, eventName, body, headers, headersArguments); } - private async Task PublishAsync(string topicName, string eventName, byte[] body, Headers headers, Dictionary headersArguments) + private Task> PublishAsync( + string topicName, + string eventName, + byte[] body, + Headers headers, + Dictionary headersArguments) { var producer = ProducerPool.Get(AbpKafkaEventBusOptions.ConnectionName); + return PublishAsync(producer, topicName, eventName, body, headers, headersArguments); + } + + private Task> PublishAsync( + IProducer producer, + string topicName, + string eventName, + byte[] body, + Headers headers, + Dictionary headersArguments) + { SetEventMessageHeaders(headers, headersArguments); - await producer.ProduceAsync( + return producer.ProduceAsync( topicName, new Message { diff --git a/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/MessageExtensions.cs b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/MessageExtensions.cs new file mode 100644 index 0000000000..17a80ec87c --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Kafka/Volo/Abp/EventBus/Kafka/MessageExtensions.cs @@ -0,0 +1,18 @@ +using Confluent.Kafka; + +namespace Volo.Abp.EventBus.Kafka; + +public static class MessageExtensions +{ + public static string GetMessageId(this Message message) + { + string messageId = null; + + if (message.Headers.TryGetLastBytes("messageId", out var messageIdBytes)) + { + messageId = System.Text.Encoding.UTF8.GetString(messageIdBytes); + } + + return messageId; + } +} diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs index ad09223f05..addbc49171 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs @@ -1,10 +1,23 @@ -namespace Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.RabbitMQ; + +namespace Volo.Abp.EventBus.RabbitMq; public class AbpRabbitMqEventBusOptions { + public const string DefaultExchangeType = RabbitMqConsts.ExchangeTypes.Direct; + public string ConnectionName { get; set; } public string ClientName { get; set; } public string ExchangeName { get; set; } + + public string ExchangeType { get; set; } + + public string GetExchangeTypeOrDefault() + { + return string.IsNullOrEmpty(ExchangeType) + ? DefaultExchangeType + : ExchangeType; + } } diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs index c57d9e9417..c9ec49bc7e 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs @@ -34,6 +34,8 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe protected IRabbitMqMessageConsumerFactory MessageConsumerFactory { get; } protected IRabbitMqMessageConsumer Consumer { get; private set; } + private bool _exchangeCreated; + public RabbitMqDistributedEventBus( IOptions options, IConnectionPool connectionPool, @@ -69,7 +71,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe Consumer = MessageConsumerFactory.Create( new ExchangeDeclareConfiguration( AbpRabbitMqEventBusOptions.ExchangeName, - type: "direct", + type: AbpRabbitMqEventBusOptions.GetExchangeTypeOrDefault(), durable: true ), new QueueDeclareConfiguration( @@ -180,7 +182,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Clear()); } - protected override async Task PublishToEventBusAsync(Type eventType, object eventData) + protected async override Task PublishToEventBusAsync(Type eventType, object eventData) { await PublishAsync(eventType, eventData, null); } @@ -197,7 +199,30 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe return PublishAsync(outgoingEvent.EventName, outgoingEvent.EventData, null, eventId: outgoingEvent.Id); } - public override async Task ProcessFromInboxAsync( + public async override Task PublishManyFromOutboxAsync( + IEnumerable outgoingEvents, + OutboxConfig outboxConfig) + { + using (var channel = ConnectionPool.Get(AbpRabbitMqEventBusOptions.ConnectionName).CreateModel()) + { + var outgoingEventArray = outgoingEvents.ToArray(); + channel.ConfirmSelect(); + + foreach (var outgoingEvent in outgoingEventArray) + { + await PublishAsync( + channel, + outgoingEvent.EventName, + outgoingEvent.EventData, + properties: null, + eventId: outgoingEvent.Id); + } + + channel.WaitForConfirmsOrDie(); + } + } + + public async override Task ProcessFromInboxAsync( IncomingEventInfo incomingEvent, InboxConfig inboxConfig) { @@ -233,7 +258,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe return PublishAsync(eventName, body, properties, headersArguments); } - protected Task PublishAsync( + protected virtual Task PublishAsync( string eventName, byte[] body, IBasicProperties properties, @@ -242,37 +267,66 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe { using (var channel = ConnectionPool.Get(AbpRabbitMqEventBusOptions.ConnectionName).CreateModel()) { - channel.ExchangeDeclare( - AbpRabbitMqEventBusOptions.ExchangeName, - "direct", - durable: true - ); - - if (properties == null) - { - properties = channel.CreateBasicProperties(); - properties.DeliveryMode = RabbitMqConsts.DeliveryModes.Persistent; - } + return PublishAsync(channel, eventName, body, properties, headersArguments, eventId); + } + } - if (properties.MessageId.IsNullOrEmpty()) - { - properties.MessageId = (eventId ?? GuidGenerator.Create()).ToString("N"); - } + protected virtual Task PublishAsync( + IModel channel, + string eventName, + byte[] body, + IBasicProperties properties, + Dictionary headersArguments = null, + Guid? eventId = null) + { + EnsureExchangeExists(channel); - SetEventMessageHeaders(properties, headersArguments); + if (properties == null) + { + properties = channel.CreateBasicProperties(); + properties.DeliveryMode = RabbitMqConsts.DeliveryModes.Persistent; + } - channel.BasicPublish( - exchange: AbpRabbitMqEventBusOptions.ExchangeName, - routingKey: eventName, - mandatory: true, - basicProperties: properties, - body: body - ); + if (properties.MessageId.IsNullOrEmpty()) + { + properties.MessageId = (eventId ?? GuidGenerator.Create()).ToString("N"); } + SetEventMessageHeaders(properties, headersArguments); + + channel.BasicPublish( + exchange: AbpRabbitMqEventBusOptions.ExchangeName, + routingKey: eventName, + mandatory: true, + basicProperties: properties, + body: body + ); + return Task.CompletedTask; } + private void EnsureExchangeExists(IModel channel) + { + if (_exchangeCreated) + { + return; + } + + try + { + channel.ExchangeDeclarePassive(AbpRabbitMqEventBusOptions.ExchangeName); + } + catch (Exception) + { + channel.ExchangeDeclare( + AbpRabbitMqEventBusOptions.ExchangeName, + AbpRabbitMqEventBusOptions.GetExchangeTypeOrDefault(), + durable: true + ); + } + _exchangeCreated = true; + } + private void SetEventMessageHeaders(IBasicProperties properties, Dictionary headersArguments) { if (headersArguments == null) @@ -306,7 +360,7 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe var handlerFactoryList = new List(); foreach (var handlerFactory in - HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) + HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) { handlerFactoryList.Add( new EventTypeWithEventHandlerFactories(handlerFactory.Key, handlerFactory.Value)); diff --git a/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs index cf6c1d6b0f..4ccd72ba15 100644 --- a/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.Rebus/Volo/Abp/EventBus/Rebus/RebusDistributedEventBus.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Rebus.Bus; using Rebus.Pipeline; +using Rebus.Transport; using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; @@ -149,6 +150,11 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen } protected async override Task PublishToEventBusAsync(Type eventType, object eventData) + { + await PublishAsync(eventType, eventData); + } + + protected virtual async Task PublishAsync(Type eventType, object eventData) { if (AbpRebusEventBusOptions.Publish != null) { @@ -218,7 +224,22 @@ public class RebusDistributedEventBus : DistributedEventBusBase, ISingletonDepen return PublishToEventBusAsync(eventType, eventData); } - public override async Task ProcessFromInboxAsync( + public async override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig) + { + var outgoingEventArray = outgoingEvents.ToArray(); + + using (var scope = new RebusTransactionScope()) + { + foreach (var outgoingEvent in outgoingEventArray) + { + await PublishFromOutboxAsync(outgoingEvent, outboxConfig); + } + + await scope.CompleteAsync(); + } + } + + public async override Task ProcessFromInboxAsync( IncomingEventInfo incomingEvent, InboxConfig inboxConfig) { diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs index a46fc76238..d92c48db3a 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpEventBusBoxesOptions.cs @@ -34,6 +34,11 @@ public class AbpEventBusBoxesOptions /// Default: 2 hours /// public TimeSpan WaitTimeToDeleteProcessedInboxEvents { get; set; } + + /// + /// Default: true + /// + public bool BatchPublishOutboxEvents { get; set; } public AbpEventBusBoxesOptions() { @@ -43,5 +48,6 @@ public class AbpEventBusBoxesOptions PeriodTimeSpan = TimeSpan.FromSeconds(2); DistributedLockWaitDuration = TimeSpan.FromSeconds(15); WaitTimeToDeleteProcessedInboxEvents = TimeSpan.FromHours(2); + BatchPublishOutboxEvents = true; } } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs index 6547c1686c..69ae91505d 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusBase.cs @@ -85,6 +85,11 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB OutboxConfig outboxConfig ); + public abstract Task PublishManyFromOutboxAsync( + IEnumerable outgoingEvents, + OutboxConfig outboxConfig + ); + public abstract Task ProcessFromInboxAsync( IncomingEventInfo incomingEvent, InboxConfig inboxConfig); @@ -101,7 +106,8 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB { if (outboxConfig.Selector == null || outboxConfig.Selector(eventType)) { - var eventOutbox = (IEventOutbox)unitOfWork.ServiceProvider.GetRequiredService(outboxConfig.ImplementationType); + var eventOutbox = + (IEventOutbox)unitOfWork.ServiceProvider.GetRequiredService(outboxConfig.ImplementationType); var eventName = EventNameAttribute.GetNameOrDefault(eventType); await eventOutbox.EnqueueAsync( new OutgoingEventInfo( @@ -135,7 +141,8 @@ public abstract class DistributedEventBusBase : EventBusBase, IDistributedEventB { if (inboxConfig.EventSelector == null || inboxConfig.EventSelector(eventType)) { - var eventInbox = (IEventInbox)scope.ServiceProvider.GetRequiredService(inboxConfig.ImplementationType); + var eventInbox = + (IEventInbox)scope.ServiceProvider.GetRequiredService(inboxConfig.ImplementationType); if (!messageId.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs index 6ecefcf002..018747945c 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs @@ -12,4 +12,6 @@ public interface IEventOutbox Task> GetWaitingEventsAsync(int maxCount, CancellationToken cancellationToken = default); Task DeleteAsync(Guid id); + + Task DeleteManyAsync(IEnumerable ids); } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs index 37405fb58a..73f74a68ad 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Threading.Tasks; namespace Volo.Abp.EventBus.Distributed; @@ -9,6 +10,11 @@ public interface ISupportsEventBoxes OutboxConfig outboxConfig ); + Task PublishManyFromOutboxAsync( + IEnumerable outgoingEvents, + OutboxConfig outboxConfig + ); + Task ProcessFromInboxAsync( IncomingEventInfo incomingEvent, InboxConfig inboxConfig diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs index 6ed60ba34c..851ddf3da1 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxSender.cs @@ -1,4 +1,7 @@ using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -82,18 +85,14 @@ public class OutboxSender : IOutboxSender, ITransientDependency } Logger.LogInformation($"Found {waitingEvents.Count} events in the outbox."); - - foreach (var waitingEvent in waitingEvents) + + if (EventBusBoxesOptions.BatchPublishOutboxEvents) { - await DistributedEventBus - .AsSupportsEventBoxes() - .PublishFromOutboxAsync( - waitingEvent, - OutboxConfig - ); - - await Outbox.DeleteAsync(waitingEvent.Id); - Logger.LogInformation($"Sent the event to the message broker with id = {waitingEvent.Id:N}"); + await PublishOutgoingMessagesInBatchAsync(waitingEvents); + } + else + { + await PublishOutgoingMessagesAsync(waitingEvents); } } } @@ -108,4 +107,32 @@ public class OutboxSender : IOutboxSender, ITransientDependency } } } + + protected virtual async Task PublishOutgoingMessagesAsync(List waitingEvents) + { + foreach (var waitingEvent in waitingEvents) + { + await DistributedEventBus + .AsSupportsEventBoxes() + .PublishFromOutboxAsync( + waitingEvent, + OutboxConfig + ); + + await Outbox.DeleteAsync(waitingEvent.Id); + + Logger.LogInformation($"Sent the event to the message broker with id = {waitingEvent.Id:N}"); + } + } + + protected virtual async Task PublishOutgoingMessagesInBatchAsync(List waitingEvents) + { + await DistributedEventBus + .AsSupportsEventBoxes() + .PublishManyFromOutboxAsync(waitingEvents, OutboxConfig); + + await Outbox.DeleteManyAsync(waitingEvents.Select(x => x.Id).ToArray()); + + Logger.LogInformation($"Sent {waitingEvents.Count} events to message broker"); + } } diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xml b/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xml new file mode 100644 index 0000000000..bd6def337b --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xsd b/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj new file mode 100644 index 0000000000..8af8416bb0 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo.Abp.Gdpr.Abstractions.csproj @@ -0,0 +1,15 @@ + + + + + + + netstandard2.0 + + + + + + + + diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/AbpGdprAbstractionsModule.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/AbpGdprAbstractionsModule.cs new file mode 100644 index 0000000000..3cb53c8be2 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/AbpGdprAbstractionsModule.cs @@ -0,0 +1,7 @@ +using Volo.Abp.Modularity; + +namespace Volo.Abp.Gdpr; + +public class AbpGdprAbstractionsModule : AbpModule +{ +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprDataInfo.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprDataInfo.cs new file mode 100644 index 0000000000..550f556a1c --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprDataInfo.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +namespace Volo.Abp.Gdpr; + +[Serializable] +public class GdprDataInfo : Dictionary +{ + +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataDeletionRequestedEto.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataDeletionRequestedEto.cs new file mode 100644 index 0000000000..aa7b721117 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataDeletionRequestedEto.cs @@ -0,0 +1,9 @@ +using System; + +namespace Volo.Abp.Gdpr; + +[Serializable] +public class GdprUserDataDeletionRequestedEto +{ + public Guid UserId { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataPreparedEto.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataPreparedEto.cs new file mode 100644 index 0000000000..3a2c440f97 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataPreparedEto.cs @@ -0,0 +1,13 @@ +using System; + +namespace Volo.Abp.Gdpr; + +[Serializable] +public class GdprUserDataPreparedEto +{ + public Guid RequestId { get; set; } + + public string Provider { get; set; } + + public GdprDataInfo Data { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderContext.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderContext.cs new file mode 100644 index 0000000000..1ccd035b7e --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataProviderContext.cs @@ -0,0 +1,8 @@ +using System; + +namespace Volo.Abp.Gdpr; + +public class GdprUserDataProviderContext +{ + public Guid UserId { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestedEto.cs b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestedEto.cs new file mode 100644 index 0000000000..b341ab2659 --- /dev/null +++ b/framework/src/Volo.Abp.Gdpr.Abstractions/Volo/Abp/Gdpr/GdprUserDataRequestedEto.cs @@ -0,0 +1,11 @@ +using System; + +namespace Volo.Abp.Gdpr; + +[Serializable] +public class GdprUserDataRequestedEto +{ + public Guid UserId { get; set; } + + public Guid RequestId { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs index 81a5c195c1..7147c81271 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ConsumerPool.cs @@ -76,6 +76,7 @@ public class ConsumerPool : IConsumerPool, ISingletonDependency try { + consumer.Value.Unsubscribe(); consumer.Value.Close(); consumer.Value.Dispose(); } diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs index da21f48883..704c15845f 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/KafkaMessageConsumer.cs @@ -80,9 +80,11 @@ public class KafkaMessageConsumer : IKafkaMessageConsumer, ITransientDependency, protected virtual async Task Timer_Elapsed(AbpAsyncTimer timer) { - await CreateTopicAsync(); - Consume(); - Timer.Stop(); + if (Consumer == null) + { + await CreateTopicAsync(); + Consume(); + } } protected virtual async Task CreateTopicAsync() @@ -164,12 +166,21 @@ public class KafkaMessageConsumer : IKafkaMessageConsumer, ITransientDependency, public virtual void Dispose() { + Timer.Stop(); if (Consumer == null) { return; } - Consumer.Close(); - Consumer.Dispose(); + try + { + Consumer.Unsubscribe(); + Consumer.Close(); + Consumer.Dispose(); + Consumer = null; + } + catch (ObjectDisposedException) + { + } } } diff --git a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs index 49287a20e9..0a31a3483a 100644 --- a/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs +++ b/framework/src/Volo.Abp.Kafka/Volo/Abp/Kafka/ProducerPool.cs @@ -17,6 +17,8 @@ public class ProducerPool : IProducerPool, ISingletonDependency protected ConcurrentDictionary>> Producers { get; } protected TimeSpan TotalDisposeWaitDuration { get; set; } = TimeSpan.FromSeconds(10); + + protected TimeSpan DefaultTransactionsWaitDuration { get; set; } = TimeSpan.FromSeconds(30); public ILogger Logger { get; set; } @@ -37,11 +39,18 @@ public class ProducerPool : IProducerPool, ISingletonDependency return Producers.GetOrAdd( connectionName, connection => new Lazy>(() => { - var config = Options.Connections.GetOrDefault(connection); - - Options.ConfigureProducer?.Invoke(new ProducerConfig(config)); - - return new ProducerBuilder(config).Build(); + var producerConfig = new ProducerConfig(Options.Connections.GetOrDefault(connection)); + Options.ConfigureProducer?.Invoke(producerConfig); + + if (producerConfig.TransactionalId.IsNullOrWhiteSpace()) + { + producerConfig.TransactionalId = Guid.NewGuid().ToString(); + } + + var producer = new ProducerBuilder(producerConfig).Build(); + producer.InitTransactions(DefaultTransactionsWaitDuration); + + return producer; })).Value; } @@ -69,7 +78,7 @@ public class ProducerPool : IProducerPool, ISingletonDependency foreach (var producer in Producers.Values) { var poolItemDisposeStopwatch = Stopwatch.StartNew(); - + try { producer.Value.Dispose(); @@ -77,19 +86,19 @@ public class ProducerPool : IProducerPool, ISingletonDependency catch { } - + poolItemDisposeStopwatch.Stop(); - + remainingWaitDuration = remainingWaitDuration > poolItemDisposeStopwatch.Elapsed ? remainingWaitDuration.Subtract(poolItemDisposeStopwatch.Elapsed) : TimeSpan.Zero; } - + poolDisposeStopwatch.Stop(); - + Logger.LogInformation( $"Disposed Kafka Producer Pool ({Producers.Count} producers in {poolDisposeStopwatch.Elapsed.TotalMilliseconds:0.00} ms)."); - + if (poolDisposeStopwatch.Elapsed.TotalSeconds > 5.0) { Logger.LogWarning( diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs index 0b88f72fe8..61621c2479 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs @@ -14,14 +14,17 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali public List BaseLocalizers { get; } + public AbpLocalizationOptions AbpLocalizationOptions { get; } + public virtual LocalizedString this[string name] => GetLocalizedString(name); public virtual LocalizedString this[string name, params object[] arguments] => GetLocalizedStringFormatted(name, arguments); - public AbpDictionaryBasedStringLocalizer(LocalizationResource resource, List baseLocalizers) + public AbpDictionaryBasedStringLocalizer(LocalizationResource resource, List baseLocalizers, AbpLocalizationOptions abpLocalizationOptions) { Resource = resource; BaseLocalizers = baseLocalizers; + AbpLocalizationOptions = abpLocalizationOptions; } public IEnumerable GetAllStrings(bool includeParentCultures) @@ -95,23 +98,29 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali return null; } - //Try to get from same language dictionary (without country code) - if (cultureName.Contains("-")) //Example: "tr-TR" (length=5) + if (AbpLocalizationOptions.TryToGetFromBaseCulture) { - var strLang = Resource.Contributors.GetOrNull(CultureHelper.GetBaseCultureName(cultureName), name); - if (strLang != null) + //Try to get from same language dictionary (without country code) + if (cultureName.Contains("-")) //Example: "tr-TR" (length=5) { - return strLang; + var strLang = Resource.Contributors.GetOrNull(CultureHelper.GetBaseCultureName(cultureName), name); + if (strLang != null) + { + return strLang; + } } } - //Try to get from default language - if (!Resource.DefaultCultureName.IsNullOrEmpty()) + if (AbpLocalizationOptions.TryToGetFromDefaultCulture) { - var strDefault = Resource.Contributors.GetOrNull(Resource.DefaultCultureName, name); - if (strDefault != null) + //Try to get from default language + if (!Resource.DefaultCultureName.IsNullOrEmpty()) { - return strDefault; + var strDefault = Resource.Contributors.GetOrNull(Resource.DefaultCultureName, name); + if (strDefault != null) + { + return strDefault; + } } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationOptions.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationOptions.cs index b2f289dfec..5228f886e9 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationOptions.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationOptions.cs @@ -21,6 +21,10 @@ public class AbpLocalizationOptions public Dictionary> LanguageFilesMap { get; } + public bool TryToGetFromBaseCulture { get; set; } + + public bool TryToGetFromDefaultCulture { get; set; } + public AbpLocalizationOptions() { Resources = new LocalizationResourceDictionary(); @@ -28,5 +32,7 @@ public class AbpLocalizationOptions Languages = new List(); LanguagesMap = new Dictionary>(); LanguageFilesMap = new Dictionary>(); + TryToGetFromBaseCulture = true; + TryToGetFromDefaultCulture = true; } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs index 8ee1eaefc4..3f47fd779d 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs @@ -68,7 +68,8 @@ public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLoca return new StringLocalizerCacheItem( new AbpDictionaryBasedStringLocalizer( resource, - resource.BaseResourceTypes.Select(Create).ToList() + resource.BaseResourceTypes.Select(Create).ToList(), + AbpLocalizationOptions ) ); } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/MongoDbContextEventOutbox.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/MongoDbContextEventOutbox.cs index 1f3ae999b0..fae0709953 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/MongoDbContextEventOutbox.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/DistributedEvents/MongoDbContextEventOutbox.cs @@ -68,4 +68,18 @@ public class MongoDbContextEventOutbox : IMongoDbContextEventOu await dbContext.OutgoingEvents.DeleteOneAsync(x => x.Id.Equals(id)); } } + + [UnitOfWork] + public async Task DeleteManyAsync(IEnumerable ids) + { + var dbContext = (IHasEventOutbox)await MongoDbContextProvider.GetDbContextAsync(); + if (dbContext.SessionHandle != null) + { + await dbContext.OutgoingEvents.DeleteManyAsync(dbContext.SessionHandle, x => ids.Contains(x.Id)); + } + else + { + await dbContext.OutgoingEvents.DeleteManyAsync(x => ids.Contains(x.Id)); + } + } } diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConsts.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConsts.cs index 19b8ddb573..996e88959b 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConsts.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqConsts.cs @@ -8,4 +8,15 @@ public static class RabbitMqConsts public const int Persistent = 2; } + + public static class ExchangeTypes + { + public const string Direct = "direct"; + + public const string Topic = "topic"; + + public const string Fanout = "fanout"; + + public const string Headers = "headers"; + } } diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index 049e8da712..8ce184295a 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -176,14 +176,6 @@ public class RabbitMqMessageConsumer : IRabbitMqMessageConsumer, ITransientDepen } catch (Exception ex) { - if (ex is OperationInterruptedException operationInterruptedException && - operationInterruptedException.ShutdownReason.ReplyCode == 406 && - operationInterruptedException.Message.Contains("arg 'x-dead-letter-exchange'")) - { - Logger.LogException(ex, LogLevel.Warning); - await ExceptionNotifier.NotifyAsync(ex, logLevel: LogLevel.Warning); - } - Logger.LogException(ex, LogLevel.Warning); await ExceptionNotifier.NotifyAsync(ex, logLevel: LogLevel.Warning); } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs index a56c8ef8ad..1a60ab9d6b 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ContentFormatters/RemoteStreamContentTestController_Tests.cs @@ -16,6 +16,7 @@ public class RemoteStreamContentTestController_Tests : AspNetCoreMvcTestBase var result = await GetResponseAsync("/api/remote-stream-content-test/download"); result.Content.Headers.ContentType?.ToString().ShouldBe("application/rtf"); result.Content.Headers.ContentDisposition?.FileName.ShouldBe("download.rtf"); + result.Content.Headers.ContentLength.ShouldBe("DownloadAsync".Length); (await result.Content.ReadAsStringAsync()).ShouldBe("DownloadAsync"); } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs index 3c7ccfbc6a..5d8716a70c 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/AutoRegistrationHelper_Tests.cs @@ -33,6 +33,21 @@ public class AutoRegistrationHelper_Tests exposedServices.ShouldContain(typeof(IDerivedService)); } + [Fact] + public void Should_Get_Conventional_Exposed_Generic_Types_By_Default() + { + //Act + var exposedServices = ExposedServiceExplorer.GetExposedServices(typeof(DefaultGenericService)); + + //Assert + exposedServices.Count.ShouldBe(4); + exposedServices.ShouldContain(typeof(IService)); + exposedServices.ShouldContain(typeof(IGenericService)); + exposedServices.ShouldContain(typeof(IGenericService)); + exposedServices.ShouldContain(typeof(DefaultGenericService)); + } + + public class DefaultDerivedService : IDerivedService { } @@ -50,4 +65,14 @@ public class AutoRegistrationHelper_Tests { } + + public interface IGenericService + { + + } + + public class DefaultGenericService : IService, IGenericService, IGenericService + { + + } } diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs index b8375485f7..6c4bdfff08 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Linq; using Microsoft.Extensions.Localization; using Shouldly; @@ -183,6 +183,60 @@ public class AbpLocalization_Tests : AbpIntegratedTest - netstandard2.0 + net6.0 Volo.Abp.Account.Application Volo.Abp.Account.Application true diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs index fe94f47415..5ec85d4078 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -277,6 +277,18 @@ public class LoginModel : AccountPageModel CheckIdentityErrors(await UserManager.SetEmailAsync(user, emailAddress)); CheckIdentityErrors(await UserManager.AddLoginAsync(user, info)); CheckIdentityErrors(await UserManager.AddDefaultRolesAsync(user)); + + user.Name = info.Principal.FindFirstValue(AbpClaimTypes.Name); + user.Surname = info.Principal.FindFirstValue(AbpClaimTypes.SurName); + + var phoneNumber = info.Principal.FindFirstValue(AbpClaimTypes.PhoneNumber); + if (!phoneNumber.IsNullOrWhiteSpace()) + { + var phoneNumberConfirmed = string.Equals(info.Principal.FindFirstValue(AbpClaimTypes.PhoneNumberVerified), "true", StringComparison.InvariantCultureIgnoreCase); + user.SetPhoneNumber(phoneNumber, phoneNumberConfirmed); + } + + await UserManager.UpdateAsync(user); return user; } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo.Abp.BackgroundJobs.Domain.csproj b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo.Abp.BackgroundJobs.Domain.csproj index 7eb9015b73..b46209de47 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo.Abp.BackgroundJobs.Domain.csproj +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo.Abp.BackgroundJobs.Domain.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo.Abp.BackgroundJobs.MongoDB.csproj b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo.Abp.BackgroundJobs.MongoDB.csproj index 56c1391ab9..7d29486644 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo.Abp.BackgroundJobs.MongoDB.csproj +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo.Abp.BackgroundJobs.MongoDB.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor index 75b64e05b7..afa3521d01 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LanguageSwitch.razor @@ -7,11 +7,11 @@ @inject IAbpRequestLocalizationOptionsProvider RequestLocalizationOptionsProvider @if (_otherLanguages != null && _otherLanguages.Any()) { - + @_currentLanguage.DisplayName - + @foreach (var language in _otherLanguages) { @language.DisplayName diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor index 6f89696075..4b41add531 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor @@ -5,11 +5,11 @@ @inject IJSRuntime JsRuntime @if (_otherLanguages != null && _otherLanguages.Any()) { - + @_currentLanguage.DisplayName - + @foreach (var language in _otherLanguages) { @language.DisplayName diff --git a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj index a846bb0ca6..e707190be5 100644 --- a/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj +++ b/modules/blogging/app/Volo.BloggingTestApp.MongoDB/Volo.BloggingTestApp.MongoDB.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + netstandard2.1 diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj index 456777e60a..6df6b27bb7 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Blogging.Admin.Application Volo.Blogging.Admin.Application diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj index 504d32836d..99c491231b 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj +++ b/modules/blogging/src/Volo.Blogging.Application/Volo.Blogging.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Blogging.Application Volo.Blogging.Application diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index 457656291f..15506ecf70 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -231,11 +231,16 @@ namespace Volo.Blogging.Posts return url; } - private async Task SaveTags(ICollection newTags, Post post) + private async Task SaveTags(ICollection tags, Post post) { - await RemoveOldTags(newTags, post); - - await AddNewTags(newTags, post); + tags = tags + .Select(t => t.ToLowerInvariant()) + .Distinct() + .ToList(); + + await RemoveOldTags(tags, post); + + await AddNewTags(tags, post); } private async Task RemoveOldTags(ICollection newTags, Post post) diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj index c6c096105b..905494aa41 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Blogging.Domain Volo.Blogging.Domain diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo.Blogging.MongoDB.csproj b/modules/blogging/src/Volo.Blogging.MongoDB/Volo.Blogging.MongoDB.csproj index 5019b843f2..83d8759d14 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo.Blogging.MongoDB.csproj +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo.Blogging.MongoDB.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Blogging.MongoDB Volo.Blogging.MongoDB diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.Designer.cs new file mode 100644 index 0000000000..d04ca4c0ed --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.Designer.cs @@ -0,0 +1,2118 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.EntityFrameworkCore; + +#nullable disable + +namespace Volo.CmsKit.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + [Migration("20220324203918_Added_BlogPostStatus")] + partial class Added_BlogPostStatus + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "6.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("varbinary(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ContainerId"); + + b.HasIndex("TenantId", "ContainerId", "Name"); + + b.ToTable("AbpBlobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpBlobContainers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogs", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogFeature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeatureName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.Property("CoverImageMediaId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ShortDescription") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("Slug", "BlogId"); + + b.ToTable("CmsBlogPosts", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("RepliedCommentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "RepliedCommentId"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsComments", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.GlobalResources.GlobalResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("CmsGlobalResources", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.MediaDescriptors.MediaDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Size") + .HasMaxLength(2147483647) + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsMediaDescriptors", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Menus.MenuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CssClass") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ElementId") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Icon") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PageId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Target") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("Id"); + + b.ToTable("CmsMenuItems", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Pages.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Script") + .HasColumnType("nvarchar(max)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Style") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Slug"); + + b.ToTable("CmsPages", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StarCount") + .HasColumnType("smallint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); + + b.ToTable("CmsRatings", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Reactions.UserReaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReactionName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "ReactionName"); + + b.HasIndex("TenantId", "CreatorId", "EntityType", "EntityId", "ReactionName"); + + b.ToTable("CmsUserReactions", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.EntityTag", b => + { + b.Property("EntityId") + .HasColumnType("nvarchar(450)"); + + b.Property("TagId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("EntityId", "TagId"); + + b.HasIndex("TenantId", "EntityId", "TagId"); + + b.ToTable("CmsEntityTags", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("CmsTags", (string)null); + }); + + modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Email"); + + b.HasIndex("TenantId", "UserName"); + + b.ToTable("CmsUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null) + .WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.HasOne("Volo.CmsKit.Users.CmsUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.cs new file mode 100644 index 0000000000..8624383a73 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20220324203918_Added_BlogPostStatus.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Volo.CmsKit.Migrations +{ + public partial class Added_BlogPostStatus : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Status", + table: "CmsBlogPosts", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Status", + table: "CmsBlogPosts"); + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index 29bd29f91c..3299179fcb 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -1341,6 +1341,9 @@ namespace Volo.CmsKit.Migrations .HasMaxLength(256) .HasColumnType("nvarchar(256)"); + b.Property("Status") + .HasColumnType("int"); + b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/abp.resourcemapping.js b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/abp.resourcemapping.js index 82b2d4b649..26cdc6aad9 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/abp.resourcemapping.js +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/abp.resourcemapping.js @@ -7,6 +7,5 @@ module.exports = { "@libs" ], mappings: { - } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs index 6ea2fddd90..3e109a9eed 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs @@ -2,6 +2,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; +using Volo.CmsKit.Blogs; namespace Volo.CmsKit.Admin.Blogs; @@ -25,4 +26,6 @@ public class BlogPostDto : EntityDto, IHasCreationTime, IHasModificationTi public DateTime? LastModificationTime { get; set; } public string ConcurrencyStamp { get; set; } + + public BlogPostStatus Status { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostGetListInput.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostGetListInput.cs index e8fa497e15..f136fe6562 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostGetListInput.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostGetListInput.cs @@ -1,5 +1,6 @@ using System; using Volo.Abp.Application.Dtos; +using Volo.CmsKit.Blogs; namespace Volo.CmsKit.Admin.Blogs; @@ -8,4 +9,8 @@ public class BlogPostGetListInput : PagedAndSortedResultRequestDto public string Filter { get; set; } public Guid? BlogId { get; set; } -} + + public Guid? AuthorId { get; set; } + + public BlogPostStatus? Status { get; set; } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostListDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostListDto.cs index 0953bf2c00..fc8cbc9e0e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostListDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostListDto.cs @@ -1,6 +1,7 @@ using System; using Volo.Abp.Application.Dtos; using Volo.Abp.Auditing; +using Volo.CmsKit.Blogs; namespace Volo.CmsKit.Admin.Blogs; @@ -24,4 +25,6 @@ public class BlogPostListDto : EntityDto, IHasCreationTime, IHasModificati public DateTime CreationTime { get; set; } public DateTime? LastModificationTime { get; set; } + + public BlogPostStatus? Status { get; set; } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs index 314b7a1def..5b7868627f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/IBlogPostAdminAppService.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.Application.Services; namespace Volo.CmsKit.Admin.Blogs; @@ -12,4 +13,15 @@ public interface IBlogPostAdminAppService CreateBlogPostDto, UpdateBlogPostDto> { + Task PublishAsync(Guid id); + + Task DraftAsync(Guid id); + + Task CreateAndPublishAsync(CreateBlogPostDto input); + + Task SendToReviewAsync(Guid id); + + Task CreateAndSendToReviewAsync(CreateBlogPostDto input); + + Task HasBlogPostWaitingForReviewAsync(); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs index eb733cc36f..b89b38d43a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissionDefinitionProvider.cs @@ -55,6 +55,8 @@ public class CmsKitAdminPermissionDefinitionProvider : PermissionDefinitionProvi .RequireGlobalFeatures(typeof(BlogsFeature)); blogPostManagement.AddChild(CmsKitAdminPermissions.BlogPosts.Delete, L("Permission:BlogPostManagement.Delete")) .RequireGlobalFeatures(typeof(BlogsFeature)); + blogPostManagement.AddChild(CmsKitAdminPermissions.BlogPosts.Publish, L("Permission:BlogPostManagement.Publish")) + .RequireGlobalFeatures(typeof(BlogsFeature)); var menuManagement = cmsGroup.AddPermission(CmsKitAdminPermissions.Menus.Default, L("Permission:MenuManagement")) .RequireGlobalFeatures(typeof(MenuFeature)); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs index 49fa7c8ffc..b5d2a8eaa6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Permissions/CmsKitAdminPermissions.cs @@ -51,6 +51,7 @@ public class CmsKitAdminPermissions public const string Create = Default + ".Create"; public const string Update = Default + ".Update"; public const string Delete = Default + ".Delete"; + public const string Publish = Default + ".Publish"; } public static class Menus diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj index bf1ff4f610..684446b1f0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo.CmsKit.Admin.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs index 83899199f0..f09a2e4565 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs @@ -6,6 +6,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Data; using Volo.Abp.GlobalFeatures; using Volo.Abp.Users; +using Volo.CmsKit.Admin.MediaDescriptors; using Volo.CmsKit.Blogs; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; @@ -22,16 +23,20 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe protected IBlogRepository BlogRepository { get; } protected ICmsUserLookupService UserLookupService { get; } + protected IMediaDescriptorAdminAppService MediaDescriptorAdminAppService { get; } + public BlogPostAdminAppService( BlogPostManager blogPostManager, IBlogPostRepository blogPostRepository, IBlogRepository blogRepository, - ICmsUserLookupService userLookupService) + ICmsUserLookupService userLookupService, + IMediaDescriptorAdminAppService mediaDescriptorAdminAppService) { BlogPostManager = blogPostManager; BlogPostRepository = blogPostRepository; BlogRepository = blogRepository; UserLookupService = userLookupService; + MediaDescriptorAdminAppService = mediaDescriptorAdminAppService; } [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] @@ -42,13 +47,15 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe var blog = await BlogRepository.GetAsync(input.BlogId); var blogPost = await BlogPostManager.CreateAsync( - author, - blog, - input.Title, - input.Slug, - input.ShortDescription, - input.Content, - input.CoverImageMediaId); + author, + blog, + input.Title, + input.Slug, + BlogPostStatus.Draft, + input.ShortDescription, + input.Content, + input.CoverImageMediaId + ); await BlogPostRepository.InsertAsync(blogPost); @@ -59,13 +66,18 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe public virtual async Task UpdateAsync(Guid id, UpdateBlogPostDto input) { var blogPost = await BlogPostRepository.GetAsync(id); - + blogPost.SetTitle(input.Title); blogPost.SetShortDescription(input.ShortDescription); blogPost.SetContent(input.Content); blogPost.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); + + if (blogPost.CoverImageMediaId != null && input.CoverImageMediaId == null) + { + await MediaDescriptorAdminAppService.DeleteAsync(blogPost.CoverImageMediaId.Value); + } blogPost.CoverImageMediaId = input.CoverImageMediaId; - + if (blogPost.Slug != input.Slug) { await BlogPostManager.SetSlugUrlAsync(blogPost, input.Slug); @@ -89,9 +101,11 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe { var blogs = (await BlogRepository.GetListAsync()).ToDictionary(x => x.Id); - var blogPosts = await BlogPostRepository.GetListAsync(input.Filter, input.BlogId, input.MaxResultCount, input.SkipCount, input.Sorting); + var blogPosts = await BlogPostRepository.GetListAsync(input.Filter, input.BlogId, input.AuthorId, + statusFilter: input.Status, + input.MaxResultCount, input.SkipCount, input.Sorting); - var count = await BlogPostRepository.GetCountAsync(input.Filter); + var count = await BlogPostRepository.GetCountAsync(input.Filter, input.BlogId, input.AuthorId); var dtoList = blogPosts.Select(x => { @@ -109,4 +123,57 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe { await BlogPostRepository.DeleteAsync(id); } -} + + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public virtual async Task PublishAsync(Guid id) + { + var blogPost = await BlogPostRepository.GetAsync(id); + blogPost.SetPublished(); + await BlogPostRepository.UpdateAsync(blogPost); + } + + [Authorize(CmsKitAdminPermissions.BlogPosts.Update)] + public virtual async Task DraftAsync(Guid id) + { + var blogPost = await BlogPostRepository.GetAsync(id); + blogPost.SetDraft(); + await BlogPostRepository.UpdateAsync(blogPost); + } + + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public virtual async Task CreateAndPublishAsync(CreateBlogPostDto input) + { + var blogPost = await CreateAsync(input); + await CurrentUnitOfWork.SaveChangesAsync(); + + await PublishAsync(blogPost.Id); + blogPost.Status = BlogPostStatus.Published; + return blogPost; + } + + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + public virtual async Task SendToReviewAsync(Guid id) + { + var blogPost = await BlogPostRepository.GetAsync(id); + blogPost.SetWaitingForReview(); + await BlogPostRepository.UpdateAsync(blogPost); + } + + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + public virtual async Task CreateAndSendToReviewAsync(CreateBlogPostDto input) + { + var blogPost = await CreateAsync(input); + await CurrentUnitOfWork.SaveChangesAsync(); + + await SendToReviewAsync(blogPost.Id); + blogPost.Status = BlogPostStatus.WaitingForReview; + return blogPost; + } + + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public async Task HasBlogPostWaitingForReviewAsync() + { + return await BlogPostRepository.HasBlogPostWaitingForReviewAsync(); + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/BlogPostAdminClientProxy.Generated.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/BlogPostAdminClientProxy.Generated.cs index 560ba4e2de..974d0a279b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/BlogPostAdminClientProxy.Generated.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi.Client/ClientProxies/BlogPostAdminClientProxy.Generated.cs @@ -55,4 +55,49 @@ public partial class BlogPostAdminClientProxy : ClientProxyBase CreateAndPublishAsync(CreateBlogPostDto input) + { + return await RequestAsync(nameof(CreateAndPublishAsync), new ClientProxyRequestTypeValue + { + { typeof(CreateBlogPostDto), input } + }); + } + + public virtual async Task SendToReviewAsync(Guid id) + { + await RequestAsync(nameof(SendToReviewAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id }, + }); + } + + public virtual async Task CreateAndSendToReviewAsync(CreateBlogPostDto input) + { + return await RequestAsync(nameof(CreateAndSendToReviewAsync), new ClientProxyRequestTypeValue + { + { typeof(CreateBlogPostDto), input } + }); + } + + public virtual async Task HasBlogPostWaitingForReviewAsync() + { + return await RequestAsync(nameof(HasBlogPostWaitingForReviewAsync)); + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs index 51b201349a..563d90c254 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs @@ -61,4 +61,53 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.UpdateAsync(id, input); } -} + + [HttpPost] + [Route("{id}/publish")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public virtual Task PublishAsync(Guid id) + { + return BlogPostAdminAppService.PublishAsync(id); + } + + [HttpPost] + [Route("{id}/draft")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Update)] + public virtual Task DraftAsync(Guid id) + { + return BlogPostAdminAppService.DraftAsync(id); + } + + [HttpPost] + [Route("create-and-publish")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public virtual Task CreateAndPublishAsync(CreateBlogPostDto input) + { + return BlogPostAdminAppService.CreateAndPublishAsync(input); + } + + [HttpPost] + [Route("{id}/send-to-review")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + public virtual Task SendToReviewAsync(Guid id) + { + return BlogPostAdminAppService.SendToReviewAsync(id); + } + + [HttpPost] + [Route("create-and-send-to-review")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] + public virtual Task CreateAndSendToReviewAsync(CreateBlogPostDto input) + { + return BlogPostAdminAppService.CreateAndSendToReviewAsync(input); + } + + [HttpGet] + [Route("has-blogpost-waiting-for-review")] + [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] + public virtual Task HasBlogPostWaitingForReviewAsync() + { + return BlogPostAdminAppService.HasBlogPostWaitingForReviewAsync(); + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml index 26b09e8358..eefc59e849 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml @@ -1,6 +1,7 @@ @page @using System.Globalization +@using Microsoft.AspNetCore.Authorization @using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.CmsKit.Admin.Web.Pages @@ -10,9 +11,10 @@ @using Volo.CmsKit.Blogs @using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy @using Volo.Abp.AspNetCore.Mvc.UI.Packages.Slugify +@using Volo.CmsKit.Permissions @inherits CmsKitAdminPageBase - +@inject IAuthorizationService AuthorizationService @model CreateModel @{ @@ -69,6 +71,7 @@ data-input-id="@Html.IdFor(x => x.ViewModel.Content)" data-language="@(CultureInfo.CurrentUICulture.TwoLetterISOLanguageName)"> +
@@ -84,6 +87,13 @@ - + + @if ((await AuthorizationService.AuthorizeAsync(CmsKitAdminPermissions.BlogPosts.Publish)).Succeeded) + { + + }else + { + + } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs index 08d4d24b37..a76385491a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs @@ -31,9 +31,21 @@ public class CreateModel : CmsKitAdminPageModel { var dto = ObjectMapper.Map(ViewModel); - var created = await BlogPostAdminAppService.CreateAsync(dto); + BlogPostDto createResult; + if (ViewModel.Status == BlogPostStatus.Published) + { + createResult = await BlogPostAdminAppService.CreateAndPublishAsync(dto); + } + else if (ViewModel.Status == BlogPostStatus.WaitingForReview) + { + createResult = await BlogPostAdminAppService.CreateAndSendToReviewAsync(dto); + } + else + { + createResult = await BlogPostAdminAppService.CreateAsync(dto); + } - return new OkObjectResult(created); + return new OkObjectResult(createResult); } [AutoMap(typeof(CreateBlogPostDto), ReverseMap = true)] @@ -65,5 +77,9 @@ public class CreateModel : CmsKitAdminPageModel [HiddenInput] public Guid? CoverImageMediaId { get; set; } + + [HiddenInput] + [DynamicFormIgnore] + public BlogPostStatus Status { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Index.cshtml index 9eeb977e84..6587509d11 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Index.cshtml @@ -5,6 +5,7 @@ @using Volo.CmsKit.Admin.Web.Pages @using Volo.CmsKit.Admin.Web.Menus @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar +@using Volo.CmsKit.Blogs @inherits CmsKitAdminPageBase @@ -27,11 +28,24 @@ @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new {pageName = typeof(IndexModel).FullName}) } + +
- + + + + @await Component.InvokeAsync(typeof(AbpPageSearchBoxViewComponent)) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml index a27ff10906..f48f5e7bd0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml @@ -48,13 +48,17 @@
- @if (Model.ViewModel.CoverImageMediaId != null) - { - -
- } - - +
+ @if (Model.ViewModel.CoverImageMediaId != null) + { + +
+ +
+ } +
+ +
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js index f6b47e1c94..ab46438fbb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js @@ -2,13 +2,22 @@ $(function () { var l = abp.localization.getResource("CmsKit"); + var blogPostStatus = { + Draft: 0, + Published: 1, + SendToReview: 2 + }; + var $selectBlog = $('#BlogSelectionSelect'); var $formCreate = $('#form-blog-post-create'); var $title = $('#ViewModel_Title'); var $shortDescription = $('#ViewModel_ShortDescription'); var $coverImage = $('#ViewModel_CoverImageMediaId'); var $url = $('#ViewModel_Slug'); + var $status = $('#ViewModel_Status'); var $buttonSubmit = $('#button-blog-post-create'); + var $buttonPublish = $('#button-blog-post-publish'); + var $buttonSendToReview = $('#button-blog-post-send-to-review'); var $pageContentInput = $('#ViewModel_Content'); var $tagsInput = $('.tag-editor-form input[name=tags]'); var $fileInput = $('#BlogPostCoverImage'); @@ -59,9 +68,36 @@ $(function () { $buttonSubmit.click(function (e) { e.preventDefault(); + $status.val(blogPostStatus.Draft); submitCoverImage(); }); + $buttonPublish.click(function (e) { + abp.message.confirm( + l('BlogPostPublishConfirmationMessage', $title.val()), + function (isConfirmed) { + if (isConfirmed) { + e.preventDefault(); + $status.val(blogPostStatus.Published); + submitCoverImage(); + } + } + ); + }); + + $buttonSendToReview.click(function (e) { + abp.message.confirm( + l('BlogPostSendToReviewConfirmationMessage', $title.val()), + function (isConfirmed) { + if (isConfirmed) { + e.preventDefault(); + $status.val(blogPostStatus.SendToReview); + submitCoverImage(); + } + } + ); + }); + function submitEntityTags(blogPostId) { if ($tagsInput.val()) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js index 60d0de3cb5..73e19a178a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js @@ -1,13 +1,26 @@ $(function () { var l = abp.localization.getResource("CmsKit"); - + var $statusFilter = $("#StatusSelect"); + + var blogPostStatus = { + Draft: 0, + Published: 1, + SendToReview: 2 + }; + var blogsService = volo.cmsKit.admin.blogs.blogPostAdmin; - + var getFilter = function () { - return { + var filter = { filter: $('#CmsKitBlogPostsWrapper input.page-search-filter-text').val() }; + + if ($statusFilter.val()) { + filter.status = $statusFilter.val(); + } + + return filter; }; var dataTable = $("#BlogPostsTable").DataTable(abp.libs.datatables.normalizeConfiguration({ @@ -33,6 +46,60 @@ $(function () { location.href = "BlogPosts/Update/" + data.record.id } }, + { + text: l('Publish'), + visible: function(data) { + return data?.status !== blogPostStatus.Published && abp.auth.isGranted('CmsKit.BlogPosts.Publish'); + }, + confirmMessage: function (data) { + return l("BlogPostPublishConfirmationMessage", data.record.title) + }, + action: function (data) { + blogsService + .publish(data.record.id) + .then(function () { + dataTable.ajax.reload(); + abp.notify.success(l('SuccessfullyPublished')); + checkHasBlogPostWaitingForReview(); + }); + } + }, + { + text: l('SendToReview'), + visible: function(data) { + return data?.status === blogPostStatus.Draft && + !abp.auth.isGranted('CmsKit.BlogPosts.Publish'); + }, + confirmMessage: function (data) { + return l("BlogPostPublishConfirmationMessage", data.record.title) + }, + action: function (data) { + blogsService + .sendToReview(data.record.id) + .then(function () { + dataTable.ajax.reload(); + abp.notify.success(l('BlogPostSendToReviewSuccessMessage', data.record.title)); + }); + } + }, + { + text: l('Draft'), + visible: function(data) { + return data?.status !== blogPostStatus.Draft && abp.auth.isGranted('CmsKit.BlogPosts.Update'); + }, + confirmMessage: function (data) { + return l("BlogPostDraftConfirmationMessage", data.record.title) + }, + action: function (data) { + blogsService + .draft(data.record.id) + .then(function () { + dataTable.ajax.reload(); + abp.notify.success(l('SuccessfullySaved')); + checkHasBlogPostWaitingForReview(); + }); + } + }, { text: l('Delete'), visible: abp.auth.isGranted('CmsKit.BlogPosts.Delete'), @@ -71,7 +138,15 @@ $(function () { orderable: true, data: 'creationTime', dataFormat: "datetime" - } + }, + { + title: l("Status"), + orderable: true, + data: "status", + render: function (data) { + return l("CmsKit.BlogPost.Status." + data); + } + }, ] })); @@ -84,4 +159,25 @@ $(function () { e.preventDefault(); window.location.href = "BlogPosts/Create" }); + + $('#button-show-waiting-for-review').on('click', function (e) { + e.preventDefault(); + $statusFilter.val(blogPostStatus.SendToReview); + dataTable.ajax.reload(); + }); + + function checkHasBlogPostWaitingForReview(){ + if (!abp.auth.isGranted('CmsKit.BlogPosts.Publish')){ + $('#alertHasBlogPostWaitingForReview').hide(); + } + + blogsService.hasBlogPostWaitingForReview().then(function (result) { + if (result) { + $('#alertHasBlogPostWaitingForReview').show('fast'); + } else { + $('#alertHasBlogPostWaitingForReview').hide('fast'); + } + }); + } + checkHasBlogPostWaitingForReview(); }); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js index a4119bb331..732578f3fb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js @@ -10,6 +10,7 @@ $(function () { var $blogPostIdInput = $('#Id'); var $tagsInput = $('.tag-editor-form input[name=tags]'); var $fileInput = $('#BlogPostCoverImage'); + var $buttonRemoveCoverImage = $('#button-remove-cover-image'); var UPPY_FILE_ID = "uppy-upload-file"; @@ -155,7 +156,6 @@ $(function () { } } - // ----------------------------------- var fileUploadUri = "/api/cms-kit-admin/media/blogpost"; var fileUriPrefix = "/api/cms-kit/media/"; @@ -228,4 +228,16 @@ $(function () { } }); } + + $buttonRemoveCoverImage.on('click', function () { + abp.message.confirm( + l('RemoveCoverImageConfirmationMessage'), + function (isConfirmed) { + if (isConfirmed) { + $coverImage.val(null); + $('#CurrentCoverImageArea').remove(); + } + } + ); + }); }); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/Index.cshtml index b67a147baa..615ef31477 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/Index.cshtml @@ -2,6 +2,7 @@ @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Codemirror @using Volo.CmsKit.Admin.Web.Pages.CmsKit.GlobalResources @using Volo.CmsKit.Admin.Web.Menus @using Volo.CmsKit.Localization @@ -17,8 +18,15 @@ PageLayout.Content.MenuItemName = CmsKitAdminMenus.GlobalResources.GlobalResourcesMenu; } +@section styles{ + +} + @section scripts { + + + diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/index.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/index.js index 72fb11e8dc..c58447b22d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/index.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/GlobalResources/index.js @@ -3,11 +3,26 @@ $(function (){ var service = volo.cmsKit.admin.globalResources.globalResourceAdmin; + var scriptEditor = CodeMirror.fromTextArea(document.getElementById("ScriptContent"),{ + mode:"javascript", + lineNumbers:true + }); + + var styleEditor = CodeMirror.fromTextArea(document.getElementById("StyleContent"),{ + mode:"css", + lineNumbers:true + }); + + $('.nav-tabs a').on('shown.bs.tab', function() { + scriptEditor.refresh(); + styleEditor.refresh(); + }); + $('#SaveResourcesButton').on('click','',function(){ service.setGlobalResources( { - style: $('#StyleContent').val(), - script: $('#ScriptContent').val() + style: styleEditor.getValue(), + script: scriptEditor.getValue() } ).then(function () { abp.message.success(l("SavedSuccessfully")); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml index 841576e761..4671cb2ca2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml @@ -1,6 +1,7 @@ @page @using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Codemirror @using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy @using Volo.CmsKit.Admin.Web.Pages @@ -22,6 +23,9 @@ + + + @@ -31,6 +35,7 @@ @section styles { + } @@ -56,11 +61,11 @@ - + - + diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml index 1271502946..499ad1b633 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml @@ -1,6 +1,7 @@ @page "{Id}" @using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Codemirror @using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy @using Volo.Abp.AspNetCore.Mvc.UI.Packages.Slugify @@ -23,6 +24,9 @@ + + + @@ -32,6 +36,7 @@ @section styles { + } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js index ffe37fe5a8..1de6021a7d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js @@ -6,22 +6,40 @@ $(function () { var $slug = $('#ViewModel_Slug'); var $buttonSubmit = $('#button-page-create'); + var scriptEditor = CodeMirror.fromTextArea(document.getElementById("ViewModel_Script"), { + mode: "javascript", + lineNumbers: true + }); + + var styleEditor = CodeMirror.fromTextArea(document.getElementById("ViewModel_Style"), { + mode: "css", + lineNumbers: true + }); + + $('.nav-tabs a').on('shown.bs.tab', function () { + scriptEditor.refresh(); + styleEditor.refresh(); + }); + $createForm.data('validator').settings.ignore = ":hidden, [contenteditable='true']:not([name]), .tui-popup-wrapper"; $createForm.on('submit', function (e) { e.preventDefault(); - + if ($createForm.valid()) { abp.ui.setBusy(); + $("#ViewModel_Style").val(styleEditor.getValue()); + $("#ViewModel_Script").val(scriptEditor.getValue()); + $createForm.ajaxSubmit({ success: function (result) { abp.notify.success(l('SuccessfullySaved')); abp.ui.clearBusy(); location.href = "../Pages"; }, - error: function(result){ + error: function (result) { abp.ui.clearBusy(); abp.notify.error(result.responseJSON.error.message); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js index 99af38b70c..6bd90dd934 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js @@ -7,6 +7,21 @@ $(function () { $formUpdate.data('validator').settings.ignore = ":hidden, [contenteditable='true']:not([name]), .tui-popup-wrapper"; + var scriptEditor = CodeMirror.fromTextArea(document.getElementById("ViewModel_Script"), { + mode: "javascript", + lineNumbers: true + }); + + var styleEditor = CodeMirror.fromTextArea(document.getElementById("ViewModel_Style"), { + mode: "css", + lineNumbers: true + }); + + $('.nav-tabs a').on('shown.bs.tab', function () { + scriptEditor.refresh(); + styleEditor.refresh(); + }); + $formUpdate.on('submit', function (e) { e.preventDefault(); @@ -14,6 +29,9 @@ $(function () { abp.ui.setBusy(); + $("#ViewModel_Style").val(styleEditor.getValue()); + $("#ViewModel_Script").val(scriptEditor.getValue()); + $formUpdate.ajaxSubmit({ success: function (result) { abp.notify.success(l('SuccessfullySaved')); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js index 0a1424d92a..228ffb907b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/wwwroot/client-proxies/cms-kit-admin-proxy.js @@ -378,7 +378,7 @@ volo.cmsKit.admin.blogs.blogPostAdmin.getList = function(input, ajaxParams) { return abp.ajax($.extend(true, { - url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts' + abp.utils.buildQueryString([{ name: 'filter', value: input.filter }, { name: 'blogId', value: input.blogId }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '', + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts' + abp.utils.buildQueryString([{ name: 'filter', value: input.filter }, { name: 'blogId', value: input.blogId }, { name: 'authorId', value: input.authorId }, { name: 'status', value: input.status }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '', type: 'GET' }, ajaxParams)); }; @@ -391,6 +391,53 @@ }, ajaxParams)); }; + volo.cmsKit.admin.blogs.blogPostAdmin.publish = function(id, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/' + id + '/publish', + type: 'POST', + dataType: null + }, ajaxParams)); + }; + + volo.cmsKit.admin.blogs.blogPostAdmin.draft = function(id, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/' + id + '/draft', + type: 'POST', + dataType: null + }, ajaxParams)); + }; + + volo.cmsKit.admin.blogs.blogPostAdmin.createAndPublish = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/create-and-publish', + type: 'POST', + data: JSON.stringify(input) + }, ajaxParams)); + }; + + volo.cmsKit.admin.blogs.blogPostAdmin.sendToReview = function(id, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/' + id + '/send-to-review', + type: 'POST', + dataType: null + }, ajaxParams)); + }; + + volo.cmsKit.admin.blogs.blogPostAdmin.createAndSendToReview = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/create-and-send-to-review', + type: 'POST', + data: JSON.stringify(input) + }, ajaxParams)); + }; + + volo.cmsKit.admin.blogs.blogPostAdmin.hasBlogPostWaitingForReview = function(ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/cms-kit-admin/blogs/blog-posts/has-blogpost-waiting-for-review', + type: 'GET' + }, ajaxParams)); + }; + })(); })(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Application/Volo.CmsKit.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Application/Volo.CmsKit.Application.csproj index fa1557674e..51282692af 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Application/Volo.CmsKit.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Application/Volo.CmsKit.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj index 1d7baff506..145c7adac6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo.CmsKit.Common.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostStatus.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostStatus.cs new file mode 100644 index 0000000000..2d849e9d93 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostStatus.cs @@ -0,0 +1,8 @@ +namespace Volo.CmsKit.Blogs; + +public enum BlogPostStatus +{ + Draft, + Published, + WaitingForReview +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/BlogPostScrollIndexFeature.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/BlogPostScrollIndexFeature.cs new file mode 100644 index 0000000000..9f03f973e1 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/BlogPostScrollIndexFeature.cs @@ -0,0 +1,17 @@ +using JetBrains.Annotations; +using Volo.Abp.GlobalFeatures; + +namespace Volo.CmsKit.GlobalFeatures; + + +[GlobalFeatureName(Name)] +public class BlogPostScrollIndexFeature : GlobalFeature +{ + public const string Name = "CmsKit.BlogPost.ScrollIndex"; + + internal BlogPostScrollIndexFeature( + [NotNull] GlobalCmsKitFeatures cmsKit + ) : base(cmsKit) + { + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs index 9c07101616..6a7ca3245a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/GlobalCmsKitFeatures.cs @@ -26,6 +26,8 @@ public class GlobalCmsKitFeatures : GlobalModuleFeatures public MenuFeature Menu => GetFeature(); public GlobalResourcesFeature GlobalResources => GetFeature(); + + public BlogPostScrollIndexFeature BlogPostScrollIndex => GetFeature(); public GlobalCmsKitFeatures([NotNull] GlobalFeatureManager featureManager) : base(featureManager) @@ -40,5 +42,6 @@ public class GlobalCmsKitFeatures : GlobalModuleFeatures AddFeature(new CmsUserFeature(this)); AddFeature(new MenuFeature(this)); AddFeature(new GlobalResourcesFeature(this)); + AddFeature(new BlogPostScrollIndexFeature(this)); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 0dd826480d..5fa5d4abc1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -85,6 +85,7 @@ "Permission:BlogPostManagement.Create": "Create", "Permission:BlogPostManagement.Delete": "Delete", "Permission:BlogPostManagement.Update": "Update", + "Permission:BlogPostManagement.Publish": "Publish", "Permission:CmsKit": "CmsKit", "Permission:Comments": "Comment Management", "Permission:Comments.Delete": "Delete", @@ -130,6 +131,7 @@ "SelectAll": "Select All", "Send": "Send", "SendMessage": "Send Message", + "SelectedAuthor": "Author", "ShortDescription": "Short description", "Slug": "Slug", "Source": "Source", @@ -164,6 +166,23 @@ "GlobalResources": "Global Resources", "Script": "Script", "Style": "Style", - "SavedSuccessfully": "Saved successfully" + "SavedSuccessfully": "Saved successfully", + "CmsKit.BlogPost.Status.0": "Draft", + "CmsKit.BlogPost.Status.1": "Published", + "CmsKit.BlogPost.Status.2": "Waiting for review", + "BlogPostPublishConfirmationMessage": "Are you sure to publish the blog post \"{0}\"?", + "SuccessfullyPublished": "Successfully published!", + "Draft": "Draft", + "Publish": "Publish", + "BlogPostDraftConfirmationMessage": "Are you sure to set the blog post \"{0}\" as draft?", + "BlogPostSendToReviewConfirmationMessage": "Are you sure to send the blog post \"{0}\" to admin review for publishing?", + "SaveAsDraft": "Save as draft", + "SendToReview": "Send to review", + "SendToReviewToPublish": "Send to review to publish", + "BlogPostSendToReviewSuccessMessage": "The blog post \"{0}\" has been sent to admin review for publishing.", + "HasBlogPostWaitingForReviewMessage": "You have a blog post waiting for review. Click to list.", + "SelectAStatus": "Select a status", + "Status": "Status", + "CmsKit.BlogPost.ScrollIndex": "Quick navigation bar in blog posts" } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index 95ef414c17..b49f1f8326 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -85,6 +85,7 @@ "Permission:BlogPostManagement.Create": "Oluşturma", "Permission:BlogPostManagement.Delete": "Silme", "Permission:BlogPostManagement.Update": "Güncelleme", + "Permission:BlogPostManagement.Publish": "Yayınlama", "Permission:CmsKit": "CmsKit", "Permission:Comments": "Yorum Yönetimi", "Permission:Comments.Delete": "Silmek", @@ -129,6 +130,7 @@ "SelectAll": "Hepsini seç", "Send": "Gönder", "SendMessage": "Mesajı Gönder", + "SelectedAuthor": "Yazar", "ShortDescription": "Kısa açıklama", "Slug": "Etiket", "Source": "Kaynak", @@ -163,6 +165,28 @@ "GlobalResources": "Global Kaynaklar", "Script": "Script", "Style": "Style", - "SavedSuccessfully": "Başarıyla kaydedildi" + "SavedSuccessfully": "Başarıyla kaydedildi", + "CmsKit.BlogPost.Status.0": "Taslak", + "CmsKit.BlogPost.Status.1": "Yayınlandı", + "CmsKit.BlogPost.Status.2": "İnceleme Bekliyor", + "BlogPostPublishConfirmationMessage": "\"{0}\" başlıklı gönderiyi yayınlamak istediğinize emin misiniz?", + "SuccessfullyPublished": "Başarıyla yayınlandı", + "Draft": "Taslak olarak kaydet", + "Publish": "Yayınla", + "BlogPostDraftConfirmationMessage": "\"{0}\" başlıklı gönderiyi taslak haline getirmek istediğinize emin misiniz?", + "BlogPostSendToReviewConfirmationMessage": "\"{0}\" başlıklı gönderiyi yayınlamak için admin incelemesine göndermek istediğinize emin misiniz?", + "SaveAsDraft": "Taslak olarak kaydet", + "SendToReview": "İncelemeye gönder", + "SendToReviewToPublish": "Yayınlamak için admin incelemesine gönder", + "BlogPostSendToReviewSuccessMessage": "\"{0}\" başlıklı gönderiyi yayınlamak için admin incelemesine gönderildi.", + "HasBlogPostWaitingForReviewMessage": "Yayınlanmak için onay bekleyen blog postlar var! Listelemek için tıklayın.", + "SelectAStatus": "Durum seçin", + "Status": "Durum", + "SelectAnAuthor": "Bir yazar seçin", + "GoToTop": "Yukarı Git", + "InThisDocument": "Bu belgede", + "RemoveCoverImageConfirmationMessage": "Kapak resmini kaldırmak istediğinize emin misiniz?", + "RemoveCoverImage": "Kapak resmini kaldır", + "CmsKit.BlogPost.ScrollIndex": "Blog yazılarında hızlı gezinme çubuğu" } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureDataSeedContributor.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureDataSeedContributor.cs new file mode 100644 index 0000000000..5306d302dd --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureDataSeedContributor.cs @@ -0,0 +1,36 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.GlobalFeatures; + +namespace Volo.CmsKit.Blogs; + +public class BlogFeatureDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly BlogFeatureManager _blogFeatureManager; + private readonly IBlogRepository _blogRepository; + + public BlogFeatureDataSeedContributor( + BlogFeatureManager blogFeatureManager, + IBlogRepository blogRepository) + { + _blogFeatureManager = blogFeatureManager; + _blogRepository = blogRepository; + } + + public async Task SeedAsync(DataSeedContext context) + { + if (!GlobalFeatureManager.Instance.IsEnabled()) + { + return; + } + + var blogs = await _blogRepository.GetListAsync(); + + foreach (var blog in blogs) + { + await _blogFeatureManager.SetDefaultsIfNotSetAsync(blog.Id); + } + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs index 77a519daf3..f9dd101ef9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogFeatureManager.cs @@ -44,4 +44,24 @@ public class BlogFeatureManager : DomainService await SetAsync(blogId, feature.FeatureName, isEnabled: true); } } + + public async Task SetIfNotSetAsync(Guid blogId, string featureName, bool isEnabled) + { + var blogFeature = await BlogFeatureRepository.FindAsync(blogId, featureName); + if (blogFeature == null) + { + var newBlogFeature = new BlogFeature(blogId, featureName, isEnabled); + await BlogFeatureRepository.InsertAsync(newBlogFeature); + } + } + + public async Task SetDefaultsIfNotSetAsync(Guid blogId) + { + var defaultFeatures = await DefaultBlogFeatureProvider.GetDefaultFeaturesAsync(blogId); + + foreach (var feature in defaultFeatures) + { + await SetIfNotSetAsync(blogId, feature.FeatureName, isEnabled: true); + } + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs index faf6c4bcb6..cca45bf4fe 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs @@ -29,7 +29,9 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant public Guid AuthorId { get; set; } public virtual CmsUser Author { get; set; } - + + public virtual BlogPostStatus Status { get; set; } + protected BlogPost() { } @@ -43,7 +45,9 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant [CanBeNull] string shortDescription = null, [CanBeNull] string content = null, [CanBeNull] Guid? coverImageMediaId = null, - [CanBeNull] Guid? tenantId = null) : base(id) + [CanBeNull] Guid? tenantId = null, + [CanBeNull] BlogPostStatus? state = null + ) : base(id) { TenantId = tenantId; BlogId = blogId; @@ -53,6 +57,7 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant SetShortDescription(shortDescription); SetContent(content); CoverImageMediaId = coverImageMediaId; + Status = state ?? BlogPostStatus.Draft; } public virtual void SetTitle(string title) @@ -76,4 +81,19 @@ public class BlogPost : FullAuditedAggregateRoot, IMultiTenant { Content = Check.Length(content, nameof(content), BlogPostConsts.MaxContentLength); } + + public virtual void SetDraft() + { + Status = BlogPostStatus.Draft; + } + + public virtual void SetPublished() + { + Status = BlogPostStatus.Published; + } + + public virtual void SetWaitingForReview() + { + Status = BlogPostStatus.WaitingForReview; + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs index a19643308d..9e21078707 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs @@ -30,6 +30,7 @@ public class BlogPostManager : DomainService [NotNull] Blog blog, [NotNull] string title, [NotNull] string slug, + [NotNull] BlogPostStatus status, [CanBeNull] string shortDescription = null, [CanBeNull] string content = null, [CanBeNull] Guid? coverImageMediaId = null) @@ -40,17 +41,18 @@ public class BlogPostManager : DomainService Check.NotNullOrEmpty(slug, nameof(slug)); var blogPost = new BlogPost( - GuidGenerator.Create(), - blog.Id, - author.Id, - title, - slug, - shortDescription, - content, - coverImageMediaId, - CurrentTenant.Id - ); - + GuidGenerator.Create(), + blog.Id, + author.Id, + title, + slug, + shortDescription, + content, + coverImageMediaId, + CurrentTenant.Id, + status + ); + await CheckSlugExistenceAsync(blog.Id, blogPost.Slug); return blogPost; diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs index 7d08f0d3fd..1eec1100f2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/DefaultBlogFeatureProvider.cs @@ -16,6 +16,7 @@ public class DefaultBlogFeatureProvider : IDefaultBlogFeatureProvider, ITransien new BlogFeature(blogId, ReactionsFeature.Name), new BlogFeature(blogId, RatingsFeature.Name), new BlogFeature(blogId, TagsFeature.Name), + new BlogFeature(blogId, BlogPostScrollIndexFeature.Name) }); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs index 1854353429..8ce64ac4df 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogFeatureRepository.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -9,9 +10,9 @@ namespace Volo.CmsKit.Blogs; public interface IBlogFeatureRepository : IBasicRepository { - Task> GetListAsync(Guid blogId); + Task> GetListAsync(Guid blogId, CancellationToken cancellationToken = default); - Task> GetListAsync(Guid blogId, List featureNames); + Task> GetListAsync(Guid blogId, List featureNames, CancellationToken cancellationToken = default); - Task FindAsync(Guid blogId, string featureName); + Task FindAsync(Guid blogId, string featureName, CancellationToken cancellationToken = default); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs index 8b1e86f8b7..2af1036162 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/IBlogPostRepository.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; +using Volo.CmsKit.Users; namespace Volo.CmsKit.Blogs; @@ -11,11 +12,15 @@ public interface IBlogPostRepository : IBasicRepository Task GetCountAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, CancellationToken cancellationToken = default); Task> GetListAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, int maxResultCount = int.MaxValue, int skipCount = 0, string sorting = null, @@ -24,4 +29,17 @@ public interface IBlogPostRepository : IBasicRepository Task SlugExistsAsync(Guid blogId, string slug, CancellationToken cancellationToken = default); Task GetBySlugAsync(Guid blogId, string slug, CancellationToken cancellationToken = default); -} + + Task> GetAuthorsHasBlogPostsAsync( + int skipCount, + int maxResultCount, + string sorting, + string filter, + CancellationToken cancellationToken = default); + + Task GetAuthorsHasBlogPostsCountAsync(string filter, CancellationToken cancellationToken = default); + + Task GetAuthorHasBlogPostAsync(Guid id, CancellationToken cancellationToken = default); + + Task HasBlogPostWaitingForReviewAsync(CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/ITagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/ITagRepository.cs index 7ac48eeb1a..e74b767078 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/ITagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/ITagRepository.cs @@ -24,9 +24,13 @@ public interface ITagRepository : IBasicRepository [NotNull] string name, CancellationToken cancellationToken = default); - Task> GetListAsync(string filter); + Task> GetListAsync( + string filter, + CancellationToken cancellationToken = default); - Task GetCountAsync(string filter); + Task GetCountAsync( + string filter, + CancellationToken cancellationToken = default); Task> GetAllRelatedTagsAsync( [NotNull] string entityType, diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs index 8c674e11f5..3f0a9cf726 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogFeatureRepository.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -15,22 +16,22 @@ public class EfCoreBlogFeatureRepository : EfCoreRepository FindAsync(Guid blogId, string featureName) + public Task FindAsync(Guid blogId, string featureName, CancellationToken cancellationToken = default) { - return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName); + return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName, cancellationToken: cancellationToken); } - public async Task> GetListAsync(Guid blogId) + public async Task> GetListAsync(Guid blogId, CancellationToken cancellationToken = default) { return await (await GetQueryableAsync()) .Where(x => x.BlogId == blogId) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task> GetListAsync(Guid blogId, List featureNames) + public async Task> GetListAsync(Guid blogId, List featureNames, CancellationToken cancellationToken = default) { return await (await GetQueryableAsync()) .Where(x => x.BlogId == blogId && featureNames.Contains(x.FeatureName)) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs index f0a6aa61ee..0c359debcc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Blogs/EfCoreBlogPostRepository.cs @@ -7,6 +7,7 @@ using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.EntityFrameworkCore; @@ -41,11 +42,15 @@ public class EfCoreBlogPostRepository : EfCoreRepository GetCountAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, CancellationToken cancellationToken = default) { var queryable = (await GetDbSetAsync()) - .WhereIf(blogId.HasValue, x => x.BlogId == blogId) - .WhereIf(!string.IsNullOrEmpty(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)); + .WhereIf(blogId.HasValue, x => x.BlogId == blogId) + .WhereIf(authorId.HasValue, x => x.AuthorId == authorId) + .WhereIf(statusFilter.HasValue, x => x.Status == statusFilter) + .WhereIf(!string.IsNullOrEmpty(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)); var count = await queryable.CountAsync(GetCancellationToken(cancellationToken)); return count; @@ -54,6 +59,8 @@ public class EfCoreBlogPostRepository : EfCoreRepository> GetListAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, int maxResultCount = int.MaxValue, int skipCount = 0, string sorting = null, @@ -66,7 +73,9 @@ public class EfCoreBlogPostRepository : EfCoreRepository x.BlogId == blogId) - .WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)); + .WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)) + .WhereIf(authorId.HasValue, x => x.AuthorId == authorId) + .WhereIf(statusFilter.HasValue, x => x.Status == statusFilter); queryable = queryable.OrderBy(sorting.IsNullOrEmpty() ? $"{nameof(BlogPost.CreationTime)} desc" : sorting); @@ -95,4 +104,38 @@ public class EfCoreBlogPostRepository : EfCoreRepository x.BlogId == blogId && x.Slug.ToLower() == slug, GetCancellationToken(cancellationToken)); } + + public async Task> GetAuthorsHasBlogPostsAsync(int skipCount, int maxResultCount, string sorting, string filter, CancellationToken cancellationToken = default) + { + return await (await CreateAuthorsQueryableAsync()) + .Skip(skipCount) + .Take(maxResultCount) + .WhereIf(!filter.IsNullOrEmpty(), x => x.UserName.Contains(filter.ToLower())) + .OrderBy(sorting.IsNullOrEmpty() ? nameof(CmsUser.UserName) : sorting) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async Task GetAuthorsHasBlogPostsCountAsync(string filter, CancellationToken cancellationToken = default) + { + return await (await CreateAuthorsQueryableAsync()) + .WhereIf(!filter.IsNullOrEmpty(), x => x.UserName.Contains(filter.ToLower())) + .CountAsync(GetCancellationToken(cancellationToken)); + } + + public async Task GetAuthorHasBlogPostAsync(Guid id, CancellationToken cancellationToken = default) + { + return await (await CreateAuthorsQueryableAsync()).FirstOrDefaultAsync(x => x.Id == id, GetCancellationToken(cancellationToken)) + ?? throw new EntityNotFoundException(typeof(CmsUser), id); + } + + private async Task> CreateAuthorsQueryableAsync() + { + return (await GetDbContextAsync()).BlogPosts.Select(x => x.Author).Distinct(); + } + + public virtual async Task HasBlogPostWaitingForReviewAsync(CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .AnyAsync(x => x.Status == BlogPostStatus.WaitingForReview, GetCancellationToken(cancellationToken)); + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs index a405612f39..fca31f2d73 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs @@ -26,6 +26,7 @@ public interface ICmsKitDbContext : IEfCoreDbContext DbSet Pages { get; } DbSet Blogs { get; } DbSet BlogPosts { get; } + DbSet BlogFeatures { get; } DbSet MediaDescriptors { get; } DbSet MenuItems { get; } DbSet GlobalResources { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs index dc026b32aa..9b750eaac5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs @@ -80,14 +80,14 @@ public class EfCoreTagRepository : EfCoreRepository return await query.ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); } - public async Task> GetListAsync(string filter) + public async Task> GetListAsync(string filter, CancellationToken cancellationToken = default) { - return await (await GetQueryableByFilterAsync(filter)).ToListAsync(); + return await (await GetQueryableByFilterAsync(filter)).ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync(string filter) + public async Task GetCountAsync(string filter, CancellationToken cancellationToken = default) { - return await (await GetQueryableByFilterAsync(filter)).CountAsync(); + return await (await GetQueryableByFilterAsync(filter)).CountAsync(GetCancellationToken(cancellationToken)); } private async Task> GetQueryableByFilterAsync(string filter) diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs index 45253b3991..334debe8c8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogFeatureRepository.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using MongoDB.Driver.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; @@ -17,22 +18,22 @@ public class MongoBlogFeatureRepository : MongoDbRepository FindAsync(Guid blogId, string featureName) + public Task FindAsync(Guid blogId, string featureName, CancellationToken cancellationToken = default) { - return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName); + return base.FindAsync(x => x.BlogId == blogId && x.FeatureName == featureName, cancellationToken: cancellationToken); } - public virtual async Task> GetListAsync(Guid blogId) + public virtual async Task> GetListAsync(Guid blogId, CancellationToken cancellationToken = default) { - return await (await GetMongoQueryableAsync()) + return await (await GetMongoQueryableAsync(cancellationToken)) .Where(x => x.BlogId == blogId) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); } - public virtual async Task> GetListAsync(Guid blogId, List featureNames) + public virtual async Task> GetListAsync(Guid blogId, List featureNames, CancellationToken cancellationToken = default) { - return await (await GetMongoQueryableAsync()) + return await (await GetMongoQueryableAsync(cancellationToken)) .Where(x => x.BlogId == blogId && featureNames.Contains(x.FeatureName)) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs index f52dc3add4..129c5e10b7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogPostRepository.cs @@ -8,6 +8,7 @@ using System.Linq.Dynamic.Core; using System.Threading; using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Blogs; @@ -42,33 +43,41 @@ public class MongoBlogPostRepository : MongoDbRepository GetCountAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, CancellationToken cancellationToken = default) { - var token = GetCancellationToken(cancellationToken); + cancellationToken = GetCancellationToken(cancellationToken); - return await (await GetMongoQueryableAsync(token)) + return await (await GetMongoQueryableAsync(cancellationToken)) .WhereIf>(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)) .WhereIf>(blogId.HasValue, x => x.BlogId == blogId) - .CountAsync(GetCancellationToken(cancellationToken)); + .WhereIf>(authorId.HasValue, x => x.AuthorId == authorId) + .WhereIf>(statusFilter.HasValue, x => x.Status == statusFilter) + .CountAsync(cancellationToken); } public virtual async Task> GetListAsync( string filter = null, Guid? blogId = null, + Guid? authorId = null, + BlogPostStatus? statusFilter = null, int maxResultCount = int.MaxValue, int skipCount = 0, string sorting = null, CancellationToken cancellationToken = default) { - var token = GetCancellationToken(cancellationToken); - var dbContext = await GetDbContextAsync(token); + cancellationToken = GetCancellationToken(cancellationToken); + var dbContext = await GetDbContextAsync(cancellationToken); var blogPostQueryable = await GetQueryableAsync(); var usersQueryable = dbContext.Collection().AsQueryable(); var queryable = blogPostQueryable .WhereIf(blogId.HasValue, x => x.BlogId == blogId) - .WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)); + .WhereIf(!string.IsNullOrWhiteSpace(filter), x => x.Title.Contains(filter) || x.Slug.Contains(filter)) + .WhereIf(authorId.HasValue, x => x.AuthorId == authorId) + .WhereIf(statusFilter.HasValue, x => x.Status == statusFilter); queryable = queryable.OrderBy(sorting.IsNullOrEmpty() ? $"{nameof(BlogPost.CreationTime)} desc" : sorting); @@ -81,7 +90,7 @@ public class MongoBlogPostRepository : MongoDbRepository { @@ -95,8 +104,59 @@ public class MongoBlogPostRepository : MongoDbRepository x.BlogId == blogId && x.Slug.ToLower() == slug, token); + cancellationToken = GetCancellationToken(cancellationToken); + var queryable = await GetMongoQueryableAsync(cancellationToken); + return await queryable.AnyAsync(x => x.BlogId == blogId && x.Slug.ToLower() == slug, cancellationToken); + } + + public async Task> GetAuthorsHasBlogPostsAsync(int skipCount, int maxResultCount, string sorting, string filter, CancellationToken cancellationToken = default) + { + var queryable = (await CreateAuthorsQueryableAsync(cancellationToken)) + .Skip(skipCount) + .Take(maxResultCount) + .OrderBy(sorting.IsNullOrEmpty() ? nameof(CmsUser.UserName) : sorting) + .WhereIf(!filter.IsNullOrEmpty(), x => x.UserName.Contains(filter.ToLower())); + + return await AsyncExecuter.ToListAsync(queryable, GetCancellationToken(cancellationToken)); + } + + public async Task GetAuthorsHasBlogPostsCountAsync(string filter, CancellationToken cancellationToken = default) + { + return await AsyncExecuter.CountAsync( + (await CreateAuthorsQueryableAsync(cancellationToken)) + .WhereIf(!filter.IsNullOrEmpty(), x => x.UserName.Contains(filter.ToLower()))); + } + + public async Task GetAuthorHasBlogPostAsync(Guid id, CancellationToken cancellationToken = default) + { + return await AsyncExecuter.FirstOrDefaultAsync(await CreateAuthorsQueryableAsync(cancellationToken), x => x.Id == id) + ?? throw new EntityNotFoundException(typeof(CmsUser), id); + } + + private async Task> CreateAuthorsQueryableAsync(CancellationToken cancellationToken = default) + { + cancellationToken = GetCancellationToken(cancellationToken); + + var blogPostQueryable = (await GetQueryableAsync()) + .Where(x => x.Status == BlogPostStatus.Published); + + var usersQueryable = (await GetDbContextAsync(cancellationToken)).Collection().AsQueryable(); + + return blogPostQueryable + .Join( + usersQueryable, + o => o.AuthorId, + i => i.Id, + (blogPost, user) => new { blogPost, user }) + .Select(s => s.user) + .Distinct(); + } + + public virtual async Task HasBlogPostWaitingForReviewAsync(CancellationToken cancellationToken = default) + { + cancellationToken = GetCancellationToken(cancellationToken); + + return await (await GetMongoQueryableAsync(cancellationToken)) + .AnyAsync(x => x.Status == BlogPostStatus.WaitingForReview, cancellationToken); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs index 00d12a0246..b34c452621 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Blogs/MongoBlogRepository.cs @@ -66,7 +66,7 @@ public class MongoBlogRepository : MongoDbRepository> GetListQueryAsync(string filter = null, CancellationToken cancellationToken = default) { - return (await GetMongoQueryableAsync(GetCancellationToken(cancellationToken))) + return (await GetMongoQueryableAsync(cancellationToken)) .WhereIf(!filter.IsNullOrWhiteSpace(), b => b.Name.Contains(filter)); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs index 2230c36f19..6b4be3dbbf 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoTagRepository.cs @@ -82,19 +82,19 @@ public class MongoTagRepository : MongoDbRepository> GetListAsync(string filter) + public async Task> GetListAsync(string filter, CancellationToken cancellationToken = default) { - return await (await GetQueryableByFilterAsync(filter)).ToListAsync(); + return await (await GetQueryableByFilterAsync(filter, cancellationToken)).ToListAsync(GetCancellationToken(cancellationToken)); } - public async Task GetCountAsync(string filter) + public async Task GetCountAsync(string filter, CancellationToken cancellationToken = default) { - return await (await GetQueryableByFilterAsync(filter)).CountAsync(); + return await (await GetQueryableByFilterAsync(filter, cancellationToken)).CountAsync(GetCancellationToken(cancellationToken)); } - private async Task> GetQueryableByFilterAsync(string filter) + private async Task> GetQueryableByFilterAsync(string filter, CancellationToken cancellationToken = default) { - var mongoQueryable = await GetMongoQueryableAsync(); + var mongoQueryable = await GetMongoQueryableAsync(cancellationToken: cancellationToken); if (!filter.IsNullOrWhiteSpace()) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostFilteredPagedAndSortedResultRequestDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostFilteredPagedAndSortedResultRequestDto.cs new file mode 100644 index 0000000000..cb930ea37c --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostFilteredPagedAndSortedResultRequestDto.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Application.Dtos; + +namespace Volo.CmsKit.Public.Blogs; + +public class BlogPostFilteredPagedAndSortedResultRequestDto : PagedAndSortedResultRequestDto +{ + public string Filter { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostGetListInput.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostGetListInput.cs new file mode 100644 index 0000000000..b471171f3b --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostGetListInput.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Volo.CmsKit.Public.Blogs; + +public class BlogPostGetListInput : PagedAndSortedResultRequestDto +{ + public Guid? AuthorId { get; set; } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs index f561a289cf..42161f884c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs @@ -1,13 +1,20 @@ -using JetBrains.Annotations; +using System.Collections.Generic; +using JetBrains.Annotations; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.CmsKit.Users; +using System; namespace Volo.CmsKit.Public.Blogs; public interface IBlogPostPublicAppService : IApplicationService { - Task> GetListAsync([NotNull] string blogSlug, PagedAndSortedResultRequestDto input); + Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input); Task GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug); + + Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input); + + Task GetAuthorHasBlogPostAsync(Guid id); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo.CmsKit.Public.Application.csproj b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo.CmsKit.Public.Application.csproj index 702523e3c6..0e192cec7a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo.CmsKit.Public.Application.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo.CmsKit.Public.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs index 4160639815..94847fba11 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs @@ -1,10 +1,12 @@ using JetBrains.Annotations; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Blogs; @@ -32,14 +34,32 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub return ObjectMapper.Map(blogPost); } - public virtual async Task> GetListAsync([NotNull] string blogSlug, PagedAndSortedResultRequestDto input) + public virtual async Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); - var blogPosts = await BlogPostRepository.GetListAsync(null, blog.Id, input.MaxResultCount, input.SkipCount, input.Sorting); + var blogPosts = await BlogPostRepository.GetListAsync(null, blog.Id, input.AuthorId, BlogPostStatus.Published, input.MaxResultCount, + input.SkipCount, input.Sorting); return new PagedResultDto( - await BlogPostRepository.GetCountAsync(blogId: blog.Id), + await BlogPostRepository.GetCountAsync(blogId: blog.Id, statusFilter: BlogPostStatus.Published, authorId: input.AuthorId), ObjectMapper.Map, List>(blogPosts)); } + + public virtual async Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input) + { + var authors = await BlogPostRepository.GetAuthorsHasBlogPostsAsync(input.SkipCount, input.MaxResultCount, input.Sorting, input.Filter); + var authorDtos = ObjectMapper.Map, List>(authors); + + return new PagedResultDto( + await BlogPostRepository.GetAuthorsHasBlogPostsCountAsync(input.Filter), + authorDtos); + } + + public async Task GetAuthorHasBlogPostAsync(Guid id) + { + var author = await BlogPostRepository.GetAuthorHasBlogPostAsync(id); + + return ObjectMapper.Map(author); + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs index c96e37f579..b1bbf6be07 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs @@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; using Volo.CmsKit.Public.Blogs; +using Volo.CmsKit.Users; // ReSharper disable once CheckNamespace namespace Volo.CmsKit.Public.Blogs.ClientProxies; @@ -24,12 +25,28 @@ public partial class BlogPostPublicClientProxy : ClientProxyBase> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input) + public virtual async Task> GetListAsync(string blogSlug, BlogPostGetListInput input) { return await RequestAsync>(nameof(GetListAsync), new ClientProxyRequestTypeValue { { typeof(string), blogSlug }, - { typeof(PagedAndSortedResultRequestDto), input } + { typeof(BlogPostGetListInput), input } + }); + } + + public virtual async Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input) + { + return await RequestAsync>(nameof(GetAuthorsHasBlogPostsAsync), new ClientProxyRequestTypeValue + { + { typeof(BlogPostFilteredPagedAndSortedResultRequestDto), input } + }); + } + + public virtual async Task GetAuthorHasBlogPostAsync(Guid id) + { + return await RequestAsync(nameof(GetAuthorHasBlogPostAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } }); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json index f2ff050759..d39e795845 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json @@ -957,9 +957,9 @@ }, { "name": "input", - "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", - "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "typeAsString": "Volo.CmsKit.Public.Blogs.BlogPostGetListInput, Volo.CmsKit.Public.Application.Contracts", + "type": "Volo.CmsKit.Public.Blogs.BlogPostGetListInput", + "typeSimple": "Volo.CmsKit.Public.Blogs.BlogPostGetListInput", "isOptional": false, "defaultValue": null } @@ -977,6 +977,30 @@ "bindingSourceId": "Path", "descriptorName": "" }, + { + "nameOnMethod": "input", + "name": "AuthorId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, { "nameOnMethod": "input", "name": "SkipCount", @@ -1000,6 +1024,43 @@ "constraintTypes": null, "bindingSourceId": "ModelBinding", "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": null, + "implementFrom": "Volo.CmsKit.Public.Blogs.IBlogPostPublicAppService" + }, + "GetAuthorsHasBlogPostsAsyncByInput": { + "uniqueName": "GetAuthorsHasBlogPostsAsyncByInput", + "name": "GetAuthorsHasBlogPostsAsync", + "httpMethod": "GET", + "url": "api/cms-kit-public/blog-posts/authors", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.CmsKit.Public.Blogs.BlogPostFilteredPagedAndSortedResultRequestDto, Volo.CmsKit.Public.Application.Contracts", + "type": "Volo.CmsKit.Public.Blogs.BlogPostFilteredPagedAndSortedResultRequestDto", + "typeSimple": "Volo.CmsKit.Public.Blogs.BlogPostFilteredPagedAndSortedResultRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" }, { "nameOnMethod": "input", @@ -1012,11 +1073,72 @@ "constraintTypes": null, "bindingSourceId": "ModelBinding", "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" } ], "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + }, + "allowAnonymous": null, + "implementFrom": "Volo.CmsKit.Public.Blogs.IBlogPostPublicAppService" + }, + "GetAuthorHasBlogPostAsyncById": { + "uniqueName": "GetAuthorHasBlogPostAsyncById", + "name": "GetAuthorHasBlogPostAsync", + "httpMethod": "GET", + "url": "api/cms-kit-public/blog-posts/authors/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.CmsKit.Users.CmsUserDto", + "typeSimple": "Volo.CmsKit.Users.CmsUserDto" }, "allowAnonymous": null, "implementFrom": "Volo.CmsKit.Public.Blogs.IBlogPostPublicAppService" diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs index bdd0b2cf32..9f43d65766 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs @@ -1,11 +1,13 @@ using Microsoft.AspNetCore.Mvc; using System; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Content; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.GlobalFeatures; +using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Blogs; @@ -31,8 +33,22 @@ public class BlogPostPublicController : CmsKitPublicControllerBase, IBlogPostPub [HttpGet] [Route("{blogSlug}")] - public virtual Task> GetListAsync(string blogSlug, PagedAndSortedResultRequestDto input) + public virtual Task> GetListAsync(string blogSlug, BlogPostGetListInput input) { return BlogPostPublicAppService.GetListAsync(blogSlug, input); } -} + + [HttpGet] + [Route("authors")] + public Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input) + { + return BlogPostPublicAppService.GetAuthorsHasBlogPostsAsync(input); + } + + [HttpGet] + [Route("authors/{id}")] + public Task GetAuthorHasBlogPostAsync(Guid id) + { + return BlogPostPublicAppService.GetAuthorHasBlogPostAsync(id); + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml index d8c1f428da..62670a742d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml @@ -16,92 +16,133 @@ @inject IMarkdownToHtmlRenderer MarkdownRenderer + +@{ + string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.BlogPost.Title; + var isScrollIndexEnabled = GlobalFeatureManager.Instance.IsEnabled() && Model.BlogPostScrollIndexFeature?.IsEnabled == true; +} + @section styles{ - - - - + @if (isScrollIndexEnabled) + { + + + + } + + + + } @section scripts{ - - - - -} + @if (isScrollIndexEnabled) + { + + + + + } -@{ - string dummyImageSource = "https://dummyimage.com/1280x720/a3a3a3/fff.png?text=" + Model.BlogPost.Title; + + + + } - - - - -
-

@Model.BlogPost.Title

-

- @@@Model.BlogPost.Author?.UserName - @Model.BlogPost.CreationTime -

- - @if(!Model.BlogPost.Content.IsNullOrEmpty()) - { - @Html.Raw(await MarkdownRenderer.RenderAsync(Model.BlogPost.Content)) - } - -

- @if (Model.BlogPost.LastModificationTime != null) - { - @L["LastModification"].Value : @Model.BlogPost.LastModificationTime - } -

-
- - @if (GlobalFeatureManager.Instance.IsEnabled()) - { - if (Model.TagsFeature?.IsEnabled == true) - { - @await Component.InvokeAsync(typeof(TagViewComponent), new - { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) - } - } -
-
- - - - @if (GlobalFeatureManager.Instance.IsEnabled()) - { - if (Model.ReactionsFeature?.IsEnabled == true) - { - @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new + +
+
+ + + + +
+

@Model.BlogPost.Title

+

+ + @@@Model.BlogPost.Author?.UserName + + @Model.BlogPost.CreationTime +

+ @if (!Model.BlogPost.Content.IsNullOrEmpty()) + { + @Html.Raw(await MarkdownRenderer.RenderAsync(Model.BlogPost.Content)) + } + +

+ @if (Model.BlogPost.LastModificationTime != null) + { + @L["LastModification"].Value : @Model.BlogPost.LastModificationTime + } +

+
+ + @if (GlobalFeatureManager.Instance.IsEnabled()) + { + if (Model.TagsFeature?.IsEnabled == true) + { + @await Component.InvokeAsync(typeof(TagViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } + } +
+
+ + + + @if (GlobalFeatureManager.Instance.IsEnabled()) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) - } - } - - - @if (GlobalFeatureManager.Instance.IsEnabled()) - { - if (Model.RatingsFeature?.IsEnabled == true) - { - @await Component.InvokeAsync(typeof(RatingViewComponent), new + if (Model.ReactionsFeature?.IsEnabled == true) + { + @await Component.InvokeAsync(typeof(ReactionSelectionViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } + } + + + @if (GlobalFeatureManager.Instance.IsEnabled()) { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.BlogPost.Id.ToString() - }) - } - } - - -
-
+ if (Model.RatingsFeature?.IsEnabled == true) + { + @await Component.InvokeAsync(typeof(RatingViewComponent), new + { + entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, + entityId = Model.BlogPost.Id.ToString() + }) + } + } + + + + +
+ @if (isScrollIndexEnabled) + { +
+
+
@L["InThisDocument"]
+ + + +
+
+ } + +
@if (GlobalFeatureManager.Instance.IsEnabled()) { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs index a00359da0f..dcefb976a4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs @@ -30,6 +30,8 @@ public class BlogPostModel : CmsKitPublicPageModelBase public BlogFeatureDto RatingsFeature { get; private set; } public BlogFeatureDto TagsFeature { get; private set; } + + public BlogFeatureDto BlogPostScrollIndexFeature { get; private set; } protected IBlogPostPublicAppService BlogPostPublicAppService { get; } @@ -66,5 +68,10 @@ public class BlogPostModel : CmsKitPublicPageModelBase { TagsFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.TagsFeature.Name); } + + if (GlobalFeatureManager.Instance.IsEnabled()) + { + BlogPostScrollIndexFeature = await BlogFeatureAppService.GetOrDefaultAsync(BlogPost.BlogId, GlobalFeatures.BlogPostScrollIndexFeature.Name); + } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml index 32c5585f8e..060f0c5c95 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml @@ -8,12 +8,42 @@ @model IndexModel @section styles{ - + } + +@section scripts { + + + +} + @{ const string dummyImageSource = "https://dummyimage.com/320x180/a3a3a3/fff.png"; } + + +
+ + + +
+
+
@foreach (var blog in Model.Blogs.Items) { @@ -21,16 +51,16 @@ @if (blog.CoverImageMediaId != null) { - + } else { - + }
@blog.Title

- @@@blog.Author?.UserName + @@@blog.Author?.UserName @blog.CreationTime

@blog.ShortDescription

@@ -42,11 +72,10 @@
- }
- + - \ No newline at end of file + diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs index 30d4c6bcf2..c7f667382b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination; using Volo.CmsKit.Public.Blogs; +using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Blogs; @@ -20,10 +21,15 @@ public class IndexModel : CmsKitPublicPageModelBase [BindProperty(SupportsGet = true)] public int CurrentPage { get; set; } = 1; + [BindProperty(SupportsGet = true)] + public Guid? AuthorId { get; set; } + public PagedResultDto Blogs { get; private set; } public PagerModel PagerModel => new PagerModel(Blogs.TotalCount, Blogs.Items.Count, CurrentPage, PageSize, Request.Path.ToString()); + public CmsUserDto SelectedAuthor { get; set; } + protected IBlogPostPublicAppService BlogPostPublicAppService { get; } public IndexModel(IBlogPostPublicAppService blogPostPublicAppService) @@ -35,10 +41,16 @@ public class IndexModel : CmsKitPublicPageModelBase { Blogs = await BlogPostPublicAppService.GetListAsync( BlogSlug, - new PagedAndSortedResultRequestDto + new BlogPostGetListInput { SkipCount = PageSize * (CurrentPage - 1), - MaxResultCount = PageSize + MaxResultCount = PageSize, + AuthorId = AuthorId }); + + if (AuthorId != null) + { + SelectedAuthor = await BlogPostPublicAppService.GetAuthorHasBlogPostAsync(AuthorId.Value); + } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.css b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.css index 98c4a3100d..d09be3150d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.css +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogPost.css @@ -20,4 +20,21 @@ span.area-title { } .popover { min-width: 276px; +} + +#scroll-index { + position: sticky; + top: 20px; +} + +#scroll-index .scroll-top-btn.showup{ + display: block; +} + +#scroll-index .scroll-top-btn{ + display: none; + font-size: .85em; + color: #aaa; + text-decoration: none; + padding-left: 18px; } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogpost-scroll-index.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogpost-scroll-index.js new file mode 100644 index 0000000000..603649e2c9 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/blogpost-scroll-index.js @@ -0,0 +1,46 @@ +$(function () { + var $myNav = $('#blog-post-sticky-index'); + var $scrollToTopBtn = $('.scroll-top-btn'); + + window.Toc.helpers.createNavList = function () { + return $(''); + }; + + window.Toc.helpers.createChildNavList = function ($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }; + + window.Toc.helpers.generateNavEl = function (anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $(''); + $li.append($a); + return $li; + }; + + Toc.init($myNav); + + $('body').scrollspy({ + target: $myNav, + }); + + $scrollToTopBtn.click(function () { + $('html, body').animate({scrollTop: 0}, 'fast'); + }); + + // When the user scrolls down 20px from the top of the document, show the button + window.onscroll = function () { + scrollFunction() + }; + + function scrollFunction() { + if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { + $scrollToTopBtn.addClass('showup'); + } else { + $scrollToTopBtn.removeClass('showup'); + } + } +}); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.css b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.css new file mode 100644 index 0000000000..b15e18ee85 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v<%= version %> (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav-link.active, +nav[data-toggle='toc'] .nav-link.active:hover, +nav[data-toggle='toc'] .nav-link.active:focus { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav-link + ul { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > li > .active, +nav[data-toggle='toc'] .nav .nav > li > .active:hover, +nav[data-toggle='toc'] .nav .nav > li > .active:focus { + padding-left: 28px; + font-weight: 500; +} + +nav[data-toggle='toc'] .nav-link.active + ul { + display: block; +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.js new file mode 100644 index 0000000000..13a4d1f6a5 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/bootstrap-toc.js @@ -0,0 +1,168 @@ +/*! + * Bootstrap Table of Contents v1.0.0 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function ($) { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function ($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el + .filter(selector) + .add($descendants) + .filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function (el) { + var text = $(el).text(); + var anchor = text + .trim() + .toLowerCase() + .replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function (el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function (el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function () { + return $(''); + }, + + createChildNavList: function ($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function (anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function (headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function ($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function ($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter( + $scope, + topSelector + ',' + secondarySelector + ); + }, + + getNavLevel: function (el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function ($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function (i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function (arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg, + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + }, + }, + + // accepts a jQuery object, or an options object + init: function (opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + }, + }; + + $(function () { + $('nav[data-toggle="toc"]').each(function (i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(jQuery); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.css b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.css index 161bb41190..19137de2cb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.css +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.css @@ -3,4 +3,8 @@ .popover { min-width: 276px; +} + +.author-name-span{ + cursor: pointer; } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.js b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.js new file mode 100644 index 0000000000..0d567d1650 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/index.js @@ -0,0 +1,18 @@ +$(function () { + var $selectAuthor = $('#AuthorSelect'); + var $authorNameSpan = $('.author-name-span'); + + $selectAuthor.on('change', function () { + var authorId = $selectAuthor.val(); + reloadPageWithQueryString({'authorId': authorId}); + }); + + $authorNameSpan.click(function () { + var authorId = $(this).data('author-id'); + reloadPageWithQueryString({'authorId': authorId}); + }); + + function reloadPageWithQueryString(param) { + window.location.href = window.location.pathname + "?" + $.param(param); + } +}); diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs index 1910e3b925..bc5d6b2a5e 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs @@ -156,4 +156,86 @@ public class BlogPostAdminAppService_Tests : CmsKitApplicationTestBase exception.EntityType.ShouldBe(typeof(BlogPost)); exception.Id.ShouldBe(cmsKitTestData.Page_2_Id); } + + [Fact] + public async Task PublishAsync_ShouldWorkProperly() + { + var newPost = await CreateBlogPost(); + newPost.Status.ShouldBe(BlogPostStatus.Draft); + + await blogPostAdminAppService.PublishAsync(newPost.Id); + var post = await blogPostAdminAppService.GetAsync(newPost.Id); + post.Status.ShouldBe(BlogPostStatus.Published); + } + + [Fact] + public async Task DraftAsync_ShouldWorkProperly() + { + var newPost = await CreateBlogPost(); + newPost.Status.ShouldBe(BlogPostStatus.Draft); + + await blogPostAdminAppService.PublishAsync(newPost.Id); + var post = await blogPostAdminAppService.GetAsync(newPost.Id); + post.Status.ShouldBe(BlogPostStatus.Published); + + await blogPostAdminAppService.DraftAsync(newPost.Id); + post = await blogPostAdminAppService.GetAsync(newPost.Id); + post.Status.ShouldBe(BlogPostStatus.Draft); + } + + [Fact] + public async Task CreateAndPublishAsync_ShouldWorkProperly() + { + var title = "My awesome new Post"; + var slug = "my-awesome-new-post"; + var shortDescription = "This blog is all about awesomeness 🤗!"; + var content = "Another blog post shared on internet"; + + var created = await blogPostAdminAppService.CreateAndPublishAsync(new CreateBlogPostDto + { + BlogId = cmsKitTestData.Blog_Id, + Title = title, + Slug = slug, + ShortDescription = shortDescription, + Content = content + }); + + created.Id.ShouldNotBe(Guid.Empty); + created.Status.ShouldBe(BlogPostStatus.Published); + + var blogPost = await blogPostRepository.GetAsync(created.Id); + + blogPost.Title.ShouldBe(title); + blogPost.Slug.ShouldBe(slug); + blogPost.ShortDescription.ShouldBe(shortDescription); + blogPost.Content.ShouldBe(content); + blogPost.Status.ShouldBe(BlogPostStatus.Published); + } + + private async Task CreateBlogPost() + { + var title = "My awesome new Post"; + var slug = "my-awesome-new-post"; + var shortDescription = "This blog is all about awesomeness 🤗!"; + var content = "Another blog post shared on internet"; + + var created = await blogPostAdminAppService.CreateAsync(new CreateBlogPostDto + { + BlogId = cmsKitTestData.Blog_Id, + Title = title, + Slug = slug, + ShortDescription = shortDescription, + Content = content + }); + + created.Id.ShouldNotBe(Guid.Empty); + + var blogPost = await blogPostRepository.GetAsync(created.Id); + + blogPost.Title.ShouldBe(title); + blogPost.Slug.ShouldBe(slug); + blogPost.ShortDescription.ShouldBe(shortDescription); + blogPost.Content.ShouldBe(content); + return created; + } } diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostPublicAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostPublicAppService_Tests.cs index 2301941920..677e1ac086 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostPublicAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostPublicAppService_Tests.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities; using Volo.CmsKit.Public.Blogs; +using Volo.CmsKit.Users; using Xunit; namespace Volo.CmsKit.Blogs; @@ -17,16 +18,26 @@ public class BlogPostPublicAppService_Tests : CmsKitApplicationTestBase private readonly CmsKitTestData cmsKitTestData; + private readonly ICmsUserRepository userRepository; + + private readonly IBlogRepository blogRepository; + private readonly IBlogPostRepository blogPostRepository; + + private readonly BlogPostManager blogPostManager; public BlogPostPublicAppService_Tests() { blogPostAppService = GetRequiredService(); cmsKitTestData = GetRequiredService(); + userRepository = GetRequiredService(); + blogRepository = GetRequiredService(); + blogPostManager = GetRequiredService(); + blogPostRepository = GetRequiredService(); } [Fact] public async Task GetListAsync_ShouldWorkProperly_WithExistingBlog() { - var blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, new PagedAndSortedResultRequestDto { MaxResultCount = 2 }); + var blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, new BlogPostGetListInput { MaxResultCount = 2 }); blogPosts.ShouldNotBeNull(); blogPosts.TotalCount.ShouldBe(2); @@ -62,4 +73,110 @@ public class BlogPostPublicAppService_Tests : CmsKitApplicationTestBase exception.EntityType.ShouldBe(typeof(Blog)); } + + [Fact] + public async Task GetListAsync_ShouldFilterByUser() + { + var user2 = await userRepository.GetAsync(cmsKitTestData.User2Id); + var blog = await blogRepository.GetAsync(cmsKitTestData.Blog_Id); + + var blogPost = await blogPostManager.CreateAsync( + user2, + blog, + cmsKitTestData.BlogPost_1_Title + "by user2", + cmsKitTestData.BlogPost_1_Slug + "by user2", + BlogPostStatus.Published, + "Short desc 1", + "Blog Post 1 Content" + ); + + await blogPostRepository.InsertAsync(blogPost); + + //should get all not filtered by user + var blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, + new BlogPostGetListInput {}); + + blogPosts.ShouldNotBeNull(); + blogPosts.TotalCount.ShouldBe(3); + blogPosts.Items.ShouldNotBeEmpty(); + blogPosts.Items.Count.ShouldBe(3); + + //should get only one filtered by user + blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, + new BlogPostGetListInput {AuthorId = user2.Id}); + + blogPosts.ShouldNotBeNull(); + blogPosts.TotalCount.ShouldBe(1); + blogPosts.Items.ShouldNotBeEmpty(); + blogPosts.Items.Count.ShouldBe(1); + + //should get filtered by user1 + blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, + new BlogPostGetListInput {AuthorId = cmsKitTestData.User1Id}); + + blogPosts.ShouldNotBeNull(); + blogPosts.TotalCount.ShouldBe(2); + blogPosts.Items.ShouldNotBeEmpty(); + blogPosts.Items.Count.ShouldBe(2); + } + + [Fact] + public async Task GetListAsync_ShouldNotGet_UnPublishedItems() + { + var user2 = await userRepository.GetAsync(cmsKitTestData.User2Id); + var blog = await blogRepository.GetAsync(cmsKitTestData.Blog_Id); + + var draftBlogPost1 = await blogPostManager.CreateAsync( + user2, + blog, + cmsKitTestData.BlogPost_1_Title + "draft1", + cmsKitTestData.BlogPost_1_Slug + "draft1", + BlogPostStatus.Draft, + "Short desc 1", + "Blog Post 1 Content" + ); + + var draftBlogPost2 = await blogPostManager.CreateAsync( + user2, + blog, + cmsKitTestData.BlogPost_1_Title + "draft2", + cmsKitTestData.BlogPost_1_Slug + "draft2", + BlogPostStatus.Draft, + "Short desc 1", + "Blog Post 1 Content" + ); + + var publishedBlogPost1 = await blogPostManager.CreateAsync( + user2, + blog, + cmsKitTestData.BlogPost_1_Title + "published1", + cmsKitTestData.BlogPost_1_Slug + "published1", + BlogPostStatus.Published, + "Short desc 1", + "Blog Post 1 Content" + ); + + await blogPostRepository.InsertAsync(draftBlogPost1); + await blogPostRepository.InsertAsync(draftBlogPost2); + await blogPostRepository.InsertAsync(publishedBlogPost1); + + //should get all not filtered by user + var blogPosts = await blogPostAppService.GetListAsync(cmsKitTestData.BlogSlug, + new BlogPostGetListInput {}); + + blogPosts.ShouldNotBeNull(); + blogPosts.TotalCount.ShouldBe(3); + blogPosts.Items.ShouldNotBeEmpty(); + blogPosts.Items.Count.ShouldBe(3); + blogPosts.Items.Any(x => x.Id == draftBlogPost1.Id).ShouldBeFalse(); + blogPosts.Items.Any(x => x.Id == draftBlogPost2.Id).ShouldBeFalse(); + blogPosts.Items.Any(x => x.Id == publishedBlogPost1.Id).ShouldBeTrue(); + + var allItemsFromRepository = await blogPostRepository.GetListAsync(); + allItemsFromRepository.ShouldNotBeNull(); + allItemsFromRepository.Count.ShouldBe(5);//3 new added 2 already existing + allItemsFromRepository.Any(x => x.Id == draftBlogPost1.Id).ShouldBeTrue(); + allItemsFromRepository.Any(x => x.Id == draftBlogPost2.Id).ShouldBeTrue(); + allItemsFromRepository.Any(x => x.Id == publishedBlogPost1.Id).ShouldBeTrue(); + } } diff --git a/modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Blogs/BlogPostManager_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Blogs/BlogPostManager_Tests.cs index 40f552dfdb..5120138282 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Blogs/BlogPostManager_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Domain.Tests/Blogs/BlogPostManager_Tests.cs @@ -41,7 +41,7 @@ public class BlogPostManager_Tests : CmsKitDomainTestBase var blog = await blogRepository.GetAsync(cmsKitTestData.Blog_Id); - var blogPost = await blogPostManager.CreateAsync(author, blog, title, slug); + var blogPost = await blogPostManager.CreateAsync(author, blog, title, slug, BlogPostStatus.Published); blogPost.Id.ShouldNotBe(Guid.Empty); blogPost.Title.ShouldBe(title); @@ -57,7 +57,7 @@ public class BlogPostManager_Tests : CmsKitDomainTestBase var blog = await blogRepository.GetAsync(cmsKitTestData.Blog_Id); await Should.ThrowAsync(async () => - await blogPostManager.CreateAsync(author, blog, "Any New Title", cmsKitTestData.BlogPost_1_Slug)); + await blogPostManager.CreateAsync(author, blog, "Any New Title", cmsKitTestData.BlogPost_1_Slug, BlogPostStatus.Published)); } [Fact] diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogPostRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogPostRepository_Test.cs index 0479ce75b2..ccbac2d80f 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogPostRepository_Test.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Blogs/BlogPostRepository_Test.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using Volo.Abp.Domain.Entities; using Volo.Abp.Modularity; +using Volo.CmsKit.Users; using Xunit; namespace Volo.CmsKit.Blogs; @@ -15,11 +16,16 @@ public abstract class BlogPostRepository_Test : CmsKitTestBase(); blogPostRepository = GetRequiredService(); + blogPostManager = GetRequiredService(); + userRepository = GetRequiredService(); + blogRepository = GetRequiredService(); } [Fact] @@ -145,4 +151,127 @@ public abstract class BlogPostRepository_Test : CmsKitTestBase x.Id == testData.User1Id); + } + + [Fact] + public async Task ShouldCreateItem_WithDraftStatus() + { + var user2 = await userRepository.GetAsync(testData.User2Id); + var blog = await blogRepository.GetAsync(testData.Blog_Id); + + var draftPost = await blogPostManager.CreateAsync( + user2, + blog, + testData.BlogPost_1_Title + "draft", + testData.BlogPost_1_Slug + "draft", + BlogPostStatus.Draft, + "Short desc 1", + "Blog Post 1 Content" + ); + + + await blogPostRepository.InsertAsync(draftPost); + + var draftPostFromDb = await blogPostRepository.GetAsync(draftPost.Id); + + draftPostFromDb.Title.ShouldBe(draftPost.Title); + draftPostFromDb.Slug.ShouldBe(draftPost.Slug); + draftPostFromDb.ShortDescription.ShouldBe(draftPost.ShortDescription); + draftPostFromDb.Content.ShouldBe(draftPost.Content); + draftPostFromDb.Status.ShouldBe(BlogPostStatus.Draft); + } + + [Fact] + public async Task ShouldCreateItem_WithPublishedStatus() + { + var user2 = await userRepository.GetAsync(testData.User2Id); + var blog = await blogRepository.GetAsync(testData.Blog_Id); + + var publishedPost = await blogPostManager.CreateAsync( + user2, + blog, + testData.BlogPost_1_Title + "published", + testData.BlogPost_1_Slug + "published", + BlogPostStatus.Published, + "Short desc 1", + "Blog Post 1 Content" + ); + + await blogPostRepository.InsertAsync(publishedPost); + + var publishedPostFromDb = await blogPostRepository.GetAsync(publishedPost.Id); + + publishedPostFromDb.Title.ShouldBe(publishedPost.Title); + publishedPostFromDb.Slug.ShouldBe(publishedPost.Slug); + publishedPostFromDb.ShortDescription.ShouldBe(publishedPost.ShortDescription); + publishedPostFromDb.Content.ShouldBe(publishedPost.Content); + publishedPostFromDb.Status.ShouldBe(BlogPostStatus.Published); + } + + [Fact] + public async Task GetListAsync_ShouldFilter_ByStatus() + { + var user2 = await userRepository.GetAsync(testData.User2Id); + var blog = await blogRepository.GetAsync(testData.Blog_Id); + + var draftPost = await blogPostManager.CreateAsync( + user2, + blog, + testData.BlogPost_1_Title + "draft", + testData.BlogPost_1_Slug + "draft", + BlogPostStatus.Draft, + "Short desc 1", + "Blog Post 1 Content" + ); + + var publishedPost = await blogPostManager.CreateAsync( + user2, + blog, + testData.BlogPost_1_Title + "published", + testData.BlogPost_1_Slug + "published", + BlogPostStatus.Published, + "Short desc 1", + "Blog Post 1 Content" + ); + + await blogPostRepository.InsertAsync(draftPost); + await blogPostRepository.InsertAsync(publishedPost); + + var draftPostFromDb = await blogPostRepository.GetAsync(draftPost.Id); + + draftPostFromDb.Title.ShouldBe(draftPost.Title); + draftPostFromDb.Slug.ShouldBe(draftPost.Slug); + draftPostFromDb.ShortDescription.ShouldBe(draftPost.ShortDescription); + draftPostFromDb.Content.ShouldBe(draftPost.Content); + draftPostFromDb.Status.ShouldBe(BlogPostStatus.Draft); + + var publishedPostFromDb = await blogPostRepository.GetAsync(publishedPost.Id); + + publishedPostFromDb.Title.ShouldBe(publishedPost.Title); + publishedPostFromDb.Slug.ShouldBe(publishedPost.Slug); + publishedPostFromDb.ShortDescription.ShouldBe(publishedPost.ShortDescription); + publishedPostFromDb.Content.ShouldBe(publishedPost.Content); + publishedPostFromDb.Status.ShouldBe(BlogPostStatus.Published); + + var draftPosts = await blogPostRepository.GetListAsync(null, statusFilter: BlogPostStatus.Draft); + draftPosts.ShouldNotBeNull(); + draftPosts.Count.ShouldBe(1); + draftPosts.Any(x => x.Id == draftPost.Id).ShouldBeTrue(); + draftPosts.Any(x => x.Id == publishedPost.Id).ShouldBeFalse(); + + var publishedPosts = await blogPostRepository.GetListAsync(null, statusFilter: BlogPostStatus.Published); + publishedPosts.ShouldNotBeNull(); + publishedPosts.Count.ShouldBe(3);//1 new added 2 already existing + publishedPosts.Any(x => x.Id == draftPost.Id).ShouldBeFalse(); + publishedPosts.Any(x => x.Id == publishedPost.Id).ShouldBeTrue(); + } } diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs index 13414b4573..af5ee0754a 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs @@ -367,6 +367,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende blog, _cmsKitTestData.BlogPost_1_Title, _cmsKitTestData.BlogPost_1_Slug, + BlogPostStatus.Published, "Short desc 1", "Blog Post 1 Content"))).Id; @@ -377,6 +378,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende blog, _cmsKitTestData.BlogPost_2_Title, _cmsKitTestData.BlogPost_2_Slug, + BlogPostStatus.Published, "Short desc 2", "Blog Post 2 Content"))).Id; } diff --git a/modules/docs/app/VoloDocs.Web/package-lock.json b/modules/docs/app/VoloDocs.Web/package-lock.json index e764349469..9ae1d55d3d 100644 --- a/modules/docs/app/VoloDocs.Web/package-lock.json +++ b/modules/docs/app/VoloDocs.Web/package-lock.json @@ -5,251 +5,269 @@ "requires": true, "dependencies": { "@abp/anchor-js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/anchor-js/-/anchor-js-1.1.1.tgz", - "integrity": "sha512-hHyYYJ09hhT5xeQJUsBN43yT+y49FKcigq4Wrx8448TrW7r2NJD5i3Xy3BGEstNSlfcQPTsmciQnbkcU2rX1HQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/anchor-js/-/anchor-js-5.2.1.tgz", + "integrity": "sha512-61+rrfSQyZacqUJ5qQxkoWYffWcd7AArkj8DmEHmFY4e28hH3P9eXMcuGBoJ85pXleAPEmVYswc/xZiTMNHkvg==", "requires": { - "@abp/core": "^1.1.1", - "anchor-js": "^4.2.2" + "@abp/core": "~5.2.1", + "anchor-js": "^4.3.1" } }, "@abp/aspnetcore.mvc.ui": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-1.1.1.tgz", - "integrity": "sha512-wZbptVCSxZzEjkJx+/sWrH9Pikp9nOy7V8Htz+L+S7/qAzfXu5PRVV8ahddfAcDHRk30buRhdbJlCVdt6hkZ6g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.2.1.tgz", + "integrity": "sha512-VUSPOKjBSF+NxfwdsEVQte8u7mGP1t7jd1+ej2ND8JEKYJ1Vh7z2mfsT+lQaEJg0JWggU1AxkIMOOfHDNTU3Kg==", "requires": { "ansi-colors": "^4.1.1", "extend-object": "^1.0.0", + "glob": "^7.1.6", "gulp": "^4.0.2", "merge-stream": "^2.0.0", - "path": "^0.12.7", - "rimraf": "^3.0.0" + "micromatch": "^4.0.2" } }, "@abp/aspnetcore.mvc.ui.theme.basic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-1.1.1.tgz", - "integrity": "sha512-ooXtCM3TWN69RU7xs6avnzOQBXzsiHY5BEIogzSBialZC4uG5H56qrIr4MbsFNae+PQM23Mw2tnJ/Z7dutURCQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.2.1.tgz", + "integrity": "sha512-DYr9ROcTPfCRHxD1QSWqLZ9+ARbO5p9I6SRo893NtJ39aHacAa9RIAwZmP0JLG0C4hLXfJLKXJ2DpNcwY+ubXA==", "requires": { - "@abp/aspnetcore.mvc.ui.theme.shared": "^1.1.1" + "@abp/aspnetcore.mvc.ui.theme.shared": "~5.2.1" } }, "@abp/aspnetcore.mvc.ui.theme.shared": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-1.1.1.tgz", - "integrity": "sha512-LilSyefzT1+rcTU7vbWxcO8TwBgGZIx6QbMUrDicSTH6LLJ9S5+yNaGNJbbZKDG6qx0BEoC1u8dE8KCUshwxoQ==", - "requires": { - "@abp/aspnetcore.mvc.ui": "^1.1.1", - "@abp/bootstrap": "^1.1.1", - "@abp/bootstrap-datepicker": "^1.1.1", - "@abp/datatables.net-bs4": "^1.1.1", - "@abp/font-awesome": "^1.1.1", - "@abp/jquery-form": "^1.1.1", - "@abp/jquery-validation-unobtrusive": "^1.1.1", - "@abp/lodash": "^1.1.1", - "@abp/luxon": "^1.1.1", - "@abp/malihu-custom-scrollbar-plugin": "^1.1.1", - "@abp/select2": "^1.1.1", - "@abp/sweetalert": "^1.1.1", - "@abp/timeago": "^1.1.1", - "@abp/toastr": "^1.1.1" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.2.1.tgz", + "integrity": "sha512-/1C5RyPIRPZT5ir8Len2EnSt1KfWcRdPyn/avAG+9JKBZ8FoUL8mO2/ffESOvikh/wItZZgxJ5VEJVGwHNjgdQ==", + "requires": { + "@abp/aspnetcore.mvc.ui": "~5.2.1", + "@abp/bootstrap": "~5.2.1", + "@abp/bootstrap-datepicker": "~5.2.1", + "@abp/datatables.net-bs5": "~5.2.1", + "@abp/font-awesome": "~5.2.1", + "@abp/jquery-form": "~5.2.1", + "@abp/jquery-validation-unobtrusive": "~5.2.1", + "@abp/lodash": "~5.2.1", + "@abp/luxon": "~5.2.1", + "@abp/malihu-custom-scrollbar-plugin": "~5.2.1", + "@abp/select2": "~5.2.1", + "@abp/sweetalert2": "~5.2.1", + "@abp/timeago": "~5.2.1", + "@abp/toastr": "~5.2.1" } }, "@abp/bootstrap": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/bootstrap/-/bootstrap-1.1.1.tgz", - "integrity": "sha512-OIaGJaizhI8UNfy4bnw2xT2Z0QG7BJJrjxOPGepfd4jn/AUi/vFdOpJFWvu2P9PwSzRmn/LuSlr2WONDOdPVWQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/bootstrap/-/bootstrap-5.2.1.tgz", + "integrity": "sha512-vFW8OxfRhiDkIrDVIn3TyGkGyiCLLFmPMjSOmMg3o2XPdRk5uhwSBzWYpk/m+kmPpP6cEsJMxaHpCsirSlPE+A==", "requires": { - "@abp/core": "^1.1.1", - "bootstrap": "^4.3.1" + "@abp/core": "~5.2.1", + "bootstrap": "^5.1.3" } }, "@abp/bootstrap-datepicker": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/bootstrap-datepicker/-/bootstrap-datepicker-1.1.1.tgz", - "integrity": "sha512-RIQLSrKBu/cTAU2lFenSAoKcMp7wgF4e3nP4/iOu5ZtCgti5vUjMEcqEvBxtlwKTHMXsTG4GtNKqjTwjXMjONQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.2.1.tgz", + "integrity": "sha512-UPdVu9t7XybINSfonQN0DB9Lpz1r5vCz7F8CMpbjQprvPmsFmkAZyY0p6MS3kGO5eu5rlpGAGPBGOTeSfEp9ww==", "requires": { "bootstrap-datepicker": "^1.9.0" } }, "@abp/clipboard": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/clipboard/-/clipboard-1.1.1.tgz", - "integrity": "sha512-O6b7VCAh2mxjkPhgUZYQBhXf0u+dWRECBOYN4KxYiKfk+2xL8X+34Ls7hVLbyuD+4xCcNirMZIG5CnS8auHC/A==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/clipboard/-/clipboard-5.2.1.tgz", + "integrity": "sha512-aouNTDz8t+8M4O2a+UsEdtABRsyhvzGpXqCG2+LYE1vA3I+CKhglkvEFp+GyIgWsipEHY1U1w6V3qZtcRINn+A==", "requires": { - "@abp/core": "^1.1.1", - "clipboard": "^2.0.4" + "@abp/core": "~5.2.1", + "clipboard": "^2.0.8" } }, "@abp/core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/core/-/core-1.1.1.tgz", - "integrity": "sha512-OvUG7xRvk8nSqwC1s45YPnTuhC2OWe1AVa1nnC6FVHMH/g1Je7UJwnbu47K7uNS+lDRJUIktNbufYKiwutEjRg==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/core/-/core-5.2.1.tgz", + "integrity": "sha512-FDOhIPjig3oGxkbadJZzFSC1ZHzgQV4R75fsDNH56lQ9mTyRUPQdg0Y54eCtY7yOSjiJOctOUUWHaxoFG7frGQ==", + "requires": { + "@abp/utils": "~5.2.1" + } }, "@abp/datatables.net": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/datatables.net/-/datatables.net-1.1.1.tgz", - "integrity": "sha512-y76IDBlgc0n1YgQqJ+9cfzXpLwr2arhdIfSmqX+qRXz6GfVNY7e3JijkFSgDKUzKGYo1HZMzgJmDmeNIRwMZsQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/datatables.net/-/datatables.net-5.2.1.tgz", + "integrity": "sha512-6Q3+W+d8e4TMAkZr/IdPDQuL1v+tjbS50ChLvrJX/BLb4fBhu1LGJWWKzKJFj721DwIsuQQiM4uq9xX/TjiS0w==", "requires": { - "@abp/core": "^1.1.1", - "datatables.net": "^1.10.20" + "@abp/jquery": "~5.2.1", + "datatables.net": "^1.11.4" } }, - "@abp/datatables.net-bs4": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/datatables.net-bs4/-/datatables.net-bs4-1.1.1.tgz", - "integrity": "sha512-t40xQIGBMLPZiSbcZHW3AwE8uk+xcl7OitBT1jym0XPKVtgJsHez3ynDE5v/PjHe+ColCG8lTRjRnNoXo5dzDw==", + "@abp/datatables.net-bs5": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/datatables.net-bs5/-/datatables.net-bs5-5.2.1.tgz", + "integrity": "sha512-B8lSAeMM9qOwYbDK/Dhp7BX5lFaCpao4RCPcSqgFrye8vlH8bcobmp4tMD23r24y/gRIEuQBcKzp0Lf0OUpLhA==", "requires": { - "@abp/datatables.net": "^1.1.1", - "datatables.net-bs4": "^1.10.20" + "@abp/datatables.net": "~5.2.1", + "datatables.net-bs5": "^1.11.4" } }, "@abp/docs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/docs/-/docs-1.1.1.tgz", - "integrity": "sha512-z2Dk7EOhBdFo6BYbgccD91PIg37L2ehkgRT4RWf61dRyjPAQgPwwwyVSqApFmKveWPCzreHoTPKbnrU7EzAssw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/docs/-/docs-5.2.1.tgz", + "integrity": "sha512-WZCCY73vyIpRu7hypPiP9CRr4Bvzkv3up0WeGQ4rK9LiZWNSxG9PXv4lYeD4cuHg0zgxH9d/6toYToaIJNqDCQ==", "requires": { - "@abp/anchor-js": "^1.1.1", - "@abp/clipboard": "^1.1.1", - "@abp/malihu-custom-scrollbar-plugin": "^1.1.1", - "@abp/popper.js": "^1.1.1", - "@abp/prismjs": "^1.1.1" + "@abp/anchor-js": "~5.2.1", + "@abp/clipboard": "~5.2.1", + "@abp/malihu-custom-scrollbar-plugin": "~5.2.1", + "@abp/popper.js": "~5.2.1", + "@abp/prismjs": "~5.2.1" } }, "@abp/font-awesome": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/font-awesome/-/font-awesome-1.1.1.tgz", - "integrity": "sha512-6RHbixi7IVWAb3JCHrUmEYD3HmAH4R75Nuo54LvFzATrh4G6gdBONIeDuTo79OTxe4Zhp+WLxeA49Y21kt77mg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/font-awesome/-/font-awesome-5.2.1.tgz", + "integrity": "sha512-9fAUdA9QeNRMjp6v8i6EOR480bjB4OzqzriFCKUu4k6VwbA6PxUsJIRFyKIt5UpC12Zqdhpkyj0iG6tE0nRekQ==", "requires": { - "@abp/core": "^1.1.1", - "@fortawesome/fontawesome-free": "^5.11.2" + "@abp/core": "~5.2.1", + "@fortawesome/fontawesome-free": "^5.15.4" } }, "@abp/jquery": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/jquery/-/jquery-1.1.1.tgz", - "integrity": "sha512-kj4BTtXF0VbCzCqRXnRVEbGndR3F8NlbBhVQN6BQktOuZta3fvx7f2+pSok8vQv0ddmqUFY7FTT2Ei3l4363LQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/jquery/-/jquery-5.2.1.tgz", + "integrity": "sha512-FiIRnDx/gm6JR8QljiulwCc5d8+YC123X0qxMIBI8IY9vznEX+Jk48jYG8fLABnRqKEIYfV8UsYSK8IJx3mcSg==", "requires": { - "@abp/core": "^1.1.1", - "jquery": "^3.4.1" + "@abp/core": "~5.2.1", + "jquery": "~3.6.0" } }, "@abp/jquery-form": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/jquery-form/-/jquery-form-1.1.1.tgz", - "integrity": "sha512-AIIdN36f8xwr4LgiNnBHohJ5tlxh/r+DuDtXcScpZN6GWBE+XgUotN0pZIIva82IxCyUNdDudzgluX9IjI+00w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/jquery-form/-/jquery-form-5.2.1.tgz", + "integrity": "sha512-L7uKs7vReOQEETG9xIDq5aXjshbaPa+ZZQcCbn2uwY813e0ErS7Rb1mnowEt/LNEB02AtLet1B4TDVwZUl1uXQ==", "requires": { - "@abp/jquery": "^1.1.1", - "jquery-form": "^4.2.2" + "@abp/jquery": "~5.2.1", + "jquery-form": "^4.3.0" } }, "@abp/jquery-validation": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/jquery-validation/-/jquery-validation-1.1.1.tgz", - "integrity": "sha512-YvAjIW8epp+ddu01BTUkZWPfEADAvNPJeUrrZ6OpcPWM15Tf+ddr4ATgJ1LCg0Bh5F09iQC855osow3lt8sc7g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/jquery-validation/-/jquery-validation-5.2.1.tgz", + "integrity": "sha512-Rr/+SWGlXJ53jfysMB/HVNZqsJKCF3rg23ip2Kg6Q+kQTvWVRE3tpkpoBJczOii5tPUk/A/lsJKgRlcsnP0ASw==", "requires": { - "@abp/jquery": "^1.1.1", - "jquery-validation": "^1.19.1" + "@abp/jquery": "~5.2.1", + "jquery-validation": "^1.19.3" } }, "@abp/jquery-validation-unobtrusive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-1.1.1.tgz", - "integrity": "sha512-q1b0KG8l3DXUiW8JXdq9l1jR/CwgzrZdxwdKGLB2J/oxHlywQIb7yrjR6WGCshjPpcx2SkOL0j/ZXMIMh533hQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.2.1.tgz", + "integrity": "sha512-uZ36D1FfoLdBb6h44fQ3kZuTk4gJ5yzhyOprkgMsGAJDVakX7w/W4V3ThpiEO+iUpNKTboVIhW2QQ0AXK9rrsg==", "requires": { - "@abp/jquery-validation": "^1.1.1", - "jquery-validation-unobtrusive": "^3.2.11" + "@abp/jquery-validation": "~5.2.1", + "jquery-validation-unobtrusive": "^3.2.12" } }, "@abp/lodash": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/lodash/-/lodash-1.1.1.tgz", - "integrity": "sha512-nH7bRS28Tf4hEXcpKHd1IM+MzYTqX8t3htGmsLX4UESQd52eODYOIldtX6gm3OW1O6ECwW6si/o0M2pTEpQqvg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/lodash/-/lodash-5.2.1.tgz", + "integrity": "sha512-ILg3X5tTH2HhJMRmg7BP/r+Kstm/nf+0aNQ2exsJoMMnKE7CC0eYQjpSgrze6GwG3a13eamyTlrz+RrlIm5IBA==", "requires": { - "@abp/core": "^1.1.1", - "lodash": "^4.17.15" + "@abp/core": "~5.2.1", + "lodash": "^4.17.21" } }, "@abp/luxon": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/luxon/-/luxon-1.1.1.tgz", - "integrity": "sha512-WNu8JRSb5FDXfcDwjMYyeYeUN48uuDc/I2cdo3xd1rcY+lbmbzxoG9IYOlE8cRHdgX3z82qsZXFs2lcAy0Le2g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/luxon/-/luxon-5.2.1.tgz", + "integrity": "sha512-D3KVsba969UBYktdbCxq1JQp4kYZ1S7rIMymDJMBoHByXxwwdeXMkvuphAifBmSYTt3K6bNoZdR0VxtnNlPn2A==", "requires": { - "luxon": "^1.21.3" + "@abp/core": "~5.2.1", + "luxon": "^2.3.0" } }, "@abp/malihu-custom-scrollbar-plugin": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-1.1.1.tgz", - "integrity": "sha512-n4b4QK/L1Czdx0oOpUR/bWjK9VENexfUSV/aMjwzHhDmEFABAmEfhIpudCYDwewGswrd7C9agmBvakv2rwPQeA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.2.1.tgz", + "integrity": "sha512-5mvABMCT7tiwPl1vUK8kriN/SRi2gC4VqkEuxghT7uBQG9Cqh5jhJrl80M9ZK/oQFind3r6+SF8OlfwF8yvxHQ==", "requires": { - "@abp/core": "^1.1.1", + "@abp/core": "~5.2.1", "malihu-custom-scrollbar-plugin": "^3.1.5" } }, "@abp/popper.js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/popper.js/-/popper.js-1.1.1.tgz", - "integrity": "sha512-heR73cqmMsVPNgsPxBYbkvc842R3hEEuDAj4oaXZwVTeWXayU6TdDcGdIrfwMZwW2eWivYNnO0bMOVmuhZKTTQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/popper.js/-/popper.js-5.2.1.tgz", + "integrity": "sha512-poQhd5EYjU2/udJWlDEd5mIPWmw6AzNOzAd5V4OUHMai+BHeuhIXQ6mopvxf9lpzytGoFe2ZIiQ547Wfq4Fl/Q==", "requires": { - "@abp/core": "^1.1.1", - "popper.js": "^1.16.0" + "@abp/core": "~5.2.1", + "@popperjs/core": "^2.11.2" } }, "@abp/prismjs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/prismjs/-/prismjs-1.1.1.tgz", - "integrity": "sha512-kZh2imqVTMDWmE2v+S4wMsigu/hSyVaz3VvZzGctFNctzC17LeD6z6ymfrtQ5BPJbCxGSpHwOt4/Y8bycPTEuQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/prismjs/-/prismjs-5.2.1.tgz", + "integrity": "sha512-YNgcM7Kvmu3hGXJh4B8gl7rLzC28VuZYYP7AVptVSbTz/n6usCo21evG/st8L3vXixuQkvnNpBFgacJnHdSJZQ==", "requires": { - "@abp/core": "^1.1.1", - "prismjs": "^1.17.1" + "@abp/clipboard": "~5.2.1", + "@abp/core": "~5.2.1", + "prismjs": "^1.26.0" } }, "@abp/select2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/select2/-/select2-1.1.1.tgz", - "integrity": "sha512-t0qcJhD+uo2+XWr4nmMQLAx7MRGQUBdZ81YmGty045ReoSaEKQf4haLkzBcMzpBRusiyMQO/PbxjtwMw/xJQTQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/select2/-/select2-5.2.1.tgz", + "integrity": "sha512-JH/PqOxhTY05sUyN7of6TNai0W4M3N3OF3Hlwmr8i7hNdYfFwJvQnQzKeKrk/vt8Hv44/JTQDlNKU02BmSBfOQ==", "requires": { - "@abp/core": "^1.1.1", - "select2": "^4.0.12" + "@abp/core": "~5.2.1", + "select2": "^4.0.13" } }, - "@abp/sweetalert": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/sweetalert/-/sweetalert-1.1.1.tgz", - "integrity": "sha512-V6K/qg7J/bdFmom2kaXYeiLvcmLHFl+MacPX4yYAK2biZdb2pWOkUdmcAzZdOT+UruKfLRhvraVC2uXDySi9NA==", + "@abp/sweetalert2": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/sweetalert2/-/sweetalert2-5.2.1.tgz", + "integrity": "sha512-laaF/5WhYw+hNJRTfMzO93fVhaYqnnOcQTUlkGgsZMe2gwebyX73VI8O8Xw7zXmN1Tu/JwqRI46qiafDrPFTLg==", "requires": { - "@abp/core": "^1.1.1", - "sweetalert": "^2.1.2" + "@abp/core": "~5.2.1", + "sweetalert2": "^11.3.6" } }, "@abp/timeago": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/timeago/-/timeago-1.1.1.tgz", - "integrity": "sha512-QYYih/4n6XhCqkRw7fBfyg58T5CHqJHyz7SAfq86RiKAJ4jVtjdSVxj3XKxz8eCb56wZGsO1xXXStI3vdLwwNw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/timeago/-/timeago-5.2.1.tgz", + "integrity": "sha512-xmgqKEKusB6pcqFhMaz8RTi886ad8RrRMYgMWSw4Zjk1Lr9EqQwKtcE43Ve5XWJamh2Wpk8H7IKLQKHfrV12oA==", "requires": { - "@abp/jquery": "^1.1.1", + "@abp/jquery": "~5.2.1", "timeago": "^1.6.7" } }, "@abp/toastr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@abp/toastr/-/toastr-1.1.1.tgz", - "integrity": "sha512-GDewBppm+0FO6kTTy0huczoH9P5q6lFicHFAoEawAMkuWJFW/Ihv/YnEvKGDQwGftuVSWexfqBMN/RZ5YSOiGQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/toastr/-/toastr-5.2.1.tgz", + "integrity": "sha512-HrnIzvM9LgQdzlmLmvHUVSG4PmWfx9YuozxkFTv+AGa2FAPby5W9hbQ025ry3bPkU9lGWSu/w7JSDqoiL16bPA==", "requires": { - "@abp/jquery": "^1.1.1", + "@abp/jquery": "~5.2.1", "toastr": "^2.1.4" } }, + "@abp/utils": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@abp/utils/-/utils-5.2.1.tgz", + "integrity": "sha512-9hxI24aRZCnxCP+WsOoCltSg4YqG9WtW06t9/f6hFO9B0udXIKyV+95Ndipca/R1G94Snx81ifSwAa+DHbFfvQ==", + "requires": { + "just-compare": "^1.3.0" + } + }, "@fortawesome/fontawesome-free": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.0.tgz", - "integrity": "sha512-xKOeQEl5O47GPZYIMToj6uuA2syyFlq9EMSl2ui0uytjY9xbe8XS0pexNWmxrdcCyNGyDmLyYw5FtKsalBUeOg==" + "version": "5.15.4", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz", + "integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==" + }, + "@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" }, "anchor-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/anchor-js/-/anchor-js-4.2.2.tgz", - "integrity": "sha512-Rg1tGaG4K3avYqDh7rOYCE/odWxpUiHStnlKL/bGOt9cl6NjR06zhPGVQcCAjE5PT48oQeHVgqNmLzxh0Kuk4A==" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/anchor-js/-/anchor-js-4.3.1.tgz", + "integrity": "sha512-TziERoibspey7KSm95oIdzTxiogXonJl7inQI07Y3cI25DKQaLkUftB7RhCuSb1GcwunHL6/PcIKM4dDUb9xYQ==" }, "ansi-colors": { "version": "4.1.1", @@ -281,6 +299,36 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "append-buffer": { @@ -441,9 +489,9 @@ } }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base": { "version": "0.11.2", @@ -510,9 +558,9 @@ } }, "bootstrap": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", - "integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA==" + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz", + "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==" }, "bootstrap-datepicker": { "version": "1.9.0", @@ -564,9 +612,9 @@ "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=" }, "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "cache-base": { "version": "1.0.1", @@ -584,6 +632,15 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", @@ -606,13 +663,6 @@ "path-is-absolute": "^1.0.0", "readdirp": "^2.2.1", "upath": "^1.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - } } }, "class-utils": { @@ -637,9 +687,9 @@ } }, "clipboard": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz", - "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.10.tgz", + "integrity": "sha512-cz3m2YVwFz95qSEbCDi2fzLN/epEN9zXBvfgAoGkvGOJZATMl9gtTDVOtBYkx2ODUJl2kvmud7n32sV2BpYR4g==", "requires": { "good-listener": "^1.2.2", "select": "^1.1.2", @@ -732,9 +782,9 @@ } }, "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "requires": { "safe-buffer": "~5.1.1" } @@ -745,18 +795,25 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "copy-props": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", "requires": { - "each-props": "^1.3.0", - "is-plain-object": "^2.0.1" + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + } } }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "d": { "version": "1.0.1", @@ -768,19 +825,19 @@ } }, "datatables.net": { - "version": "1.10.20", - "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.10.20.tgz", - "integrity": "sha512-4E4S7tTU607N3h0fZPkGmAtr9mwy462u+VJ6gxYZ8MxcRIjZqHy3Dv1GNry7i3zQCktTdWbULVKBbkAJkuHEnQ==", + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.11.5.tgz", + "integrity": "sha512-nlFst2xfwSWaQgaOg5sXVG3cxYC0tH8E8d65289w9ROgF2TmLULOOpcdMpyxxUim/qEwVSEem42RjkTWEpr3eA==", "requires": { "jquery": ">=1.7" } }, - "datatables.net-bs4": { - "version": "1.10.20", - "resolved": "https://registry.npmjs.org/datatables.net-bs4/-/datatables.net-bs4-1.10.20.tgz", - "integrity": "sha512-kQmMUMsHMOlAW96ztdoFqjSbLnlGZQ63iIM82kHbmldsfYdzuyhbb4hTx6YNBi481WCO3iPSvI6YodNec46ZAw==", + "datatables.net-bs5": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/datatables.net-bs5/-/datatables.net-bs5-1.11.5.tgz", + "integrity": "sha512-1zyh972GtuK1uAb9h8nP3jJ7f/3UgCDq69LAaZS2bVd4mEHECJ6vrZLacxrkOHOs/q/H3v5sEMeZ46vXz8ox4w==", "requires": { - "datatables.net": "1.10.20", + "datatables.net": ">=1.11.3", "jquery": ">=1.7" } }, @@ -823,11 +880,12 @@ "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "define-property": { @@ -914,13 +972,13 @@ } }, "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "version": "0.10.60", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" } }, "es6-iterator": { @@ -933,11 +991,6 @@ "es6-symbol": "^3.1.1" } }, - "es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=" - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -999,17 +1052,17 @@ } }, "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "requires": { - "type": "^2.0.0" + "type": "^2.5.0" }, "dependencies": { "type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", - "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" } } }, @@ -1112,6 +1165,11 @@ "time-stamp": "^1.0.0" } }, + "fast-levenshtein": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", + "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=" + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -1157,6 +1215,28 @@ "is-glob": "^4.0.0", "micromatch": "^3.0.4", "resolve-dir": "^1.0.1" + }, + "dependencies": { + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } } }, "fined": { @@ -1221,487 +1301,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "optional": true, "requires": { "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "bundled": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "bundled": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "bundled": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "bundled": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.3.3", - "bundled": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "bundled": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "bundled": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "bundled": true, - "optional": true - } + "nan": "^2.12.1" } }, "function-bind": { @@ -1714,15 +1320,25 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1769,15 +1385,16 @@ } }, "glob-watcher": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", - "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", + "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", "requires": { "anymatch": "^2.0.0", "async-done": "^1.2.0", "chokidar": "^2.0.0", "is-negated-glob": "^1.0.0", "just-debounce": "^1.0.0", + "normalize-path": "^3.0.0", "object.defaults": "^1.1.0" } }, @@ -1820,9 +1437,9 @@ } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "gulp": { "version": "4.0.2", @@ -1844,9 +1461,9 @@ } }, "gulp-cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.2.0.tgz", - "integrity": "sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", "requires": { "ansi-colors": "^1.0.1", "archy": "^1.0.0", @@ -1856,7 +1473,7 @@ "copy-props": "^2.0.1", "fancy-log": "^1.3.2", "gulplog": "^1.0.0", - "interpret": "^1.1.0", + "interpret": "^1.4.0", "isobject": "^3.0.1", "liftoff": "^3.1.0", "matchdep": "^2.0.0", @@ -1864,7 +1481,7 @@ "pretty-hrtime": "^1.0.0", "replace-homedir": "^1.0.0", "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", + "v8flags": "^3.2.0", "yargs": "^7.1.0" } } @@ -1878,10 +1495,26 @@ "glogg": "^1.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-value": { "version": "1.0.0", @@ -1921,9 +1554,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "inflight": { "version": "1.0.6", @@ -1940,14 +1573,14 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "interpret": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" }, "invert-kv": { "version": "1.0.0", @@ -1999,6 +1632,14 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "requires": { + "has": "^1.0.3" + } + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -2053,9 +1694,9 @@ } }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "requires": { "is-extglob": "^2.1.1" } @@ -2138,14 +1779,14 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "jquery": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", - "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" }, "jquery-form": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/jquery-form/-/jquery-form-4.2.2.tgz", - "integrity": "sha512-HJTef7DRBSg8ge/RNUw8rUTTtB3l8ozO0OhD16AzDl+eIXp4skgCqRTd9fYPsOzL+pN6+1B9wvbTLGjgikz8Tg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/jquery-form/-/jquery-form-4.3.0.tgz", + "integrity": "sha512-q3uaVCEWdLOYUCI6dpNdwf/7cJFOsUgdpq6r0taxtGQ5NJSkOzofyWm4jpOuJ5YxdmL1FI5QR+q+HB63HHLGnQ==", "requires": { "jquery": ">=1.7.2" } @@ -2156,16 +1797,16 @@ "integrity": "sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU=" }, "jquery-validation": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.19.1.tgz", - "integrity": "sha512-QNnrZBqSltWUEJx+shOY5WtfrIb0gWmDjFfQP8rZKqMMSfpRSwEkSqhfHPvDfkObD8Hnv5KHSYI8yg73sVFdqA==" + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.19.3.tgz", + "integrity": "sha512-iXxCS5W7STthSTMFX/NDZfWHBLbJ1behVK3eAgHXAV8/0vRa9M4tiqHvJMr39VGWHMGdlkhrtrkBuaL2UlE8yw==" }, "jquery-validation-unobtrusive": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-3.2.11.tgz", - "integrity": "sha512-3FQPllaWdD+Aq55zJLGSW39+eXPDz1HhwAvrSwYi8zHQ8DVcu5IJ1HVeTiCl0BnCnrIBvfFU3zEB/DrGdcoRIQ==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-3.2.12.tgz", + "integrity": "sha512-kPixGhVcuat7vZXngGFfSIksy4VlzZcHyRgnBIZdsfVneCU+D5sITC8T8dD/9c9K/Q+qkMlgp7ufJHz93nKSuQ==", "requires": { - "jquery": ">=1.8", + "jquery": "^3.5.1", "jquery-validation": ">=1.16" } }, @@ -2174,10 +1815,15 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, + "just-compare": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/just-compare/-/just-compare-1.5.1.tgz", + "integrity": "sha512-xDEEFHNIyJNmN4uo/2RVeUcay9THtN/5ka/iw98Y/gsa8w9KXZQuyaf5eFUY6VlntA2+G+bdPmdhqqTs7T+BRw==" + }, "just-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", - "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz", + "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==" }, "kind-of": { "version": "6.0.3", @@ -2194,9 +1840,9 @@ } }, "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", "requires": { "readable-stream": "^2.0.5" } @@ -2245,14 +1891,14 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "luxon": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.22.2.tgz", - "integrity": "sha512-vq6eSaOOw1fKob+JXwfu0e3/UFUT4G4HTFRJab7dch8J1OdOGW/vXqCiJsY7rm2In+5gKNYx0EtnYT0Tc5V4Qw==" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-2.3.2.tgz", + "integrity": "sha512-MlAQQVMFhGk4WUA6gpfsy0QycnKP0+NlCBJRVRNPxxSIbjrCbQ65nrpJD3FVyJNZLuJ0uoqL57ye6BmDYgHaSw==" }, "make-iterator": { "version": "1.0.1", @@ -2312,6 +1958,26 @@ "requires": { "is-extglob": "^2.1.0" } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } } } }, @@ -2321,29 +1987,49 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + } } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -2378,9 +2064,9 @@ "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==" }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", "optional": true }, "nanomatch": { @@ -2402,9 +2088,9 @@ } }, "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, "normalize-package-data": { "version": "2.5.0", @@ -2418,12 +2104,9 @@ } }, "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "now-and-later": { "version": "2.0.1", @@ -2480,14 +2163,14 @@ } }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, "object.defaults": { @@ -2584,15 +2267,6 @@ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" }, - "path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", - "requires": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -2612,9 +2286,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-root": { "version": "0.1.1", @@ -2639,6 +2313,11 @@ "pinkie-promise": "^2.0.0" } }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -2657,11 +2336,6 @@ "pinkie": "^2.0.0" } }, - "popper.js": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", - "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -2673,28 +2347,15 @@ "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" }, "prismjs": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.19.0.tgz", - "integrity": "sha512-IVFtbW9mCWm9eOIaEkNyo2Vl4NnEifis2GQ7/MLRG5TQe6t+4Sj9J5QWI9i3v+SS43uZBlCAOn+zYTVYQcPXJw==", - "requires": { - "clipboard": "^2.0.0" - } - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz", + "integrity": "sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==" }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "promise-polyfill": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz", - "integrity": "sha1-36lpQ+qcEh/KTem1hoyznTRy4Fc=" - }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -2755,6 +2416,28 @@ "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", "readable-stream": "^2.0.2" + }, + "dependencies": { + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } } }, "rechoir": { @@ -2799,9 +2482,9 @@ "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" }, "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==" }, "repeat-string": { "version": "1.6.1", @@ -2809,9 +2492,9 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==" }, "replace-homedir": { "version": "1.0.0", @@ -2834,11 +2517,13 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "requires": { - "path-parse": "^1.0.6" + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "resolve-dir": { @@ -2868,14 +2553,6 @@ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -3053,9 +2730,9 @@ } }, "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==" }, "sparkles": { "version": "1.0.1", @@ -3063,32 +2740,32 @@ "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==" }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" }, "split-string": { "version": "3.1.0", @@ -3166,6 +2843,11 @@ "is-utf8": "^0.2.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, "sver-compat": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", @@ -3175,14 +2857,10 @@ "es6-symbol": "^3.1.1" } }, - "sweetalert": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/sweetalert/-/sweetalert-2.1.2.tgz", - "integrity": "sha512-iWx7X4anRBNDa/a+AdTmvAzQtkN1+s4j/JJRWlHpYE8Qimkohs8/XnFcWeYHH2lMA8LRCa5tj2d244If3S/hzA==", - "requires": { - "es6-object-assign": "^1.1.0", - "promise-polyfill": "^6.0.2" - } + "sweetalert2": { + "version": "11.4.8", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.4.8.tgz", + "integrity": "sha512-BDS/+E8RwaekGSxCPUbPnsRAyQ439gtXkTF/s98vY2l9DaVEOMjGj1FaQSorfGREKsbbxGSP7UXboibL5vgTMA==" }, "through2": { "version": "2.0.5", @@ -3299,15 +2977,16 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" }, "undertaker": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", + "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", "requires": { "arr-flatten": "^1.0.1", "arr-map": "^2.0.0", "bach": "^1.0.0", "collection-map": "^1.0.0", "es6-weak-map": "^2.0.1", + "fast-levenshtein": "^1.0.0", "last-run": "^1.1.0", "object.defaults": "^1.0.0", "object.reduce": "^1.0.0", @@ -3390,30 +3069,15 @@ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - } - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "requires": { "homedir-polyfill": "^1.0.1" } @@ -3433,9 +3097,9 @@ "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=" }, "vinyl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", "requires": { "clone": "^2.1.1", "clone-buffer": "^1.0.0", @@ -3481,6 +3145,16 @@ "now-and-later": "^2.0.0", "remove-bom-buffer": "^3.0.0", "vinyl": "^2.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "which": { @@ -3516,14 +3190,14 @@ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" }, "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", + "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", "requires": { "camelcase": "^3.0.0", "cliui": "^3.2.0", @@ -3537,15 +3211,16 @@ "string-width": "^1.0.2", "which-module": "^1.0.0", "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "yargs-parser": "^5.0.1" } }, "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", "requires": { - "camelcase": "^3.0.0" + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" } } } diff --git a/modules/docs/app/VoloDocs.Web/yarn.lock b/modules/docs/app/VoloDocs.Web/yarn.lock index 802094ec7c..8e5f9ddd6d 100644 --- a/modules/docs/app/VoloDocs.Web/yarn.lock +++ b/modules/docs/app/VoloDocs.Web/yarn.lock @@ -2009,9 +2009,9 @@ pretty-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" prismjs@^1.26.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" - integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== + version "1.28.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.28.0.tgz#0d8f561fa0f7cf6ebca901747828b149147044b6" + integrity sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw== process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.0" diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj index e3d556c9e0..72f94bdd47 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Docs.Admin.Application Volo.Docs.Admin.Application diff --git a/modules/docs/src/Volo.Docs.Application/Volo.Docs.Application.csproj b/modules/docs/src/Volo.Docs.Application/Volo.Docs.Application.csproj index 788edd430d..b00754b104 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo.Docs.Application.csproj +++ b/modules/docs/src/Volo.Docs.Application/Volo.Docs.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Docs.Application Volo.Docs.Application diff --git a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj index b68893b40b..29020e50bc 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj +++ b/modules/docs/src/Volo.Docs.Domain/Volo.Docs.Domain.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Docs.Domain Volo.Docs.Domain true diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs index a322120c3d..d1d78cc24a 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs @@ -29,13 +29,13 @@ namespace Volo.Docs.Documents LanguageCode = x.LanguageCode, Format = x.Format, }) - .ToListAsync(cancellationToken: cancellationToken); + .ToListAsync(GetCancellationToken(cancellationToken)); } public async Task> GetListByProjectId(Guid projectId, CancellationToken cancellationToken = default) { - return await (await GetDbSetAsync()).Where(d => d.ProjectId == projectId).ToListAsync(cancellationToken: cancellationToken); + return await (await GetDbSetAsync()).Where(d => d.ProjectId == projectId).ToListAsync(GetCancellationToken(cancellationToken)); } public async Task> GetListAsync(Guid? projectId, string version, string name, CancellationToken cancellationToken = default) @@ -44,7 +44,7 @@ namespace Volo.Docs.Documents .WhereIf(version != null, x => x.Version == version) .WhereIf(name != null, x => x.Name == name) .WhereIf(projectId.HasValue, x => x.ProjectId == projectId) - .ToListAsync(cancellationToken: cancellationToken); + .ToListAsync(GetCancellationToken(cancellationToken)); } public async Task> GetAllAsync( @@ -86,7 +86,7 @@ namespace Volo.Docs.Documents ); query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? nameof(Document.Name) : sorting); - return await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken); + return await query.PageBy(skipCount, maxResultCount).ToListAsync(GetCancellationToken(cancellationToken)); } public async Task GetAllCountAsync( @@ -138,7 +138,7 @@ namespace Volo.Docs.Documents .FirstOrDefaultAsync(x => x.ProjectId == projectId && x.Name == name && x.LanguageCode == languageCode && x.Version == version, - cancellationToken); + GetCancellationToken(cancellationToken)); } public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, CancellationToken cancellationToken = default) @@ -150,7 +150,7 @@ namespace Volo.Docs.Documents public async Task GetAsync(Guid id, CancellationToken cancellationToken = default) { - return await (await GetDbSetAsync()).Where(x => x.Id == id).SingleAsync(cancellationToken: cancellationToken); + return await (await GetDbSetAsync()).Where(x => x.Id == id).SingleAsync(cancellationToken: GetCancellationToken(cancellationToken)); } protected virtual IQueryable ApplyFilterForGetAll( diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo.Docs.MongoDB.csproj b/modules/docs/src/Volo.Docs.MongoDB/Volo.Docs.MongoDB.csproj index 9a5cd19550..25994142c5 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo.Docs.MongoDB.csproj +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo.Docs.MongoDB.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Docs.MongoDB Volo.Docs.MongoDB diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs index 3a57330557..c812947388 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs @@ -31,12 +31,12 @@ namespace Volo.Docs.Documents LanguageCode = x.LanguageCode, Format = x.Format }) - .ToListAsync(cancellationToken); + .ToListAsync(GetCancellationToken(cancellationToken)); } public async Task> GetListByProjectId(Guid projectId, CancellationToken cancellationToken = default) { - return await (await GetMongoQueryableAsync(cancellationToken)).Where(d => d.ProjectId == projectId).ToListAsync(cancellationToken); + return await (await GetMongoQueryableAsync(cancellationToken)).Where(d => d.ProjectId == projectId).ToListAsync(GetCancellationToken(cancellationToken)); } public async Task FindAsync(Guid projectId, string name, string languageCode, string version, @@ -46,7 +46,7 @@ namespace Volo.Docs.Documents return await (await GetMongoQueryableAsync(cancellationToken)).FirstOrDefaultAsync(x => x.ProjectId == projectId && x.Name == name && x.LanguageCode == languageCode && - x.Version == version, cancellationToken); + x.Version == version, GetCancellationToken(cancellationToken)); } public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, @@ -64,7 +64,7 @@ namespace Volo.Docs.Documents .WhereIf(name != null, x => x.Name == name) .WhereIf(projectId.HasValue, x => x.ProjectId == projectId) .As>() - .ToListAsync(cancellationToken); + .ToListAsync(GetCancellationToken(cancellationToken)); } public async Task> GetAllAsync( @@ -156,7 +156,7 @@ namespace Volo.Docs.Documents public async Task GetAsync(Guid id, CancellationToken cancellationToken = default) { - return await (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.Id == id).SingleAsync(cancellationToken); + return await (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.Id == id).SingleAsync(GetCancellationToken(cancellationToken)); } protected virtual IMongoQueryable ApplyFilterForGetAll( diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index 77f5bec551..42c1717690 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; using Volo.Abp.AspNetCore.Mvc.UI.Packages; using Volo.Abp.AspNetCore.Mvc.UI.Packages.Prismjs; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; @@ -16,6 +17,7 @@ using Volo.Docs.Bundling; using Volo.Docs.HtmlConverting; using Volo.Docs.Localization; using Volo.Docs.Markdown; +using Volo.Docs.Pages.Shared.Components.Head; namespace Volo.Docs { @@ -91,6 +93,11 @@ namespace Volo.Docs { options.DisableModule(DocsRemoteServiceConsts.ModuleName); }); + + Configure(options => + { + options.Add(LayoutHooks.Head.Last, typeof(HeadViewComponent)); + }); } } } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index c0ea0c4d7c..5ca2b7fbd9 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -11,38 +11,42 @@ @using Volo.Docs.Localization @using Volo.Docs.Pages.Documents.Project @using Volo.Docs.Pages.Documents.Shared.ErrorComponent +@using Volo.Docs.Pages.Shared.Components.Head @inject IThemeManager ThemeManager @inject IPageLayout PageLayout @inject IHtmlLocalizer L + @model IndexModel @{ ViewBag.FluidLayout = true; Layout = ThemeManager.CurrentTheme.GetEmptyLayout(); PageLayout.Content.Title = Model.DocumentName?.Replace("-", " "); ViewBag.Description = Model.GetDescription(); + ViewBag.CanonicalUrl = Model.IsLatestVersion ? null : Model.GetFullUrlOfTheLatestDocument(); //issue #12355 } + @section styles { - - - - - - - + + + + + + + } @section scripts { - - - - - - - - - - - - + + + + + + + + + + + + } @if (Model.LoadSuccess) { @@ -93,8 +97,8 @@

    @@ -112,11 +116,11 @@ - + @@ -131,11 +135,11 @@
    @* - - *@ + + *@
    @@ -149,11 +153,11 @@
    + id="filter" + type="search" + data-search-url="@Model." + placeholder="@L["FilterTopics"].Value" + aria-label="Filter">
    @@ -168,13 +172,13 @@ else { + version="@(Model.LatestVersionInfo == null || Model.LatestVersionInfo.IsSelected ? DocsAppConsts.Latest : Model.Version)" + project-name="@Model.ProjectName" + project-format="@Model.Project.Format" + selected-document-name="@Model.DocumentNameWithExtension" + language="@Model.LanguageCode" + id="sidebar-scroll" + class="nav nav-list"> } @@ -194,11 +198,11 @@ + id="fullsearch" + type="search" + data-fullsearch-url="/search/@Model.LanguageCode/@Model.ProjectName/@Model.Version/" + placeholder="@L["FullSearch"].Value" + aria-label="Filter"> } @@ -210,15 +214,15 @@ @(L["Contributors"].Value) - @foreach (var contributor in Model.Document.Contributors.OrderByDescending(c=> c.CommitCount).ToList()) + @foreach (var contributor in Model.Document.Contributors.OrderByDescending(c => c.CommitCount).ToList()) { Avatar + class="rounded-circle" + alt="Avatar" + height="21" + width="21" + title="@contributor.Username" /> } } @@ -261,8 +265,8 @@
    @(parameter.DisplayName) + +
    + + diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml index 725a9610dd..db0dd8422e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml @@ -7,6 +7,7 @@ @using Volo.Abp.Localization @using Volo.Abp.ObjectExtending @using Volo.Abp.Data +@using Volo.Abp.Identity @model EditModalModel @inject IHtmlLocalizer L @inject IStringLocalizerFactory StringLocalizerFactory @@ -25,7 +26,16 @@ - +
    + +
    + + +
    + +
    diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml index 1f7f338ba4..48ad716306 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml @@ -19,6 +19,7 @@ @section styles { + } @section scripts { diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.css b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.css new file mode 100644 index 0000000000..acdafe715a --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.css @@ -0,0 +1,7 @@ +/* + By default Microsoft Edge, adds password reveal button inside the password input. + https://docs.microsoft.com/en-us/microsoft-edge/web-platform/password-reveal + */ +::-ms-reveal { + display: none; +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 96ee7e5361..fcd3a72f52 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -2,12 +2,51 @@ var l = abp.localization.getResource('AbpIdentity'); var _identityUserAppService = volo.abp.identity.identityUser; - var _editModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/CreateModal' - ); + + var togglePasswordVisibility = function () { + $("#PasswordVisibilityButton").click(function (e) { + var button = $(this); + var passwordInput = button.parent().find("input"); + if(!passwordInput) { + return; + } + + if(passwordInput.attr("type") === "password") { + passwordInput.attr("type", "text"); + } + else { + passwordInput.attr("type", "password"); + } + + var icon = button.find("i"); + if(icon) { + icon.toggleClass("fa-eye-slash").toggleClass("fa-eye"); + } + }); + } + + abp.modals.createUser = function () { + var initModal = function (publicApi, args) { + togglePasswordVisibility(); + }; + return { initModal: initModal }; + } + + abp.modals.editUser = function () { + var initModal = function (publicApi, args) { + togglePasswordVisibility(); + }; + return { initModal: initModal }; + } + + var _editModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Identity/Users/EditModal', + modalClass: "editUser" + }); + var _createModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Identity/Users/CreateModal', + modalClass: "createUser" + }); var _permissionsModal = new abp.ModalManager( abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' ); @@ -44,9 +83,9 @@ }, { text: l('Delete'), - visible: abp.auth.isGranted( - 'AbpIdentity.Users.Delete' - ), + visible: function(data) { + return abp.auth.isGranted('AbpIdentity.Users.Delete') && abp.currentUser.id !== data.id; + }, confirmMessage: function (data) { return l( 'UserDeletionConfirmationMessage', diff --git a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs index 6583156c82..fbfc0e2ef6 100644 --- a/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs +++ b/modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/FakeExternalLoginProvider.cs @@ -35,6 +35,11 @@ public class FakeExternalLoginProvider : ExternalLoginProviderBase, ITransientDe ); } + public override Task IsEnabledAsync() + { + return Task.FromResult(true); + } + protected override Task GetUserInfoAsync(string userName) { if (userName != "ext_user") diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo.Abp.PermissionManagement.Application.csproj b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo.Abp.PermissionManagement.Application.csproj index d81f87d28c..080432db39 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo.Abp.PermissionManagement.Application.csproj +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo.Abp.PermissionManagement.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Abp.PermissionManagement.Application Volo.Abp.PermissionManagement.Application $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs index e74b3d8212..e81eed859d 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs @@ -122,6 +122,7 @@ public partial class PermissionManagementModal { try { + var updateDto = new UpdatePermissionsDto { Permissions = _groups @@ -129,6 +130,14 @@ public partial class PermissionManagementModal .Select(p => new UpdatePermissionDto { IsGranted = p.IsGranted, Name = p.Name }) .ToArray() }; + + if (!updateDto.Permissions.Any(x => x.IsGranted)) + { + if (!await Message.Confirm(L["RemoveAllPermissionsWarningMessage"].Value)) + { + return; + } + } await PermissionAppService.UpdateAsync(_providerName, _providerKey, updateDto); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/en.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/en.json index ba775f3ab0..98f3a60216 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/en.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/en.json @@ -5,6 +5,7 @@ "OnlyProviderPermissons": "Only this provider", "All": "All", "SelectAllInAllTabs": "Grant all permissions", - "SelectAllInThisTab": "Select all" + "SelectAllInThisTab": "Select all", + "RemoveAllPermissionsWarningMessage": "Are you sure you want to remove all permissions?" } } \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml index adc5547693..31639bf136 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml @@ -9,7 +9,7 @@ Layout = null; } -
    + diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index c33106d884..208047314c 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -3,6 +3,8 @@ var abp = abp || {}; abp.modals = abp.modals || {}; abp.modals.PermissionManagement = function () { + var l = abp.localization.getResource("AbpPermissionManagement"); + function checkParents($tab, $checkBox) { var parentName = $checkBox .closest('.custom-checkbox') @@ -255,6 +257,27 @@ var abp = abp || {}; initSelectAllInThisTab(); setSelectAllInAllTabs(); + + var $form = $("#PermissionManagementForm"); + var $submitButton = $form.find("button[type='submit']"); + if($submitButton) { + $submitButton.click(function (e) { + e.preventDefault(); + + if(!$form.find("input:checked").length > 0) { + abp.message.confirm(l("RemoveAllPermissionsWarningMessage")) + .then(function (confirmed) { + if(confirmed) { + $form.submit(); + } + }); + } + else { + $form.submit(); + } + }); + } + }; }; })(jQuery); diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo.Abp.SettingManagement.Application.csproj b/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo.Abp.SettingManagement.Application.csproj index 0ea73276ff..8061d285e7 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo.Abp.SettingManagement.Application.csproj +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo.Abp.SettingManagement.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor index 6037231df0..36d5857776 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor @@ -5,12 +5,12 @@ @if (EmailSettings != null) { - + - @L["DefaultFromDisplayName"] + @L["DefaultFromDisplayName"] * @@ -20,7 +20,7 @@ - @L["DefaultFromAddress"] + @L["DefaultFromAddress"] * diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs index 9e5638bfd9..1cd8ceeb1b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs @@ -1,9 +1,11 @@ using System; +using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Blazorise; using Microsoft.AspNetCore.Components; using Volo.Abp.AspNetCore.Components.Messages; using Volo.Abp.AspNetCore.Components.Web.Configuration; +using Volo.Abp.Auditing; using Volo.Abp.SettingManagement.Localization; namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSettingGroup; @@ -19,9 +21,9 @@ public partial class EmailSettingGroupViewComponent [Inject] protected IUiMessageService UiMessageService { get; set; } - protected EmailSettingsDto EmailSettings; + protected UpdateEmailSettingsViewModel EmailSettings; - protected Validations IdentitySettingValidation; + protected Validations EmailSettingValidation; public EmailSettingGroupViewComponent() { @@ -33,7 +35,7 @@ public partial class EmailSettingGroupViewComponent { try { - EmailSettings = await EmailSettingsAppService.GetAsync(); + EmailSettings = ObjectMapper.Map(await EmailSettingsAppService.GetAsync()); } catch (Exception ex) { @@ -45,7 +47,12 @@ public partial class EmailSettingGroupViewComponent { try { - await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map(EmailSettings)); + if (!await EmailSettingValidation.ValidateAll()) + { + return; + } + + await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map(EmailSettings)); await CurrentApplicationConfigurationCacheResetService.ResetAsync(); @@ -56,4 +63,45 @@ public partial class EmailSettingGroupViewComponent await HandleErrorAsync(ex); } } + + public class UpdateEmailSettingsViewModel + { + [MaxLength(256)] + [Display(Name = "SmtpHost")] + public string SmtpHost { get; set; } + + [Range(1, 65535)] + [Display(Name = "SmtpPort")] + public int SmtpPort { get; set; } + + [MaxLength(1024)] + [Display(Name = "SmtpUserName")] + public string SmtpUserName { get; set; } + + [MaxLength(1024)] + [DataType(DataType.Password)] + [DisableAuditing] + [Display(Name = "SmtpPassword")] + public string SmtpPassword { get; set; } + + [MaxLength(1024)] + [Display(Name = "SmtpDomain")] + public string SmtpDomain { get; set; } + + [Display(Name = "SmtpEnableSsl")] + public bool SmtpEnableSsl { get; set; } + + [Display(Name = "SmtpUseDefaultCredentials")] + public bool SmtpUseDefaultCredentials { get; set; } + + [MaxLength(1024)] + [Required] + [Display(Name = "DefaultFromAddress")] + public string DefaultFromAddress { get; set; } + + [MaxLength(1024)] + [Required] + [Display(Name = "DefaultFromDisplayName")] + public string DefaultFromDisplayName { get; set; } + } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/SettingManagementBlazorAutoMapperProfile.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/SettingManagementBlazorAutoMapperProfile.cs index d5309e0aff..38279c09d4 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/SettingManagementBlazorAutoMapperProfile.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/SettingManagementBlazorAutoMapperProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement.EmailSettingGroup; namespace Volo.Abp.SettingManagement.Blazor; @@ -6,6 +7,7 @@ public class SettingManagementBlazorAutoMapperProfile : Profile { public SettingManagementBlazorAutoMapperProfile() { - CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs index 012133e10b..7e19e63a2f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs @@ -3,6 +3,7 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using Volo.Abp.SettingManagement.Localization; using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.SettingManagement; @@ -23,7 +24,9 @@ public class AbpSettingManagementDomainSharedModule : AbpModule { options.Resources .Add("en") - .AddVirtualJson("/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement"); + .AddBaseTypes( + typeof(AbpValidationResource) + ).AddVirtualJson("/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement"); }); } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs index 1c83245c63..61874c0b6b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs @@ -1,9 +1,12 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; using Volo.Abp.Http.ProxyScripting.Generators.JQuery; using Volo.Abp.Modularity; +using Volo.Abp.SettingManagement.Localization; using Volo.Abp.SettingManagement.Web.Navigation; using Volo.Abp.SettingManagement.Web.Pages.SettingManagement; using Volo.Abp.SettingManagement.Web.Settings; @@ -14,6 +17,7 @@ namespace Volo.Abp.SettingManagement.Web; [DependsOn( typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpAutoMapperModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule), typeof(AbpSettingManagementDomainSharedModule) )] @@ -21,6 +25,11 @@ public class AbpSettingManagementWebModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(AbpSettingManagementResource), typeof(AbpSettingManagementWebModule).Assembly); + }); + PreConfigure(mvcBuilder => { mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpSettingManagementWebModule).Assembly); @@ -29,6 +38,7 @@ public class AbpSettingManagementWebModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => { options.MenuContributors.Add(new SettingManagementMainMenuContributor()); @@ -58,5 +68,11 @@ public class AbpSettingManagementWebModule : AbpModule { options.DisableModule(SettingManagementRemoteServiceConsts.ModuleName); }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.cshtml b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.cshtml index 974e316687..e5d20309f6 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.cshtml +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.cshtml @@ -1,28 +1,30 @@ @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.SettingManagement.Localization @inject IHtmlLocalizer L -@model Volo.Abp.SettingManagement.EmailSettingsDto +@model Volo.Abp.SettingManagement.Web.Pages.SettingManagement.Components.EmailSettingGroup.EmailSettingGroupViewComponent.UpdateEmailSettingsViewModel - +
    - - - - - - + + + + + +
    - - - + + +
    -
    +
    - @L["Save"] + + @L["Save"] +
    - + \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.js index a5b8288d41..c9871bb3d9 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/Default.js @@ -6,8 +6,12 @@ $("#EmailSettingsForm").on('submit', function (event) { event.preventDefault(); + + if(!$(this).valid()) { + return; + } + var form = $(this).serializeFormToObject(); - volo.abp.settingManagement.emailSettings.update(form).then(function (result) { $(document).trigger("AbpSettingSaved"); }); diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/EmailSettingGroupViewComponent.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/EmailSettingGroupViewComponent.cs index bd0e8d924e..83458b28e2 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/EmailSettingGroupViewComponent.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Components/EmailSettingGroup/EmailSettingGroupViewComponent.cs @@ -1,6 +1,8 @@ -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Auditing; namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement.Components.EmailSettingGroup; @@ -16,8 +18,49 @@ public class EmailSettingGroupViewComponent : AbpViewComponent public virtual async Task InvokeAsync() { - var model = await EmailSettingsAppService.GetAsync(); - + var emailSettings = await EmailSettingsAppService.GetAsync(); + var model = ObjectMapper.Map(emailSettings); return View("~/Pages/SettingManagement/Components/EmailSettingGroup/Default.cshtml", model); } + + public class UpdateEmailSettingsViewModel + { + [MaxLength(256)] + [Display(Name = "SmtpHost")] + public string SmtpHost { get; set; } + + [Range(1, 65535)] + [Display(Name = "SmtpPort")] + public int SmtpPort { get; set; } + + [MaxLength(1024)] + [Display(Name = "SmtpUserName")] + public string SmtpUserName { get; set; } + + [MaxLength(1024)] + [DataType(DataType.Password)] + [DisableAuditing] + [Display(Name = "SmtpPassword")] + public string SmtpPassword { get; set; } + + [MaxLength(1024)] + [Display(Name = "SmtpDomain")] + public string SmtpDomain { get; set; } + + [Display(Name = "SmtpEnableSsl")] + public bool SmtpEnableSsl { get; set; } + + [Display(Name = "SmtpUseDefaultCredentials")] + public bool SmtpUseDefaultCredentials { get; set; } + + [MaxLength(1024)] + [Required] + [Display(Name = "DefaultFromAddress")] + public string DefaultFromAddress { get; set; } + + [MaxLength(1024)] + [Required] + [Display(Name = "DefaultFromDisplayName")] + public string DefaultFromDisplayName { get; set; } + } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/SettingManagementWebAutoMapperProfile.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/SettingManagementWebAutoMapperProfile.cs new file mode 100644 index 0000000000..19e512da56 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/SettingManagementWebAutoMapperProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; +using Volo.Abp.SettingManagement.Web.Pages.SettingManagement.Components.EmailSettingGroup; + +namespace Volo.Abp.SettingManagement.Web; + +public class SettingManagementWebAutoMapperProfile : Profile +{ + public SettingManagementWebAutoMapperProfile() + { + CreateMap(); + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj index c7cbc9c60b..b802865379 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj @@ -15,6 +15,7 @@
    + diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo.Abp.TenantManagement.Application.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo.Abp.TenantManagement.Application.csproj index 3c9da24d7e..25e39ab17c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo.Abp.TenantManagement.Application.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo.Abp.TenantManagement.Application.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + net6.0 Volo.Abp.TenantManagement.Application Volo.Abp.TenantManagement.Application $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj index 5de64b7a1d..f461433d14 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Abp.TenantManagement.Domain Volo.Abp.TenantManagement.Domain $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs index 1fdeeb562b..34d350d242 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/EfCoreTenantRepository.cs @@ -74,7 +74,7 @@ public class EfCoreTenantRepository : EfCoreRepository u.Name.Contains(filter) - ).CountAsync(cancellationToken: cancellationToken); + ).CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); } [Obsolete("Use WithDetailsAsync method.")] diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo.Abp.TenantManagement.MongoDB.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo.Abp.TenantManagement.MongoDB.csproj index dd8726dccb..d10686b721 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo.Abp.TenantManagement.MongoDB.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo.Abp.TenantManagement.MongoDB.csproj @@ -4,7 +4,7 @@ - netstandard2.0 + netstandard2.1 Volo.Abp.TenantManagement.MongoDB Volo.Abp.TenantManagement.MongoDB $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs index 5da1dad761..321dcf365f 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/MongoTenantRepository.cs @@ -69,6 +69,6 @@ public class MongoTenantRepository : MongoDbRepository u.Name.Contains(filter) - ).CountAsync(cancellationToken: cancellationToken); + ).CountAsync(cancellationToken: GetCancellationToken(cancellationToken)); } } diff --git a/npm/packs/cms-kit.admin/package.json b/npm/packs/cms-kit.admin/package.json index c7c02508b4..17d676756d 100644 --- a/npm/packs/cms-kit.admin/package.json +++ b/npm/packs/cms-kit.admin/package.json @@ -8,7 +8,8 @@ "@abp/jstree": "~5.2.1", "@abp/slugify": "~5.2.1", "@abp/tui-editor": "~5.2.1", - "@abp/uppy": "~5.2.1" + "@abp/uppy": "~5.2.1", + "@abp/codemirror": "~5.2.1" }, "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" } diff --git a/npm/packs/codemirror/abp.resourcemapping.js b/npm/packs/codemirror/abp.resourcemapping.js index 71731c389b..d7f349b54a 100644 --- a/npm/packs/codemirror/abp.resourcemapping.js +++ b/npm/packs/codemirror/abp.resourcemapping.js @@ -1,5 +1,8 @@ module.exports = { mappings: { - "@node_modules/codemirror/lib/*.*": "@libs/codemirror/" + "@node_modules/codemirror/lib/*.*": "@libs/codemirror/", + "@node_modules/codemirror/mode/**/*.*": "@libs/codemirror/mode/", + "@node_modules/codemirror/theme/**/*.*": "@libs/codemirror/theme/", + "@node_modules/codemirror/addon/**/*.*": "@libs/codemirror/addon/" } } \ No newline at end of file diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index facff2f25a..a71f467287 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -177,6 +177,7 @@ $projects = ( "framework/src/Volo.Abp.ExceptionHandling", "framework/src/Volo.Abp.Features", "framework/src/Volo.Abp.FluentValidation", + "framework/src/Volo.Abp.Gdpr.Abstractions", "framework/src/Volo.Abp.GlobalFeatures", "framework/src/Volo.Abp.Guids", "framework/src/Volo.Abp.HangFire", diff --git a/templates/app-nolayers/angular/package.json b/templates/app-nolayers/angular/package.json index 5e66eb239a..6fdafdd93a 100644 --- a/templates/app-nolayers/angular/package.json +++ b/templates/app-nolayers/angular/package.json @@ -49,7 +49,7 @@ "@typescript-eslint/eslint-plugin": "5.3.0", "@typescript-eslint/parser": "5.3.0", "eslint": "^8.2.0", - "jasmine-core": "~3.7.0", + "jasmine-core": "~4.0.0", "karma": "~6.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.1.0", diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs index 051587bb5c..07e558fb39 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs @@ -18,12 +18,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs index 0226e0a554..4553f8cfd1 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs @@ -24,12 +24,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/_Imports.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/_Imports.razor new file mode 100644 index 0000000000..fe27745143 --- /dev/null +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/_Imports.razor @@ -0,0 +1,13 @@ +@using System.Net.Http +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using MyCompanyName.MyProjectName.Blazor.Server +@using Blazorise +@using Blazorise.DataGrid +@using Volo.Abp.BlazoriseUI +@using Volo.Abp.BlazoriseUI.Components \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs index a9366b95fe..6eb33e471a 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs @@ -17,12 +17,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs index c4c428b90d..199b799da8 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs @@ -23,12 +23,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs index e3b1aeed74..9d076b5f23 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs @@ -18,12 +18,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs index 358f8dda73..57e81aa17c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs @@ -24,12 +24,9 @@ public class Program .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() -#if DEBUG .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()); -#else - .WriteTo.Async(c => c.File("Logs/logs.txt")); -#endif + if (IsMigrateDatabase(args)) { loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); diff --git a/templates/app-nolayers/aspnet-core/migrate-database.ps1 b/templates/app-nolayers/aspnet-core/migrate-database.ps1 new file mode 100644 index 0000000000..3af47fcb21 --- /dev/null +++ b/templates/app-nolayers/aspnet-core/migrate-database.ps1 @@ -0,0 +1 @@ +dotnet run --migrate-database \ No newline at end of file diff --git a/templates/app/angular/package.json b/templates/app/angular/package.json index 5e66eb239a..cdddc9c658 100644 --- a/templates/app/angular/package.json +++ b/templates/app/angular/package.json @@ -20,36 +20,36 @@ "@abp/ng.tenant-management": "~5.2.1", "@abp/ng.theme.basic": "~5.2.1", "@abp/ng.theme.shared": "~5.2.1", - "@angular/animations": "~13.1.1", - "@angular/common": "~13.1.1", - "@angular/compiler": "~13.1.1", - "@angular/core": "~13.1.1", - "@angular/forms": "~13.1.1", - "@angular/localize": "~13.1.1", - "@angular/platform-browser": "~13.1.1", - "@angular/platform-browser-dynamic": "~13.1.1", - "@angular/router": "~13.1.1", + "@angular/animations": "~13.3.3", + "@angular/common": "~13.3.3", + "@angular/compiler": "~13.3.3", + "@angular/core": "~13.3.3", + "@angular/forms": "~13.3.3", + "@angular/localize": "~13.3.3", + "@angular/platform-browser": "~13.3.3", + "@angular/platform-browser-dynamic": "~13.3.3", + "@angular/router": "~13.3.3", "rxjs": "~6.6.0", "tslib": "^2.1.0", "zone.js": "~0.11.4" }, "devDependencies": { "@abp/ng.schematics": "~5.2.1", - "@angular-devkit/build-angular": "~13.1.2", - "@angular-eslint/builder": "~13.0.1", - "@angular-eslint/eslint-plugin": "~13.0.1", - "@angular-eslint/eslint-plugin-template": "~13.0.1", - "@angular-eslint/schematics": "~13.0.1", - "@angular-eslint/template-parser": "~13.0.1", - "@angular/cli": "~13.1.2", - "@angular/compiler-cli": "~13.1.1", - "@angular/language-service": "~13.1.1", + "@angular-devkit/build-angular": "~13.3.3", + "@angular-eslint/builder": "~13.2.1", + "@angular-eslint/eslint-plugin": "~13.2.1", + "@angular-eslint/eslint-plugin-template": "~13.2.1", + "@angular-eslint/schematics": "~13.2.1", + "@angular-eslint/template-parser": "~13.2.1", + "@angular/cli": "~13.3.3", + "@angular/compiler-cli": "~13.3.3", + "@angular/language-service": "~13.3.3", "@types/jasmine": "~3.6.0", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.3.0", "@typescript-eslint/parser": "5.3.0", "eslint": "^8.2.0", - "jasmine-core": "~3.7.0", + "jasmine-core": "~4.0.0", "karma": "~6.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.1.0", @@ -58,4 +58,4 @@ "ng-packagr": "^13.1.2", "typescript": "~4.5.4" } -} +} \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index 063434c52c..6a4c2c8d6e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -1,7 +1,6 @@ @page "/" @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase -@inject ICurrentTenant CurrentTenant @inject AuthenticationStateProvider AuthenticationStateProvider
    diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Program.cs index d028aeafad..d4399ec884 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 874098dd6b..543054d1c1 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -1,7 +1,6 @@ @page "/" @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase -@inject ICurrentTenant CurrentTenant @inject AuthenticationStateProvider AuthenticationStateProvider
    diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Program.cs index 8cffe96c42..6e2f2085dc 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj index 593ebf5868..93f45f455d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj @@ -5,6 +5,9 @@ net6.0 true + + service-worker-assets.js + @@ -29,4 +32,10 @@ + + + + + + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index bf959ba3d0..3cd56e9cac 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -1,7 +1,6 @@ @page "/" @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase -@inject ICurrentTenant CurrentTenant @inject AuthenticationStateProvider AuthenticationStateProvider
    diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-192.png b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-192.png new file mode 100644 index 0000000000..166f56da76 Binary files /dev/null and b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-192.png differ diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-512.png b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-512.png new file mode 100644 index 0000000000..c2dd4842dc Binary files /dev/null and b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-512.png differ diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html index cea9eeca0d..4a86d7bdc6 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html @@ -12,6 +12,12 @@ + + + + + + @@ -25,5 +31,9 @@ + + + + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/manifest.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/manifest.json new file mode 100644 index 0000000000..eefb83cb28 --- /dev/null +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/manifest.json @@ -0,0 +1,21 @@ +{ + "name": "MyProjectName", + "short_name": "MyCompanyName.MyProjectName", + "start_url": "./", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#03173d", + "prefer_related_applications": false, + "icons": [ + { + "src": "icon-512.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "icon-192.png", + "type": "image/png", + "sizes": "192x192" + } + ] +} diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.js new file mode 100644 index 0000000000..fe614daee0 --- /dev/null +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.js @@ -0,0 +1,4 @@ +// In development, always fetch from the network and do not enable offline support. +// This is because caching would make development more difficult (changes would not +// be reflected on the first load after each change). +self.addEventListener('fetch', () => { }); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.published.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.published.js new file mode 100644 index 0000000000..0d9986fce1 --- /dev/null +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.published.js @@ -0,0 +1,48 @@ +// Caution! Be sure you understand the caveats before publishing an application with +// offline support. See https://aka.ms/blazor-offline-considerations + +self.importScripts('./service-worker-assets.js'); +self.addEventListener('install', event => event.waitUntil(onInstall(event))); +self.addEventListener('activate', event => event.waitUntil(onActivate(event))); +self.addEventListener('fetch', event => event.respondWith(onFetch(event))); + +const cacheNamePrefix = 'offline-cache-'; +const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`; +const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ]; +const offlineAssetsExclude = [ /^service-worker\.js$/ ]; + +async function onInstall(event) { + console.info('Service worker: Install'); + + // Fetch and cache all matching items from the assets manifest + const assetsRequests = self.assetsManifest.assets + .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url))) + .filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url))) + .map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' })); + await caches.open(cacheName).then(cache => cache.addAll(assetsRequests)); +} + +async function onActivate(event) { + console.info('Service worker: Activate'); + + // Delete unused caches + const cacheKeys = await caches.keys(); + await Promise.all(cacheKeys + .filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName) + .map(key => caches.delete(key))); +} + +async function onFetch(event) { + let cachedResponse = null; + if (event.request.method === 'GET') { + // For all navigation requests, try to serve index.html from cache + // If you need some URLs to be server-rendered, edit the following check to exclude those URLs + const shouldServeIndexHtml = event.request.mode === 'navigate'; + + const request = shouldServeIndexHtml ? 'index.html' : event.request; + const cache = await caches.open(cacheName); + cachedResponse = await cache.match(request); + } + + return cachedResponse || fetch(event.request); +} diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs index b3bb9299ba..149b9ad46d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs index b3bb9299ba..149b9ad46d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs index 2699dc2993..756b7da688 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs index 8c345c70a2..7894ee68b6 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs index 8c345c70a2..7894ee68b6 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock index 4eb7e9ff11..ba1ca22dfb 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.0.1.tgz#884a4bc9ea043654891be56cd7e7c7bbf9bbad8c" - integrity sha512-JGTQyg3Zyfda84yg/Geq6rGuBN2SX4gIOaFL2h8BX9bA8CVuBC+zcwfO1bBsP89xfTyPvdSAGBvSfhCjPwsukQ== - dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "~5.0.1" - -"@abp/aspnetcore.mvc.ui.theme.shared@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.0.1.tgz#77a4900424603e0be048f3507aa852701f3139a2" - integrity sha512-mn9HEOHBkmBr7d/VUt0bfg9K58IyRDb7j3ZiDoHo263WLXJkf0+C7MEbv/zxfDHW4NeztsNCd3ugA7PdTxPzmA== - dependencies: - "@abp/aspnetcore.mvc.ui" "~5.0.1" - "@abp/bootstrap" "~5.0.1" - "@abp/bootstrap-datepicker" "~5.0.1" - "@abp/datatables.net-bs5" "~5.0.1" - "@abp/font-awesome" "~5.0.1" - "@abp/jquery-form" "~5.0.1" - "@abp/jquery-validation-unobtrusive" "~5.0.1" - "@abp/lodash" "~5.0.1" - "@abp/luxon" "~5.0.1" - "@abp/malihu-custom-scrollbar-plugin" "~5.0.1" - "@abp/select2" "~5.0.1" - "@abp/sweetalert2" "~5.0.1" - "@abp/timeago" "~5.0.1" - "@abp/toastr" "~5.0.1" - -"@abp/aspnetcore.mvc.ui@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.0.1.tgz#f5aa4e0dcc10878f590e30836887f3f9861e91e3" - integrity sha512-bN15UcNhTqeo0RXlIYws7Jd8ZfSBsVM6Y5wiAqbq1Q3Lvs1uLmryhZpn6sHmKw2Z3Lnhec7VjnZN0FwNpzEqUw== +"@abp/aspnetcore.mvc.ui.theme.basic@^5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-5.2.0-rc.2.tgz#d2cf4a0f2b8a93f1fe53a0bc6c66d9c3233b620a" + integrity sha512-aQk3RSl31UT4gEqiHT3oV06BZ/k6q1DVKBwVOj+YQEIb8ojptJtbGv+aUhHEql5I7zwiWe4EWf2rM2Ve0JQa6Q== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~5.2.0-rc.2" + +"@abp/aspnetcore.mvc.ui.theme.shared@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-5.2.0-rc.2.tgz#9ff2eb2a1b5f438d8f848659400100e20f74fc77" + integrity sha512-m06zMEt0C9P3f7+Qg7SjvP+k4wHPqvAOzsd5jDNN0JekeWH4gIMsqgDAoRB2SA72HUUpMbGe8Utune7EgE/T1Q== + dependencies: + "@abp/aspnetcore.mvc.ui" "~5.2.0-rc.2" + "@abp/bootstrap" "~5.2.0-rc.2" + "@abp/bootstrap-datepicker" "~5.2.0-rc.2" + "@abp/datatables.net-bs5" "~5.2.0-rc.2" + "@abp/font-awesome" "~5.2.0-rc.2" + "@abp/jquery-form" "~5.2.0-rc.2" + "@abp/jquery-validation-unobtrusive" "~5.2.0-rc.2" + "@abp/lodash" "~5.2.0-rc.2" + "@abp/luxon" "~5.2.0-rc.2" + "@abp/malihu-custom-scrollbar-plugin" "~5.2.0-rc.2" + "@abp/select2" "~5.2.0-rc.2" + "@abp/sweetalert2" "~5.2.0-rc.2" + "@abp/timeago" "~5.2.0-rc.2" + "@abp/toastr" "~5.2.0-rc.2" + +"@abp/aspnetcore.mvc.ui@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-5.2.0-rc.2.tgz#427811f66eb738dbb89434e926b36a2309fe43b2" + integrity sha512-+ss9MctYTF9Ewn7VEsMqszEoiX51G070kN2bIepgyXnYetrQRFsTgQGa4yi1bAqyAF9rZ1j0hSB0eM2clFyJMg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,152 +41,151 @@ merge-stream "^2.0.0" micromatch "^4.0.2" -"@abp/bootstrap-datepicker@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.0.1.tgz#52116a154e343d84c87257ad1ef10b54012f4c33" - integrity sha512-ZJWaZKzGzshBAfyBqaUScfWqeBVfWGbZIwIplF8VKtDGcyI8R54bqDsydhS88CCnolRz4+tfq3QY6yAXrUEKAw== +"@abp/bootstrap-datepicker@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-5.2.0-rc.2.tgz#bfb648e7b8e5d2a9806301417c7864abb4cc26e2" + integrity sha512-wKR+5g/xx7zqFGFaOZVO9XySlrOmOFH/ZidDpq9QYjE+OoHSlS8X5DUnkbXj2MbQy4etZuvz9ILcmnBPonrQ7g== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.0.1.tgz#d542a8fd7151e22eda1643e313a67f9892c50533" - integrity sha512-wyVAp6a4OIwlqK7AZozs7wpsBZgzG55EKeChBBfUXloJPuirQHxccFNE41aAYWfKur+wj25WD5NBnzFuKyNYiQ== +"@abp/bootstrap@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-5.2.0-rc.2.tgz#0375b38317c5d1f5f6cb7d46a0ee6bf9b85a6f4f" + integrity sha512-hsgxY8WNRonQZP3cmMKvBNHnyCSBfbBB4savLW5r7CxysjnRt6MDyhmmj7XVwVTC1siBviUcWClOHCJisaNRSw== dependencies: - "@abp/core" "~5.0.1" - bootstrap "^5.1.0" - bootstrap-v4-rtl "4.6.0-1" + "@abp/core" "~5.2.0-rc.2" + bootstrap "^5.1.3" -"@abp/core@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.0.1.tgz#904fa2c22bcbf42deb56abf772c3a53362807a2f" - integrity sha512-QzX35Oa+Vncu2OP1tXvGjAVFznmD1tZRn4tlDQgn36B2MU06UEO0JSx7JVedPvhzQZceUe5+WWMfuYNM2xeBTw== +"@abp/core@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-5.2.0-rc.2.tgz#f0c3dd7f0b12e8e13a702a3b0a53aa4525da673e" + integrity sha512-zotgZOXmkh+aD0KExBr4QytQfDDHxrG15e2HFzYKywhd0mpnwAVdR2Z2Ye01C360wJ2opv0mtgaSuEZniXNO3Q== dependencies: - "@abp/utils" "~5.0.1" + "@abp/utils" "~5.2.0-rc.2" -"@abp/datatables.net-bs5@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.0.1.tgz#b8afa2255e374c86c50e57bd57c2b36a86d6a890" - integrity sha512-1fuCk+K4xW3XnDFo2+kPXHMoOTol4HLRcWVRELjoBQ5YbTxEPsbrhfNUeUsECDAmkxoqY7G3MEdtIVwmy5NPpg== +"@abp/datatables.net-bs5@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-5.2.0-rc.2.tgz#df5cbe004ba3a2330cc667b3724440c4881cc6b2" + integrity sha512-Q2Sy6MMWM3EuELHeHxKkDflPTX09ictonjB5vn/Cau2PHuOkWTnL0Ystl91a1DetQIa1ejJL/YB+Pz1TUVoUNA== dependencies: - "@abp/datatables.net" "~5.0.1" - datatables.net-bs5 "^1.10.25" + "@abp/datatables.net" "~5.2.0-rc.2" + datatables.net-bs5 "^1.11.4" -"@abp/datatables.net@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.0.1.tgz#0ce5bdf7aa5bf224b93a22758a016c50562d6569" - integrity sha512-x9D2YNtnOJRrKXi2Pwrqzz9sIOrn3o6x2c8ZxjyC54vh+SLQtLycAzQw7OyaZGdbFkudlJiCuME/FiuZvht8Og== +"@abp/datatables.net@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-5.2.0-rc.2.tgz#bfdc01302d19eab0d73eff908238bf88c5806e74" + integrity sha512-TG1b8moW4RqCyNtzQKB7RnCmDt1cDEy/5WD++Maz2x4/yvu1uBBa6qLR7Mn6UNgoC51Y/op+LzaabkwXUSJl4w== dependencies: - "@abp/jquery" "~5.0.1" - datatables.net "^1.10.21" + "@abp/jquery" "~5.2.0-rc.2" + datatables.net "^1.11.4" -"@abp/font-awesome@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.0.1.tgz#661753403499925661f880c53214841dd34f5210" - integrity sha512-C+alReNvHZzST55ITBTyFqhdTehPo5ondzfqc9QlyB3Kwk1DIq0CaLqfS2xU5glYGDSqKi7xfkyQnJdwu2hKRA== +"@abp/font-awesome@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-5.2.0-rc.2.tgz#0292cb22c0280dccfe148ad3d46947ede26f8b14" + integrity sha512-FzjH/lnAglswqU7/YAXZP0H/ocGBrDkegMiQ7OjzZVcgGPS9BnqRPbiHDz7mjBHaQHzBtTCcZrXnU0l3GXCdbw== dependencies: - "@abp/core" "~5.0.1" - "@fortawesome/fontawesome-free" "^5.13.0" + "@abp/core" "~5.2.0-rc.2" + "@fortawesome/fontawesome-free" "^5.15.4" -"@abp/jquery-form@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.0.1.tgz#20fa51946f68a7acd6ef3dd3d8d1349307f681b4" - integrity sha512-Q7GG0+XFXs7pDoa4p3r7vm8+sUh5ohwovedPNVghtX8Rm2I1sfVfJKamPr24PCAyJcFVntU1WCt/CngneES3pw== +"@abp/jquery-form@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-5.2.0-rc.2.tgz#797e3b72a91435d74f19ddaa9b2e6e04fcfed616" + integrity sha512-cVbReCeM5q7nqeQDjSIH7VmuMwX8lE36D9sariUw8xSUn5GJlnrGYNV4kE7G9JLIlIRanIlS3SPuA3RFA2z9ZA== dependencies: - "@abp/jquery" "~5.0.1" + "@abp/jquery" "~5.2.0-rc.2" jquery-form "^4.3.0" -"@abp/jquery-validation-unobtrusive@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.0.1.tgz#50798d3c087d0b103944b3a9e7c39a1f51db9fdc" - integrity sha512-w5SAYB0EZRbOhIFcCUXWvoGB/dWj3zyQOarbvzJ9LelgrXvvoissaaSSqq6BySjr1UigIWBCVuruAQssizmXBQ== +"@abp/jquery-validation-unobtrusive@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-5.2.0-rc.2.tgz#ec0c22cecef3016c1da0b8dca4374a263915a835" + integrity sha512-b+ttLlnRPgDB7V2tnYp8+1Q3niM4ZmiU/ZaQB4z6gSMk/2tPAIhOOwAQt7DYRWSMUsgGFI0NvsgEBM9aLTikFA== dependencies: - "@abp/jquery-validation" "~5.0.1" - jquery-validation-unobtrusive "^3.2.11" + "@abp/jquery-validation" "~5.2.0-rc.2" + jquery-validation-unobtrusive "^3.2.12" -"@abp/jquery-validation@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.0.1.tgz#5932060d1fdf04a81e998caac959188aefdf1669" - integrity sha512-T5p0U2cWh6Jov55AiUxJYRw92L6ubFXfqL0EkaePV5AnoetVXheluhq9gQAKnwVAqtc/3Rxkr/lO047catUkjw== +"@abp/jquery-validation@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-5.2.0-rc.2.tgz#a98383e6c7fb21b74ecde937c25d7fa46810a333" + integrity sha512-6lVxJyMfL0kHmv8tpxLhVfK0Rf+qjLMPkm1qHd0pSwvH+GM0QMN39s9TaexCvH3QO70BlEnwXJ2PWVY9OQY5uw== dependencies: - "@abp/jquery" "~5.0.1" - jquery-validation "^1.19.2" + "@abp/jquery" "~5.2.0-rc.2" + jquery-validation "^1.19.3" -"@abp/jquery@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.0.1.tgz#1522ba1e0c488bffdc30a230ab35e225ae32d028" - integrity sha512-AacK4cy/RpzBfRYf7Jjn+TmVm72TW0jEjRoQ3TOXmlOrunRph05mQm72Ux2o8+Z1lOwxJKRz5gKSbRTfa6Tgpw== +"@abp/jquery@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-5.2.0-rc.2.tgz#3235b92834cbca4d3e22fb0b19122aa2a24b8262" + integrity sha512-u7xpQcaMpzlXq018qBdzwWmPx+65QHPq5VhI7aAvZAUlQrvQjiiCeG25egxOeCL0aROcCjsAlnTItT1U/q9loQ== dependencies: - "@abp/core" "~5.0.1" + "@abp/core" "~5.2.0-rc.2" jquery "~3.6.0" -"@abp/lodash@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.0.1.tgz#ad22895772ce65e52941dddb84d0a7d26c521d59" - integrity sha512-r1QqZCXfDd0YQnE4MkcY291H5jWFdZtGeYmwjIkn7aeOZ0PP9qsDPkWTwPwbpfmnz4DhmIdO5a1rveWz/J5ZwQ== +"@abp/lodash@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-5.2.0-rc.2.tgz#e55f11279d4f374785a56ec68ed99cdf2495a9aa" + integrity sha512-BR6d1NbTcuk772RK8VdeHBokbqZ1OHUgRKdPG3MXlDGKZmUS4/ijFdRiIvo7Rd0WFqgk2QdbHw3lfKQ/CGqyhw== dependencies: - "@abp/core" "~5.0.1" - lodash "^4.17.15" + "@abp/core" "~5.2.0-rc.2" + lodash "^4.17.21" -"@abp/luxon@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.0.1.tgz#7930e30db60e63b486a51030c60e09b54bcb3867" - integrity sha512-cXbnyAI9Gn2bZBQuCN46UFOkzb+djA3LMgpeMlTTv0aA87PrjzT60EPQ4a9FLovESqNnblaQ9Je43QwoGH8kZA== +"@abp/luxon@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-5.2.0-rc.2.tgz#0d263482b9a73269164a8a58562ce8bd69b57f36" + integrity sha512-KIhpvl9kf43Bc/E/u6bmb1lp0asf81NoUoERQTRz7JqmH1XYJvJCqGHxommvItcu7zNjCLL6FK/JtO0v7DUiEw== dependencies: - "@abp/core" "~5.0.1" - luxon "^1.24.1" + "@abp/core" "~5.2.0-rc.2" + luxon "^2.3.0" -"@abp/malihu-custom-scrollbar-plugin@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.0.1.tgz#268ec30eef8ba72a0c8cb997e55d48a1508b2719" - integrity sha512-mqF6OizoWp6kg5pztNfF78+mbfyX3JAXDfv+ZUCvjtAqllIzyOUIqRSXULDkAcDeCC1+PluRsd+uSltIppC5hA== +"@abp/malihu-custom-scrollbar-plugin@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-5.2.0-rc.2.tgz#5136c0d59d5d385350f560c6d8a3d10f6393dea7" + integrity sha512-7Q8yZbU9YRA5/Y+rRLLiPD724rjfrVBuCpfp1+b99LyeFTFTSD2oNG3r/I6FC7tE5HLaFscJLJyOca4GPS1mww== dependencies: - "@abp/core" "~5.0.1" + "@abp/core" "~5.2.0-rc.2" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.0.1.tgz#644c46c7c942a6b9d36bc76c7132f32ad577933b" - integrity sha512-FHVqEebQS3XiYn5TMEhGaQJOAYnPqxivKpeOB0F0F2bEDGqt3OXh05KcQBOm+sDSScq3c7T7HLr9mMzlYtyHXw== +"@abp/select2@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-5.2.0-rc.2.tgz#2eef30442957ac02133357604a1256e995a9ebe7" + integrity sha512-1cFOavpWP6zRfrpXi0zozFkL6W0tEEBkWj7AiHU3AGctAQEZ0qWGKSTIExqnEsDb3LsjAKMdBycGdkLFbK97Og== dependencies: - "@abp/core" "~5.0.1" + "@abp/core" "~5.2.0-rc.2" select2 "^4.0.13" -"@abp/sweetalert2@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.0.1.tgz#acf2acfc04619c7907237238bfaeb63f2d75fb22" - integrity sha512-CPqXIaHK7Ff6i8gNhxoZ9r3te9LIEiDCUpdHNtgRVMCaLbywfkiLyirlfRIB6lxRWSw8BZ+M/azdp5uzidW8Vw== +"@abp/sweetalert2@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-5.2.0-rc.2.tgz#15b6718b1378e8bd7e0ea019b965e7b51f0cb1ea" + integrity sha512-1ROKcfpu0Xyk7ebUFMNBhFgENcHCMj48+1Lj/OxdJH3U7KhyF5WEs54uYgn8EvY2wTCgOkHCnqeK9bRCp5M9+g== dependencies: - "@abp/core" "~5.0.1" - sweetalert2 "^11.0.18" + "@abp/core" "~5.2.0-rc.2" + sweetalert2 "^11.3.6" -"@abp/timeago@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.0.1.tgz#09ca6302304de09baa5ac8c72b950515ab0d0451" - integrity sha512-6onXho8R6eiWfncONZFBn18OwgQPKIaRM73rVevpRGJTf2pylcHtCp4uHGsoqgCc+TQU7FyoKTTkg4lfvCQa0A== +"@abp/timeago@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-5.2.0-rc.2.tgz#e6ad0cb584515b95e47258976d726fd996b7f47d" + integrity sha512-D9Y7xfpP6neURDkP/WMrFh25G++0SUiGIDaCIElgymhNdVp2gm9pC633ShetMOFrPCSuOUvlzC2p4YkUdq0Lnw== dependencies: - "@abp/jquery" "~5.0.1" + "@abp/jquery" "~5.2.0-rc.2" timeago "^1.6.7" -"@abp/toastr@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.0.1.tgz#a3959df1de0c4640fabf508da9ccd3ed37ae2b03" - integrity sha512-ndL1uj2ce4PbGDzxh+QCIWYu+GAmW1Xwma4aJcq5zKo+xhlLJJnTe6QFGKr7wSsTVZMB7z1Pp2olvXH6an82+g== +"@abp/toastr@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-5.2.0-rc.2.tgz#b5f013f1f00dab648da2fe1cf4ece6691e6eafc7" + integrity sha512-FSkva7zP3kJFSh6SlmvrgjPFJscJbmrgCilxGxPGVxlg5p9LNORgkotNk2yKsGHX0F0rnKJ4kHepTq7g+oGMdw== dependencies: - "@abp/jquery" "~5.0.1" + "@abp/jquery" "~5.2.0-rc.2" toastr "^2.1.4" -"@abp/utils@~5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.0.1.tgz#57934383004a21172bf7e08130813c08946894fb" - integrity sha512-WLCWe7iJ8krxsz8Z7E+8GDaGZuG/6PZDdqPcMIh95opi0kvcLxb+mjPXXpiXdtFzW7O09a+NaNOxorsEFxjoKw== +"@abp/utils@~5.2.0-rc.2": + version "5.2.0-rc.2" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-5.2.0-rc.2.tgz#1280059ff3e948ae0827eaf06d916e5a90f8907b" + integrity sha512-/mo4dSXPkhCEbqyKunuURcF1cEzuJqRTPOGpjSrjDwOgymVSWp/AqqjJPBXuc4qrMfB4q9y+Iod5nslXp2cXeA== dependencies: just-compare "^1.3.0" -"@fortawesome/fontawesome-free@^5.13.0": - version "5.13.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.1.tgz#c53b4066edae16cd1fd669f687baf031b45fb9d6" - integrity sha512-D819f34FLHeBN/4xvw0HR0u7U2G7RqjPSggXqf7LktsxWQ48VAfGwvMrhcVuaZV2fF069c/619RdgCCms0DHhw== +"@fortawesome/fontawesome-free@^5.15.4": + version "5.15.4" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz#ecda5712b61ac852c760d8b3c79c96adca5554e5" + integrity sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg== abbrev@1: version "1.1.1" @@ -391,12 +390,7 @@ bootstrap-datepicker@^1.9.0: dependencies: jquery ">=1.7.1 <4.0.0" -bootstrap-v4-rtl@4.6.0-1: - version "4.6.0-1" - resolved "https://registry.yarnpkg.com/bootstrap-v4-rtl/-/bootstrap-v4-rtl-4.6.0-1.tgz#8fc502e800308fb725151128dd288df1c027cd8e" - integrity sha512-ChcbO5JeEQx6/Yz40YZLq3A4RIWcCmCCiRpweF5wg32/Q8CfWrwDNpcDTJ2SU+aSAewUJoCSzf/tRxhAgnZuog== - -bootstrap@^5.1.0: +bootstrap@^5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.1.3.tgz#ba081b0c130f810fa70900acbc1c6d3c28fa8f34" integrity sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q== @@ -603,25 +597,18 @@ d@1: dependencies: es5-ext "^0.10.9" -datatables.net-bs5@^1.10.25: - version "1.11.3" - resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-1.11.3.tgz#939d0e66fbf518718a519534a88fc88cd29405b0" - integrity sha512-u0tosKUR1XNpXzxOOt2NInnNYayt7GQoG+OM1xPRhdkZ7ZBD4oNF8S0aKve8yvSUq/ZwTMh4WJeh80GdmrJAdQ== +datatables.net-bs5@^1.11.4: + version "1.11.5" + resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-1.11.5.tgz#593608d54aeb7f91bcbd80bde304155ba3795663" + integrity sha512-1zyh972GtuK1uAb9h8nP3jJ7f/3UgCDq69LAaZS2bVd4mEHECJ6vrZLacxrkOHOs/q/H3v5sEMeZ46vXz8ox4w== dependencies: - datatables.net ">=1.10.25" + datatables.net ">=1.11.3" jquery ">=1.7" -datatables.net@>=1.10.25: - version "1.11.3" - resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.11.3.tgz#80e691036efcd62467558ee64c07dd566cb761b4" - integrity sha512-VMj5qEaTebpNurySkM6jy6sGpl+s6onPK8xJhYr296R/vUBnz1+id16NVqNf9z5aR076OGcpGHCuiTuy4E05oQ== - dependencies: - jquery ">=1.7" - -datatables.net@^1.10.21: - version "1.10.21" - resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.10.21.tgz#f1d35c8e5c3eb7f5caef39e80cd5b836a8c77103" - integrity sha512-/bSZtxmf3GTpYcvEmwZ8q26I1yhSx8qklR2B+s1K8+/51UW/zc2zTYwJMqr/Z+iCYixAc00ildj4g2x0Qamolw== +datatables.net@>=1.11.3, datatables.net@^1.11.4: + version "1.11.5" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-1.11.5.tgz#858a69953a01e1d5b18786769802117b04b8e3c9" + integrity sha512-nlFst2xfwSWaQgaOg5sXVG3cxYC0tH8E8d65289w9ROgF2TmLULOOpcdMpyxxUim/qEwVSEem42RjkTWEpr3eA== dependencies: jquery ">=1.7" @@ -1375,12 +1362,12 @@ jquery-mousewheel@>=3.0.6: version "3.1.13" resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" -jquery-validation-unobtrusive@^3.2.11: - version "3.2.11" - resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-3.2.11.tgz#175ee46380385a0e33ed320f255fad321f68f9f5" - integrity sha512-3FQPllaWdD+Aq55zJLGSW39+eXPDz1HhwAvrSwYi8zHQ8DVcu5IJ1HVeTiCl0BnCnrIBvfFU3zEB/DrGdcoRIQ== +jquery-validation-unobtrusive@^3.2.12: + version "3.2.12" + resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-3.2.12.tgz#1d52841f653e516525c251e494b042e664dad8af" + integrity sha512-kPixGhVcuat7vZXngGFfSIksy4VlzZcHyRgnBIZdsfVneCU+D5sITC8T8dD/9c9K/Q+qkMlgp7ufJHz93nKSuQ== dependencies: - jquery ">=1.8" + jquery "^3.5.1" jquery-validation ">=1.16" jquery-validation@>=1.16: @@ -1389,12 +1376,12 @@ jquery-validation@>=1.16: dependencies: jquery "^1.7 || ^2.0 || ^3.1" -jquery-validation@^1.19.2: - version "1.19.2" - resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.19.2.tgz#c602831b0d8c5881400af424e872757ce241eff9" - integrity sha512-yHaAqOGaAB7+p2u5lpzhhQVt3CBMUw3fHcuCJ7nXmXz0LWLHPN7yOhwnocp5nrn2SmnXR1jpV+whx2j1kLz1tQ== +jquery-validation@^1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.19.3.tgz#50b350eba8b02bcfd119ba15f199487b7eb64086" + integrity sha512-iXxCS5W7STthSTMFX/NDZfWHBLbJ1behVK3eAgHXAV8/0vRa9M4tiqHvJMr39VGWHMGdlkhrtrkBuaL2UlE8yw== -jquery@>=1.12.0, jquery@>=1.7, jquery@>=1.7.2, jquery@>=1.8, "jquery@^1.7 || ^2.0 || ^3.1": +jquery@>=1.12.0, jquery@>=1.7, jquery@>=1.7.2, "jquery@^1.7 || ^2.0 || ^3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" @@ -1403,7 +1390,7 @@ jquery@>=1.12.0, jquery@>=1.7, jquery@>=1.7.2, jquery@>=1.8, "jquery@^1.7 || ^2. resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== -jquery@~3.6.0: +jquery@^3.5.1, jquery@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw== @@ -1497,15 +1484,15 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -luxon@^1.24.1: - version "1.24.1" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.24.1.tgz#a8383266131ed4eaed4b5f430f96f3695403a52a" - integrity sha512-CgnIMKAWT0ghcuWFfCWBnWGOddM0zu6c4wZAWmD0NN7MZTnro0+833DF6tJep+xlxRPg4KtsYEHYLfTMBQKwYg== +luxon@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-2.3.1.tgz#f276b1b53fd9a740a60e666a541a7f6dbed4155a" + integrity sha512-I8vnjOmhXsMSlNMZlMkSOvgrxKJl0uOsEzdGgGNZuZPaS9KlefpE9KV95QFftlJSC+1UyCC9/I69R02cz/zcCA== make-iterator@^1.0.0: version "1.0.1" @@ -2356,10 +2343,10 @@ sver-compat@^1.5.0: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -sweetalert2@^11.0.18: - version "11.3.3" - resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.3.3.tgz#92ca0408380de8f29180788ce7ed5d5faf799cea" - integrity sha512-10Keqbmjng/+XpkpSOQ6dttpztl7XNohjnpC6bX6XFgm0WpRXM81YE0wmonGYOP6uyzd76vpfnZS04PdVvO31Q== +sweetalert2@^11.3.6: + version "11.4.6" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.4.6.tgz#c17ae901150c8a89ea85b93cefe5c4791f32e68a" + integrity sha512-7UDJV8etrJQ6vJGh88k7D63qBKtwEl8JV7zIxmO2Frp8ZGQDgQQC6f9ivqiVwLRxoEyfxsn/v3T6Zykk7/vlEg== tar@^4: version "4.4.10" diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index 3f2ae010fe..05f715c7c2 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -23,36 +23,36 @@ "@abp/ng.tenant-management": "~5.2.1", "@abp/ng.theme.basic": "~5.2.1", "@abp/ng.theme.shared": "~5.2.1", - "@angular/animations": "~13.1.1", - "@angular/common": "~13.1.1", - "@angular/compiler": "~13.1.1", - "@angular/core": "~13.1.1", - "@angular/forms": "~13.1.1", - "@angular/localize": "~13.1.1", - "@angular/platform-browser": "~13.1.1", - "@angular/platform-browser-dynamic": "~13.1.1", - "@angular/router": "~13.1.1", + "@angular/animations": "~13.3.3", + "@angular/common": "~13.3.3", + "@angular/compiler": "~13.3.3", + "@angular/core": "~13.3.3", + "@angular/forms": "~13.3.3", + "@angular/localize": "~13.3.3", + "@angular/platform-browser": "~13.3.3", + "@angular/platform-browser-dynamic": "~13.3.3", + "@angular/router": "~13.3.3", "rxjs": "~6.6.0", "tslib": "^2.1.0", "zone.js": "~0.11.4" }, "devDependencies": { "@abp/ng.schematics": "~5.2.1", - "@angular-devkit/build-angular": "~13.1.2", - "@angular-eslint/builder": "~13.0.1", - "@angular-eslint/eslint-plugin": "~13.0.1", - "@angular-eslint/eslint-plugin-template": "~13.0.1", - "@angular-eslint/schematics": "~13.0.1", - "@angular-eslint/template-parser": "~13.0.1", - "@angular/cli": "~13.1.2", - "@angular/compiler-cli": "~13.1.1", - "@angular/language-service": "~13.1.1", + "@angular-devkit/build-angular": "~13.3.3", + "@angular-eslint/builder": "~13.2.1", + "@angular-eslint/eslint-plugin": "~13.2.1", + "@angular-eslint/eslint-plugin-template": "~13.2.1", + "@angular-eslint/schematics": "~13.2.1", + "@angular-eslint/template-parser": "~13.2.1", + "@angular/cli": "~13.3.3", + "@angular/compiler-cli": "~13.3.3", + "@angular/language-service": "~13.3.3", "@types/jasmine": "~3.6.0", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.3.0", "@typescript-eslint/parser": "5.3.0", "eslint": "^8.2.0", - "jasmine-core": "~3.7.0", + "jasmine-core": "~4.0.0", "karma": "~6.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.1.0", @@ -62,4 +62,4 @@ "symlink-manager": "^1.5.0", "typescript": "~4.5.4" } -} +} \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Program.cs index cff77845f1..c7f18ffe4a 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs index a315163da3..be11164285 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs index 540e2312e2..89fa523a4d 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs @@ -22,9 +22,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs index 95f2d69043..874e5a9eb5 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs @@ -193,7 +193,7 @@ public class MyProjectNameWebHostModule : AbpModule options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar))); // - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Domain.Shared", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Application.Contracts", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}MyCompanyName.MyProjectName.Web", Path.DirectorySeparatorChar))); }); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs index 2d54ded331..e638a0176b 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs @@ -25,9 +25,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs index f8d7f828c5..0e0b569886 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs @@ -25,9 +25,7 @@ public class Program .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) -#if DEBUG .WriteTo.Async(c => c.Console()) -#endif .CreateLogger(); try diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj index c24b0db2a5..f97a38e9bf 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application/MyCompanyName.MyProjectName.Application.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + net6.0 MyCompanyName.MyProjectName diff --git a/test/AbpPerfTest/_results/with-without-abp-comparison.png b/test/AbpPerfTest/_results/with-without-abp-comparison.png new file mode 100644 index 0000000000..997e1bda13 Binary files /dev/null and b/test/AbpPerfTest/_results/with-without-abp-comparison.png differ