├── .gitattributes ├── .github └── workflows │ ├── publish-docs.yml │ └── publish.yml ├── .gitignore ├── .prettierrc ├── Directory.Build.props ├── EasyAbp.DynamicForm.abpmdl ├── EasyAbp.DynamicForm.abpsln.json ├── EasyAbp.DynamicForm.sln ├── EasyAbp.DynamicForm.sln.DotSettings ├── LICENSE ├── NuGet.Config ├── common.props ├── database ├── Dockerfile └── entrypoint.sh ├── docker-compose.migrations.yml ├── docker-compose.override.yml ├── docker-compose.yml ├── docs ├── README.md └── images │ ├── CreateFormItemTemplate.png │ ├── FormItemTemplates.png │ ├── FormTemplates.png │ └── Forms.png ├── host ├── EasyAbp.DynamicForm.AuthServer │ ├── Dockerfile │ ├── DynamicFormAuthServerModule.cs │ ├── EasyAbp.DynamicForm.AuthServer.abppkg.json │ ├── EasyAbp.DynamicForm.AuthServer.csproj │ ├── EntityFrameworkCore │ │ ├── AuthServerDbContext.cs │ │ └── AuthServerDbContextFactory.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── Migrations │ │ ├── 20220617083652_Initial.Designer.cs │ │ ├── 20220617083652_Initial.cs │ │ ├── 20230114065343_UpgradedToAbp7.Designer.cs │ │ ├── 20230114065343_UpgradedToAbp7.cs │ │ ├── 20230323102442_UpgradedToAbp_7_1.Designer.cs │ │ ├── 20230323102442_UpgradedToAbp_7_1.cs │ │ ├── 20230503132731_UpgradedToAbp_7_2.Designer.cs │ │ ├── 20230503132731_UpgradedToAbp_7_2.cs │ │ ├── 20231227144011_UpgradedToAbp_8_0.Designer.cs │ │ ├── 20231227144011_UpgradedToAbp_8_0.cs │ │ ├── 20240413135817_UpgradedToAbp_8_1.Designer.cs │ │ ├── 20240413135817_UpgradedToAbp_8_1.cs │ │ ├── 20240715035454_UpgradedToAbp_8_2.Designer.cs │ │ ├── 20240715035454_UpgradedToAbp_8_2.cs │ │ ├── 20241229125853_UpgradedToAbp_9_0.Designer.cs │ │ ├── 20241229125853_UpgradedToAbp_9_0.cs │ │ ├── 20250331070515_Upgraded_To_Abp_9_1.Designer.cs │ │ ├── 20250331070515_Upgraded_To_Abp_9_1.cs │ │ └── AuthServerDbContextModelSnapshot.cs │ ├── OpenIddict │ │ └── OpenIddictDataSeedContributor.cs │ ├── Pages │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── abp.resourcemapping.js │ ├── appsettings.json │ ├── appsettings.secrets.json │ ├── package.json │ └── yarn.lock ├── EasyAbp.DynamicForm.Blazor.Host │ ├── DynamicFormBlazorHostAutoMapperProfile.cs │ ├── DynamicFormBlazorHostBundleContributor.cs │ ├── DynamicFormBlazorHostModule.cs │ ├── DynamicFormHostBrandingProvider.cs │ ├── DynamicFormHostMenuContributor.cs │ ├── EasyAbp.DynamicForm.Blazor.Host.abppkg.json │ ├── EasyAbp.DynamicForm.Blazor.Host.csproj │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── Pages │ │ └── Index.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── _Imports.razor │ └── wwwroot │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── favicon.ico │ │ ├── global.css │ │ ├── global.js │ │ ├── index.html │ │ └── main.css ├── EasyAbp.DynamicForm.Blazor.Server.Host │ ├── DynamicFormBlazorHostModule.cs │ ├── DynamicFormBrandingProvider.cs │ ├── DynamicFormComponentBase.cs │ ├── DynamicFormDataSeedContributor.cs │ ├── EasyAbp.DynamicForm.Blazor.Server.Host.abppkg.json │ ├── EasyAbp.DynamicForm.Blazor.Server.Host.csproj │ ├── EntityFrameworkCore │ │ ├── UnifiedDbContext.cs │ │ └── UnifiedDbContextFactory.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── InternalFormFormOperationAuthorizationHandler.cs │ ├── InternalFormFormTemplateOperationAuthorizationHandler.cs │ ├── Menus │ │ ├── DynamicFormMenuContributor.cs │ │ └── DynamicFormMenus.cs │ ├── Migrations │ │ ├── 20220617083658_Initial.Designer.cs │ │ ├── 20220617083658_Initial.cs │ │ ├── 20221109155824_AddedEntities.Designer.cs │ │ ├── 20221109155824_AddedEntities.cs │ │ ├── 20221109191114_AddedFormItemDisplayOrder.Designer.cs │ │ ├── 20221109191114_AddedFormItemDisplayOrder.cs │ │ ├── 20221206060434_AddedGroupProperties.Designer.cs │ │ ├── 20221206060434_AddedGroupProperties.cs │ │ ├── 20221206063336_AddedFormItemInfoTextProperty.Designer.cs │ │ ├── 20221206063336_AddedFormItemInfoTextProperty.cs │ │ ├── 20230114065346_UpgradedToAbp7.Designer.cs │ │ ├── 20230114065346_UpgradedToAbp7.cs │ │ ├── 20230116092437_AddedFormItemTemplateDisabled.Designer.cs │ │ ├── 20230116092437_AddedFormItemTemplateDisabled.cs │ │ ├── 20230119042746_MovedDisabledToMetadata.Designer.cs │ │ ├── 20230119042746_MovedDisabledToMetadata.cs │ │ ├── 20230323102524_UpgradedToAbp_7_1.Designer.cs │ │ ├── 20230323102524_UpgradedToAbp_7_1.cs │ │ ├── 20230503132734_UpgradedToAbp_7_2.Designer.cs │ │ ├── 20230503132734_UpgradedToAbp_7_2.cs │ │ ├── 20231227142959_UpgradedToAbp_8_0.Designer.cs │ │ ├── 20231227142959_UpgradedToAbp_8_0.cs │ │ ├── 20240413135840_UpgradedToAbp_8_1.Designer.cs │ │ ├── 20240413135840_UpgradedToAbp_8_1.cs │ │ ├── 20240715035436_UpgradedToAbp_8_2.Designer.cs │ │ ├── 20240715035436_UpgradedToAbp_8_2.cs │ │ ├── 20241229125833_UpgradedToAbp_9_0.Designer.cs │ │ ├── 20241229125833_UpgradedToAbp_9_0.cs │ │ ├── 20250331065216_Upgraded_To_Abp_9_1.Designer.cs │ │ ├── 20250331065216_Upgraded_To_Abp_9_1.cs │ │ └── UnifiedDbContextModelSnapshot.cs │ ├── Pages │ │ ├── Index.razor │ │ ├── Index.razor.cs │ │ ├── Index.razor.css │ │ ├── _Host.cshtml │ │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── _Imports.razor │ ├── abp.resourcemapping.js │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── appsettings.secrets.json │ ├── package.json │ ├── wwwroot │ │ ├── blazor-global-styles.css │ │ ├── favicon.ico │ │ └── global-styles.css │ └── yarn.lock ├── EasyAbp.DynamicForm.Host.Shared │ ├── EasyAbp.DynamicForm.Host.Shared.abppkg.json │ ├── EasyAbp.DynamicForm.Host.Shared.csproj │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ └── MultiTenancy │ │ └── MultiTenancyConsts.cs ├── EasyAbp.DynamicForm.HttpApi.Host │ ├── Controllers │ │ └── HomeController.cs │ ├── Dockerfile │ ├── DynamicFormDataSeedContributor.cs │ ├── DynamicFormHttpApiHostModule.cs │ ├── EasyAbp.DynamicForm.HttpApi.Host.abppkg.json │ ├── EasyAbp.DynamicForm.HttpApi.Host.csproj │ ├── EntityFrameworkCore │ │ ├── DynamicFormHttpApiHostMigrationsDbContext.cs │ │ └── DynamicFormHttpApiHostMigrationsDbContextFactory.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── InternalFormFormOperationAuthorizationHandler.cs │ ├── InternalFormFormTemplateOperationAuthorizationHandler.cs │ ├── Migrations │ │ ├── 20221109160229_AddedEntities.Designer.cs │ │ ├── 20221109160229_AddedEntities.cs │ │ ├── 20221109191118_AddedFormItemDisplayOrder.Designer.cs │ │ ├── 20221109191118_AddedFormItemDisplayOrder.cs │ │ ├── 20221206060550_AddedGroupProperties.Designer.cs │ │ ├── 20221206060550_AddedGroupProperties.cs │ │ ├── 20221206063325_AddedFormItemInfoTextProperty.Designer.cs │ │ ├── 20221206063325_AddedFormItemInfoTextProperty.cs │ │ ├── 20230116092440_AddedFormItemTemplateDisabled.Designer.cs │ │ ├── 20230116092440_AddedFormItemTemplateDisabled.cs │ │ ├── 20230119042746_MovedDisabledToMetadata.Designer.cs │ │ ├── 20230119042746_MovedDisabledToMetadata.cs │ │ ├── 20240715035359_UpgradedToAbp_8_2.Designer.cs │ │ ├── 20240715035359_UpgradedToAbp_8_2.cs │ │ └── DynamicFormHttpApiHostMigrationsDbContextModelSnapshot.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── appsettings.json │ └── appsettings.secrets.json ├── EasyAbp.DynamicForm.Web.Host │ ├── Controllers │ │ └── AccountController.cs │ ├── DynamicFormBrandingProvider.cs │ ├── DynamicFormWebAutoMapperProfile.cs │ ├── DynamicFormWebHostMenuContributor.cs │ ├── DynamicFormWebHostModule.cs │ ├── EasyAbp.DynamicForm.Web.Host.abppkg.json │ ├── EasyAbp.DynamicForm.Web.Host.csproj │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── Pages │ │ ├── DynamicFormPageModel.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Views │ │ └── _ViewImports.cshtml │ ├── abp.resourcemapping.js │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── appsettings.secrets.json │ ├── package.json │ └── yarn.lock └── EasyAbp.DynamicForm.Web.Unified │ ├── DynamicFormDataSeedContributor.cs │ ├── DynamicFormWebUnifiedModule.cs │ ├── EasyAbp.DynamicForm.Web.Unified.abppkg.json │ ├── EasyAbp.DynamicForm.Web.Unified.csproj │ ├── EntityFrameworkCore │ ├── UnifiedDbContext.cs │ └── UnifiedDbContextFactory.cs │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── InternalFormFormOperationAuthorizationHandler.cs │ ├── InternalFormFormTemplateOperationAuthorizationHandler.cs │ ├── Migrations │ ├── 20220617083659_Initial.Designer.cs │ ├── 20220617083659_Initial.cs │ ├── 20221109154250_AddedEntities.Designer.cs │ ├── 20221109154250_AddedEntities.cs │ ├── 20221109191041_AddedFormItemDisplayOrder.Designer.cs │ ├── 20221109191041_AddedFormItemDisplayOrder.cs │ ├── 20221206060618_AddedGroupProperties.Designer.cs │ ├── 20221206060618_AddedGroupProperties.cs │ ├── 20221206062933_AddedFormItemInfoTextProperty.Designer.cs │ ├── 20221206062933_AddedFormItemInfoTextProperty.cs │ ├── 20230114065337_UpgradedToAbp7.Designer.cs │ ├── 20230114065337_UpgradedToAbp7.cs │ ├── 20230116092400_AddedFormItemTemplateDisabled.Designer.cs │ ├── 20230116092400_AddedFormItemTemplateDisabled.cs │ ├── 20230119042704_MovedDisabledToMetadata.Designer.cs │ ├── 20230119042704_MovedDisabledToMetadata.cs │ ├── 20230323102528_UpgradedToAbp_7_1.Designer.cs │ ├── 20230323102528_UpgradedToAbp_7_1.cs │ ├── 20230503132726_UpgradedToAbp_7_2.Designer.cs │ ├── 20230503132726_UpgradedToAbp_7_2.cs │ ├── 20231227142950_UpgradedToAbp_8_0.Designer.cs │ ├── 20231227142950_UpgradedToAbp_8_0.cs │ ├── 20240413135929_UpgradedToAbp_8_1.Designer.cs │ ├── 20240413135929_UpgradedToAbp_8_1.cs │ ├── 20240715035331_UpgradedToAbp_8_2.Designer.cs │ ├── 20240715035331_UpgradedToAbp_8_2.cs │ ├── 20241229125842_UpgradedToAbp_9_0.Designer.cs │ ├── 20241229125842_UpgradedToAbp_9_0.cs │ ├── 20250331065228_Upgraded_To_Abp_9_1.Designer.cs │ ├── 20250331065228_Upgraded_To_Abp_9_1.cs │ └── UnifiedDbContextModelSnapshot.cs │ ├── Pages │ ├── Index.cshtml │ ├── Index.cshtml.cs │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── abp.resourcemapping.js │ ├── appsettings.json │ ├── appsettings.secrets.json │ ├── package.json │ └── yarn.lock ├── src ├── EasyAbp.DynamicForm.Application.Contracts │ ├── EasyAbp.DynamicForm.Application.Contracts.abppkg │ ├── EasyAbp.DynamicForm.Application.Contracts.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormApplicationContractsModule.cs │ │ │ ├── DynamicFormRemoteServiceConsts.cs │ │ │ ├── FormTemplates │ │ │ ├── Dtos │ │ │ │ ├── CreateFormItemTemplateDto.cs │ │ │ │ ├── CreateFormTemplateDto.cs │ │ │ │ ├── DynamicFormBaseInfoDto.cs │ │ │ │ ├── FormDefinitionDto.cs │ │ │ │ ├── FormItemTemplateDto.cs │ │ │ │ ├── FormItemTypeDefinitionDto.cs │ │ │ │ ├── FormTemplateDto.cs │ │ │ │ ├── FormTemplateGetListInput.cs │ │ │ │ ├── UpdateFormItemTemplateDto.cs │ │ │ │ └── UpdateFormTemplateDto.cs │ │ │ └── IFormTemplateAppService.cs │ │ │ ├── Forms │ │ │ ├── Dtos │ │ │ │ ├── CreateFormDto.cs │ │ │ │ ├── CreateFormItemDto.cs │ │ │ │ ├── FormDto.cs │ │ │ │ ├── FormGetListInput.cs │ │ │ │ ├── FormItemDto.cs │ │ │ │ ├── UpdateFormDto.cs │ │ │ │ └── UpdateFormItemDto.cs │ │ │ └── IFormAppService.cs │ │ │ └── Permissions │ │ │ ├── DynamicFormPermissionDefinitionProvider.cs │ │ │ └── DynamicFormPermissions.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Application │ ├── EasyAbp.DynamicForm.Application.abppkg │ ├── EasyAbp.DynamicForm.Application.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormAppService.cs │ │ │ ├── DynamicFormApplicationAutoMapperProfile.cs │ │ │ ├── DynamicFormApplicationModule.cs │ │ │ ├── FormTemplates │ │ │ ├── FormTemplateAppService.cs │ │ │ ├── FormTemplateOperationAuthorizationHandler.cs │ │ │ └── FormTemplateOperationInfoModel.cs │ │ │ └── Forms │ │ │ ├── FormAppService.cs │ │ │ ├── FormOperationAuthorizationHandler.cs │ │ │ └── FormOperationInfoModel.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Blazor.Server │ ├── DynamicFormBlazorServerModule.cs │ ├── EasyAbp.DynamicForm.Blazor.Server.abppkg.json │ ├── EasyAbp.DynamicForm.Blazor.Server.csproj │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Blazor.WebAssembly │ ├── DynamicFormBlazorWebAssemblyModule.cs │ ├── EasyAbp.DynamicForm.Blazor.WebAssembly.abppkg.json │ ├── EasyAbp.DynamicForm.Blazor.WebAssembly.csproj │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Blazor │ ├── DynamicFormBlazorAutoMapperProfile.cs │ ├── DynamicFormBlazorModule.cs │ ├── EasyAbp.DynamicForm.Blazor.abppkg.json │ ├── EasyAbp.DynamicForm.Blazor.csproj │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── Menus │ │ ├── DynamicFormMenuContributor.cs │ │ └── DynamicFormMenus.cs │ ├── Pages │ │ └── DynamicForm │ │ │ └── Index.razor │ └── _Imports.razor ├── EasyAbp.DynamicForm.Domain.Core │ ├── EasyAbp.DynamicForm.Domain.Core.abppkg.json │ ├── EasyAbp.DynamicForm.Domain.Core.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormCoreErrorCodes.cs │ │ │ ├── DynamicFormDomainCoreModule.cs │ │ │ ├── DynamicFormValidator.cs │ │ │ ├── FormItemTypes │ │ │ ├── ColorPicker │ │ │ │ ├── ColorPickerFormItemConfigurations.cs │ │ │ │ └── ColorPickerFormItemProvider.cs │ │ │ ├── FileBox │ │ │ │ ├── FileBoxFormItemConfigurations.cs │ │ │ │ ├── FileBoxFormItemProvider.cs │ │ │ │ ├── IFileBoxValueValidator.cs │ │ │ │ └── UrlsFileBoxValueValidator.cs │ │ │ ├── FormItemProviderBase.cs │ │ │ ├── FormItemProviderResolver.cs │ │ │ ├── IFormItemProvider.cs │ │ │ ├── IFormItemProviderResolver.cs │ │ │ ├── NumberBox │ │ │ │ ├── NumberBoxFormItemConfigurations.cs │ │ │ │ ├── NumberBoxFormItemProvider.cs │ │ │ │ └── NumberUi.cs │ │ │ ├── OptionButtons │ │ │ │ ├── OptionButtonsFormItemConfigurations.cs │ │ │ │ └── OptionButtonsFormItemProvider.cs │ │ │ ├── TextBox │ │ │ │ ├── TextBoxFormItemConfigurations.cs │ │ │ │ ├── TextBoxFormItemProvider.cs │ │ │ │ └── TextFormat.cs │ │ │ ├── TimePicker │ │ │ │ ├── TimeDimension.cs │ │ │ │ ├── TimePickerFormItemConfigurations.cs │ │ │ │ ├── TimePickerFormItemProvider.cs │ │ │ │ └── TimePrecision.cs │ │ │ └── Toggle │ │ │ │ ├── ToggleFormItemConfigurations.cs │ │ │ │ └── ToggleFormItemProvider.cs │ │ │ ├── IDynamicFormValidator.cs │ │ │ └── Options │ │ │ ├── DynamicFormCoreOptions.cs │ │ │ ├── DynamicFormCoreOptionsExtensions.cs │ │ │ └── FormItemTypeDefinition.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Domain.Shared │ ├── EasyAbp.DynamicForm.Domain.Shared.abppkg │ ├── EasyAbp.DynamicForm.Domain.Shared.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormDomainSharedModule.cs │ │ │ ├── DynamicFormErrorCodes.cs │ │ │ ├── Forms │ │ │ ├── CreateUpdateFormItemModel.cs │ │ │ └── IFormItem.cs │ │ │ ├── Localization │ │ │ ├── DynamicFormResource.cs │ │ │ ├── en.json │ │ │ ├── zh-Hans.json │ │ │ └── zh-Hant.json │ │ │ └── Shared │ │ │ ├── AvailableValues.cs │ │ │ ├── IFormItemMetadata.cs │ │ │ └── IHasAvailableValues.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Domain │ ├── EasyAbp.DynamicForm.Domain.abppkg │ ├── EasyAbp.DynamicForm.Domain.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormDbProperties.cs │ │ │ ├── DynamicFormDomainModule.cs │ │ │ ├── DynamicFormErrorCodes.cs │ │ │ ├── FormTemplates │ │ │ ├── FormItemTemplate.cs │ │ │ ├── FormTemplate.cs │ │ │ ├── FormTemplateManager.cs │ │ │ ├── ICustomFormItemValidator.cs │ │ │ └── IFormTemplateRepository.cs │ │ │ ├── Forms │ │ │ ├── Form.cs │ │ │ ├── FormItem.cs │ │ │ ├── FormManager.cs │ │ │ └── IFormRepository.cs │ │ │ ├── Options │ │ │ ├── DynamicFormOptions.cs │ │ │ └── FormDefinition.cs │ │ │ └── Settings │ │ │ ├── DynamicFormSettingDefinitionProvider.cs │ │ │ └── DynamicFormSettings.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.EntityFrameworkCore.Shared │ ├── EasyAbp.DynamicForm.EntityFrameworkCore.Shared.abppkg.json │ ├── EasyAbp.DynamicForm.EntityFrameworkCore.Shared.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ └── EntityFrameworkCore │ │ │ ├── AvailableValuesValueComparer.cs │ │ │ ├── AvailableValuesValueConverter.cs │ │ │ ├── DynamicFormEntityFrameworkCoreSharedModule.cs │ │ │ └── DynamicFormEntityTypeBuilderExtensions.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.EntityFrameworkCore │ ├── EasyAbp.DynamicForm.EntityFrameworkCore.abppkg │ ├── EasyAbp.DynamicForm.EntityFrameworkCore.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── EntityFrameworkCore │ │ │ ├── DynamicFormDbContext.cs │ │ │ ├── DynamicFormDbContextModelCreatingExtensions.cs │ │ │ ├── DynamicFormEntityFrameworkCoreModule.cs │ │ │ └── IDynamicFormDbContext.cs │ │ │ ├── FormTemplates │ │ │ ├── FormTemplateEfCoreQuerableExtensions.cs │ │ │ └── FormTemplateRepository.cs │ │ │ └── Forms │ │ │ ├── FormEfCoreQuerableExtensions.cs │ │ │ └── FormRepository.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.HttpApi.Client │ ├── EasyAbp.DynamicForm.HttpApi.Client.abppkg │ ├── EasyAbp.DynamicForm.HttpApi.Client.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ └── DynamicFormHttpApiClientModule.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.HttpApi │ ├── EasyAbp.DynamicForm.HttpApi.abppkg │ ├── EasyAbp.DynamicForm.HttpApi.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ ├── DynamicFormController.cs │ │ │ ├── DynamicFormHttpApiModule.cs │ │ │ ├── FormTemplates │ │ │ └── FormTemplateController.cs │ │ │ └── Forms │ │ │ └── FormController.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.Installer │ ├── EasyAbp.DynamicForm.Installer.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ └── DynamicFormInstallerModule.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.MongoDB │ ├── EasyAbp.DynamicForm.MongoDB.abppkg.json │ ├── EasyAbp.DynamicForm.MongoDB.csproj │ ├── EasyAbp │ │ └── DynamicForm │ │ │ └── MongoDB │ │ │ ├── DynamicFormMongoDbContext.cs │ │ │ ├── DynamicFormMongoDbContextExtensions.cs │ │ │ ├── DynamicFormMongoDbModule.cs │ │ │ └── IDynamicFormMongoDbContext.cs │ ├── FodyWeavers.xml │ └── FodyWeavers.xsd └── EasyAbp.DynamicForm.Web │ ├── DynamicFormWebAutoMapperProfile.cs │ ├── DynamicFormWebModule.cs │ ├── EasyAbp.DynamicForm.Web.abppkg │ ├── EasyAbp.DynamicForm.Web.csproj │ ├── FodyWeavers.xml │ ├── FodyWeavers.xsd │ ├── Menus │ ├── DynamicFormMenuContributor.cs │ └── DynamicFormMenus.cs │ └── Pages │ ├── DynamicForm │ ├── FormTemplates │ │ ├── FormItemTemplate │ │ │ ├── CreateModal.cshtml │ │ │ ├── CreateModal.cshtml.cs │ │ │ ├── EditModal.cshtml │ │ │ ├── EditModal.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ ├── Index.cshtml.cs │ │ │ ├── ViewModels │ │ │ │ ├── CreateFormItemTemplateViewModel.cs │ │ │ │ └── EditFormItemTemplateViewModel.cs │ │ │ ├── index.css │ │ │ └── index.js │ │ └── FormTemplate │ │ │ ├── CreateModal.cshtml │ │ │ ├── CreateModal.cshtml.cs │ │ │ ├── EditModal.cshtml │ │ │ ├── EditModal.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ ├── Index.cshtml.cs │ │ │ ├── ViewModels │ │ │ ├── CreateFormTemplateViewModel.cs │ │ │ └── EditFormTemplateViewModel.cs │ │ │ ├── index.css │ │ │ └── index.js │ ├── Forms │ │ └── Form │ │ │ ├── CreateModal.cshtml │ │ │ ├── CreateModal.cshtml.cs │ │ │ ├── EditModal.cshtml │ │ │ ├── EditModal.cshtml.cs │ │ │ ├── Index.cshtml │ │ │ ├── Index.cshtml.cs │ │ │ ├── ViewModels │ │ │ ├── CreateEditFormItemViewModel.cs │ │ │ ├── CreateFormViewModel.cs │ │ │ └── EditFormViewModel.cs │ │ │ ├── index.css │ │ │ └── index.js │ ├── Index.cshtml │ └── Index.cshtml.cs │ ├── DynamicFormPageModel.cs │ └── _ViewImports.cshtml └── test ├── EasyAbp.DynamicForm.Application.Tests ├── DynamicFormApplicationTestBase.cs ├── DynamicFormApplicationTestModule.cs ├── EasyAbp.DynamicForm.Application.Tests.abppkg ├── EasyAbp.DynamicForm.Application.Tests.csproj ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── FormTemplates │ └── FormTemplateAppServiceTests.cs └── Forms │ └── FormAppServiceTests.cs ├── EasyAbp.DynamicForm.Domain.Tests ├── DynamicFormCore │ ├── FormItemTemplateTests.cs │ └── FormItemTests.cs ├── DynamicFormDomainTestBase.cs ├── DynamicFormDomainTestModule.cs ├── EasyAbp.DynamicForm.Domain.Tests.abppkg ├── EasyAbp.DynamicForm.Domain.Tests.csproj ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── FormTemplates │ └── FormTemplateDomainTests.cs └── Forms │ └── FormDomainTests.cs ├── EasyAbp.DynamicForm.EntityFrameworkCore.Tests ├── EasyAbp.DynamicForm.EntityFrameworkCore.Tests.abppkg ├── EasyAbp.DynamicForm.EntityFrameworkCore.Tests.csproj ├── EntityFrameworkCore │ ├── DynamicFormEntityFrameworkCoreTestBase.cs │ ├── DynamicFormEntityFrameworkCoreTestModule.cs │ ├── FormTemplates │ │ └── FormTemplateRepositoryTests.cs │ └── Forms │ │ └── FormRepositoryTests.cs ├── FodyWeavers.xml └── FodyWeavers.xsd ├── EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp ├── ClientDemoService.cs ├── ConsoleTestAppHostedService.cs ├── DynamicFormConsoleApiClientModule.cs ├── EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp.abppkg ├── EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp.csproj ├── Program.cs ├── appsettings.json └── appsettings.secrets.json ├── EasyAbp.DynamicForm.MongoDB.Tests ├── EasyAbp.DynamicForm.MongoDB.Tests.abppkg ├── EasyAbp.DynamicForm.MongoDB.Tests.csproj ├── FodyWeavers.xml ├── FodyWeavers.xsd └── MongoDB │ ├── DynamicFormMongoDbTestBase.cs │ ├── DynamicFormMongoDbTestModule.cs │ ├── MongoDbFixture.cs │ └── MongoTestCollection.cs └── EasyAbp.DynamicForm.TestBase ├── BookRentalRequests ├── BookRentalRequest.cs └── BookRentalRequestFormItem.cs ├── BookRentals ├── BookRental.cs └── BookRentalFormItem.cs ├── DynamicFormDataSeedContributor.cs ├── DynamicFormTestBase.cs ├── DynamicFormTestBaseModule.cs ├── DynamicFormTestConsts.cs ├── EasyAbp.DynamicForm.TestBase.abppkg ├── EasyAbp.DynamicForm.TestBase.csproj ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── FormItemTestHelper.cs └── Security └── FakeCurrentPrincipalAccessor.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | **/wwwroot/libs/** linguist-vendored 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "useTabs": false, 4 | "tabWidth": 4 5 | } 6 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9.1.1 4 | 5 | -------------------------------------------------------------------------------- /EasyAbp.DynamicForm.abpsln.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "EasyAbp.DynamicForm": { 4 | "path": "EasyAbp.DynamicForm.abpmdl.json" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 EasyAbp Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /database/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build 2 | COPY . . 3 | 4 | WORKDIR /templates/service/host/IdentityServerHost 5 | RUN dotnet restore 6 | RUN dotnet ef migrations script -i -o migrations-IdentityServerHost.sql 7 | 8 | WORKDIR /templates/service/host/EasyAbp.DynamicForm.Host 9 | RUN dotnet restore 10 | RUN dotnet ef migrations script -i -o migrations-DynamicForm.sql 11 | 12 | FROM mcr.microsoft.com/mssql-tools AS final 13 | WORKDIR /src 14 | COPY --from=build /templates/service/host/IdentityServerHost/migrations-IdentityServerHost.sql migrations-IdentityServerHost.sql 15 | COPY --from=build /templates/service/host/EasyAbp.DynamicForm.Host/migrations-DynamicForm.sql migrations-DynamicForm.sql 16 | COPY --from=build /templates/service/database/entrypoint.sh . 17 | RUN /bin/bash -c "sed -i $'s/\r$//' entrypoint.sh" 18 | RUN chmod +x ./entrypoint.sh 19 | 20 | ENTRYPOINT ["./entrypoint.sh"] -------------------------------------------------------------------------------- /database/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | until /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q 'SELECT name FROM master.sys.databases'; do 4 | >&2 echo "SQL Server is starting up" 5 | sleep 1 6 | done 7 | 8 | /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$IdentityServer_DB]" 9 | /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$DynamicForm_DB]" 10 | 11 | /opt/mssql-tools/bin/sqlcmd -d $IdentityServer_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-IdentityServerHost.sql 12 | /opt/mssql-tools/bin/sqlcmd -d $DynamicForm_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-DynamicForm.sql -------------------------------------------------------------------------------- /docker-compose.migrations.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | 3 | services: 4 | migrations: 5 | build: 6 | context: ../../ 7 | dockerfile: templates/service/database/Dockerfile 8 | depends_on: 9 | - sqlserver 10 | environment: 11 | - IdentityServer_DB=DynamicForm_Identity 12 | - DynamicForm_DB=DynamicForm_ModuleDb 13 | - SA_PASSWORD=yourStrong(!)Password 14 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | 3 | services: 4 | sqlserver: 5 | image: mcr.microsoft.com/mssql/server 6 | volumes: 7 | - dbdata:/var/opt/mssql 8 | 9 | identity-server: 10 | build: 11 | context: ../../ 12 | dockerfile: templates/service/host/IdentityServerHost/Dockerfile 13 | depends_on: 14 | - sqlserver 15 | 16 | dynamic-form: 17 | build: 18 | context: ../../ 19 | dockerfile: templates/service/host/EasyAbp.DynamicForm.Host/Dockerfile 20 | depends_on: 21 | - sqlserver 22 | - identity-server 23 | 24 | volumes: 25 | dbdata: -------------------------------------------------------------------------------- /docs/images/CreateFormItemTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/docs/images/CreateFormItemTemplate.png -------------------------------------------------------------------------------- /docs/images/FormItemTemplates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/docs/images/FormItemTemplates.png -------------------------------------------------------------------------------- /docs/images/FormTemplates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/docs/images/FormTemplates.png -------------------------------------------------------------------------------- /docs/images/Forms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/docs/images/Forms.png -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base 2 | WORKDIR /app 3 | EXPOSE 80 4 | 5 | FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build 6 | WORKDIR /src 7 | COPY . . 8 | WORKDIR /src/templates/service/host/EasyAbp.DynamicForm.AuthServer 9 | RUN dotnet restore -nowarn:msb3202,nu1503 10 | RUN dotnet build --no-restore -c Release -o /app 11 | 12 | FROM build AS publish 13 | RUN dotnet publish --no-restore -c Release -o /app 14 | 15 | FROM base AS final 16 | WORKDIR /app 17 | COPY --from=publish /app . 18 | ENTRYPOINT ["dotnet", "EasyAbp.DynamicForm.AuthServer.dll"] 19 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/EasyAbp.DynamicForm.AuthServer.abppkg.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/EntityFrameworkCore/AuthServerDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Volo.Abp.AuditLogging.EntityFrameworkCore; 3 | using Volo.Abp.EntityFrameworkCore; 4 | using Volo.Abp.FeatureManagement.EntityFrameworkCore; 5 | using Volo.Abp.Identity.EntityFrameworkCore; 6 | using Volo.Abp.OpenIddict.EntityFrameworkCore; 7 | using Volo.Abp.PermissionManagement.EntityFrameworkCore; 8 | using Volo.Abp.SettingManagement.EntityFrameworkCore; 9 | using Volo.Abp.TenantManagement.EntityFrameworkCore; 10 | 11 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 12 | 13 | public class AuthServerDbContext : AbpDbContext 14 | { 15 | public AuthServerDbContext(DbContextOptions options) 16 | : base(options) 17 | { 18 | 19 | } 20 | 21 | protected override void OnModelCreating(ModelBuilder modelBuilder) 22 | { 23 | base.OnModelCreating(modelBuilder); 24 | 25 | modelBuilder.ConfigurePermissionManagement(); 26 | modelBuilder.ConfigureSettingManagement(); 27 | modelBuilder.ConfigureAuditLogging(); 28 | modelBuilder.ConfigureIdentity(); 29 | modelBuilder.ConfigureOpenIddict(); 30 | modelBuilder.ConfigureFeatureManagement(); 31 | modelBuilder.ConfigureTenantManagement(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/EntityFrameworkCore/AuthServerDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Design; 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public class AuthServerDbContextFactory : IDesignTimeDbContextFactory 9 | { 10 | public AuthServerDbContext CreateDbContext(string[] args) 11 | { 12 | var configuration = BuildConfiguration(); 13 | 14 | var builder = new DbContextOptionsBuilder() 15 | .UseSqlServer(configuration.GetConnectionString("Default")); 16 | 17 | return new AuthServerDbContext(builder.Options); 18 | } 19 | 20 | private static IConfigurationRoot BuildConfiguration() 21 | { 22 | var builder = new ConfigurationBuilder() 23 | .SetBasePath(Directory.GetCurrentDirectory()) 24 | .AddJsonFile("appsettings.json", optional: false); 25 | 26 | return builder.Build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Migrations/20250331070515_Upgraded_To_Abp_9_1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace EasyAbp.DynamicForm.Migrations 7 | { 8 | /// 9 | public partial class Upgraded_To_Abp_9_1 : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.AddColumn( 15 | name: "CreationTime", 16 | table: "AbpRoles", 17 | type: "datetime2", 18 | nullable: false, 19 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); 20 | 21 | migrationBuilder.AddColumn( 22 | name: "CreationTime", 23 | table: "AbpClaimTypes", 24 | type: "datetime2", 25 | nullable: false, 26 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); 27 | } 28 | 29 | /// 30 | protected override void Down(MigrationBuilder migrationBuilder) 31 | { 32 | migrationBuilder.DropColumn( 33 | name: "CreationTime", 34 | table: "AbpRoles"); 35 | 36 | migrationBuilder.DropColumn( 37 | name: "CreationTime", 38 | table: "AbpClaimTypes"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using EasyAbp.DynamicForm.Pages 3 | @using Volo.Abp.Users 4 | @model IndexModel 5 | @inject ICurrentUser CurrentUser 6 | @if (CurrentUser.IsAuthenticated) 7 | { 8 |
9 | 10 | 11 | 12 | Logout 13 | 14 | 15 |

@CurrentUser.UserName

16 |
@CurrentUser.Email
17 |
18 | Roles: @CurrentUser.Roles.JoinAsString(", ") 19 |
20 | Claims:
21 | @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString("
")) 22 |
23 |
24 |
25 |
26 | } 27 | 28 | @if (!CurrentUser.IsAuthenticated) 29 | { 30 |
31 |

32 | Login 33 |
34 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; 2 | 3 | namespace EasyAbp.DynamicForm.Pages; 4 | 5 | public class IndexModel : AbpPageModel 6 | { 7 | public void OnGet() 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44313", 7 | "sslPort": 44313 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "AuthServerHost": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:44313", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/abp.resourcemapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | aliases: { 3 | 4 | }, 5 | clean: [ 6 | 7 | ], 8 | mappings: { 9 | 10 | } 11 | }; -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "SelfUrl": "https://localhost:44313/", 4 | "CorsOrigins": "https://*.DynamicForm.com,http://localhost:4200,http://localhost:44307,https://localhost:44307,https://localhost:44341" 5 | }, 6 | "AppSelfUrl": "https://localhost:44313/", 7 | "ConnectionStrings": { 8 | "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=DynamicForm_Main;Trusted_Connection=True" 9 | }, 10 | "Redis": { 11 | "Configuration": "127.0.0.1" 12 | }, 13 | "OpenIddict": { 14 | "Applications": { 15 | "DynamicForm_Web": { 16 | "ClientId": "DynamicForm_Web", 17 | "ClientSecret": "1q2w3e*", 18 | "RootUrl": "https://localhost:44314" 19 | }, 20 | "DynamicForm_Blazor": { 21 | "ClientId": "DynamicForm_Blazor", 22 | "RootUrl": "https://localhost:44307" 23 | }, 24 | "DynamicForm_App": { 25 | "ClientId": "DynamicForm_App", 26 | "RootUrl": "http://localhost:4200" 27 | }, 28 | "DynamicForm_Swagger": { 29 | "ClientId": "DynamicForm_Swagger", 30 | "RootUrl": "https://localhost:44341" 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.AuthServer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "my-app-authserver", 4 | "private": true, 5 | "dependencies": { 6 | "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.1.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/DynamicFormBlazorHostAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace EasyAbp.DynamicForm.Blazor.Host; 4 | 5 | public class DynamicFormBlazorHostAutoMapperProfile : Profile 6 | { 7 | public DynamicFormBlazorHostAutoMapperProfile() 8 | { 9 | //Define your AutoMapper configuration here for the Blazor project. 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/DynamicFormBlazorHostBundleContributor.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Bundling; 2 | 3 | namespace EasyAbp.DynamicForm.Blazor.Host; 4 | 5 | public class DynamicFormBlazorHostBundleContributor : IBundleContributor 6 | { 7 | public void AddScripts(BundleContext context) 8 | { 9 | 10 | } 11 | 12 | public void AddStyles(BundleContext context) 13 | { 14 | context.Add("main.css", true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/DynamicFormHostBrandingProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Ui.Branding; 2 | 3 | namespace EasyAbp.DynamicForm.Blazor.Host; 4 | 5 | public class DynamicFormHostBrandingProvider : DefaultBrandingProvider 6 | { 7 | public override string AppName => "DynamicForm"; 8 | } 9 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/EasyAbp.DynamicForm.Blazor.Host.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "host.blazor-wasm" 3 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 3 | 4 | namespace EasyAbp.DynamicForm.Blazor.Host; 5 | 6 | public class Program 7 | { 8 | public async static Task Main(string[] args) 9 | { 10 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 11 | 12 | var application = await builder.AddApplicationAsync(options => 13 | { 14 | options.UseAutofac(); 15 | }); 16 | 17 | var host = builder.Build(); 18 | 19 | await application.InitializeApplicationAsync(host.Services); 20 | 21 | await host.RunAsync(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44329", 7 | "sslPort": 44329 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "EasyAbp.DynamicForm.Blazor": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "applicationUrl": "https://localhost:44329", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Authorization 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 7 | @using Microsoft.JSInterop 8 | @using Volo.Abp.AspNetCore.Components.WebAssembly 9 | @using EasyAbp.DynamicForm.Blazor 10 | @using Blazorise 11 | @using Blazorise.DataGrid 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "SelfUrl": "https://localhost:44329" 4 | }, 5 | "AuthServer": { 6 | "Authority": "https://localhost:44313", 7 | "ClientId": "DynamicForm_Blazor", 8 | "ResponseType": "code" 9 | }, 10 | "RemoteServices": { 11 | "Default": { 12 | "BaseUrl": "https://localhost:44313/" 13 | }, 14 | "DynamicForm": { 15 | "BaseUrl": "https://localhost:44341/" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/favicon.ico -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | EasyAbp.DynamicForm.Blazor 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Host/wwwroot/main.css: -------------------------------------------------------------------------------- 1 | .spinner { 2 | width: 40px; 3 | height: 40px; 4 | display: block; 5 | position: fixed; 6 | top: calc( 50% - ( 40px / 2) ); 7 | right: calc( 50% - ( 40px / 2) ); 8 | } 9 | 10 | .double-bounce1, .double-bounce2 { 11 | width: 100%; 12 | height: 100%; 13 | border-radius: 50%; 14 | background-color: #333; 15 | opacity: 0.6; 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | -webkit-animation: sk-bounce 2.0s infinite ease-in-out; 20 | animation: sk-bounce 2.0s infinite ease-in-out; 21 | } 22 | 23 | .double-bounce2 { 24 | -webkit-animation-delay: -1.0s; 25 | animation-delay: -1.0s; 26 | } 27 | 28 | @-webkit-keyframes sk-bounce { 29 | 0%, 100% { 30 | -webkit-transform: scale(0.0) 31 | } 32 | 33 | 50% { 34 | -webkit-transform: scale(1.0) 35 | } 36 | } 37 | 38 | @keyframes sk-bounce { 39 | 0%, 100% { 40 | transform: scale(0.0); 41 | -webkit-transform: scale(0.0); 42 | } 43 | 44 | 50% { 45 | transform: scale(1.0); 46 | -webkit-transform: scale(1.0); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/DynamicFormBrandingProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.DependencyInjection; 2 | using Volo.Abp.Ui.Branding; 3 | 4 | namespace EasyAbp.DynamicForm.Blazor.Server.Host; 5 | 6 | [Dependency(ReplaceServices = true)] 7 | public class DynamicFormBrandingProvider : DefaultBrandingProvider 8 | { 9 | public override string AppName => "DynamicForm"; 10 | } 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/DynamicFormComponentBase.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Localization; 2 | using Volo.Abp.AspNetCore.Components; 3 | 4 | namespace EasyAbp.DynamicForm.Blazor.Server.Host; 5 | 6 | public abstract class DynamicFormComponentBase : AbpComponentBase 7 | { 8 | protected DynamicFormComponentBase() 9 | { 10 | LocalizationResource = typeof(DynamicFormResource); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/EasyAbp.DynamicForm.Blazor.Server.Host.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "host.blazor-server" 3 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using EasyAbp.DynamicForm.EntityFrameworkCore; 3 | using Volo.Abp.AuditLogging.EntityFrameworkCore; 4 | using Volo.Abp.EntityFrameworkCore; 5 | using Volo.Abp.FeatureManagement.EntityFrameworkCore; 6 | using Volo.Abp.Identity.EntityFrameworkCore; 7 | using Volo.Abp.PermissionManagement.EntityFrameworkCore; 8 | using Volo.Abp.SettingManagement.EntityFrameworkCore; 9 | using Volo.Abp.TenantManagement.EntityFrameworkCore; 10 | 11 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.EntityFrameworkCore; 12 | 13 | public class UnifiedDbContext : AbpDbContext 14 | { 15 | public UnifiedDbContext(DbContextOptions options) 16 | : base(options) 17 | { 18 | 19 | } 20 | 21 | protected override void OnModelCreating(ModelBuilder modelBuilder) 22 | { 23 | base.OnModelCreating(modelBuilder); 24 | 25 | modelBuilder.ConfigurePermissionManagement(); 26 | modelBuilder.ConfigureSettingManagement(); 27 | modelBuilder.ConfigureAuditLogging(); 28 | modelBuilder.ConfigureIdentity(); 29 | modelBuilder.ConfigureFeatureManagement(); 30 | modelBuilder.ConfigureTenantManagement(); 31 | modelBuilder.ConfigureDynamicForm(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/EntityFrameworkCore/UnifiedDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Design; 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.EntityFrameworkCore; 7 | 8 | public class UnifiedDbContextFactory : IDesignTimeDbContextFactory 9 | { 10 | public UnifiedDbContext CreateDbContext(string[] args) 11 | { 12 | var configuration = BuildConfiguration(); 13 | 14 | var builder = new DbContextOptionsBuilder() 15 | .UseSqlServer(configuration.GetConnectionString("Default")); 16 | 17 | return new UnifiedDbContext(builder.Options); 18 | } 19 | 20 | private static IConfigurationRoot BuildConfiguration() 21 | { 22 | var builder = new ConfigurationBuilder() 23 | .SetBasePath(Directory.GetCurrentDirectory()) 24 | .AddJsonFile("appsettings.json", optional: false); 25 | 26 | return builder.Build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Menus/DynamicFormMenuContributor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.MultiTenancy; 3 | using Volo.Abp.Identity.Blazor; 4 | using Volo.Abp.SettingManagement.Blazor.Menus; 5 | using Volo.Abp.TenantManagement.Blazor.Navigation; 6 | using Volo.Abp.UI.Navigation; 7 | 8 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Menus; 9 | 10 | public class DynamicFormMenuContributor : IMenuContributor 11 | { 12 | public async Task ConfigureMenuAsync(MenuConfigurationContext context) 13 | { 14 | if (context.Menu.Name == StandardMenus.Main) 15 | { 16 | await ConfigureMainMenuAsync(context); 17 | } 18 | } 19 | 20 | private Task ConfigureMainMenuAsync(MenuConfigurationContext context) 21 | { 22 | var administration = context.Menu.GetAdministration(); 23 | 24 | if (MultiTenancyConsts.IsEnabled) 25 | { 26 | administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1); 27 | } 28 | else 29 | { 30 | administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName); 31 | } 32 | 33 | administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2); 34 | administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3); 35 | 36 | return Task.CompletedTask; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Menus/DynamicFormMenus.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Menus; 2 | 3 | public class DynamicFormMenus 4 | { 5 | private const string Prefix = "EasyAbp.DynamicForm"; 6 | 7 | //Add your menu items here... 8 | 9 | public const string Form = Prefix + ".Form"; 10 | public const string FormTemplate = Prefix + ".FormTemplate"; 11 | } 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Migrations/20221109191114_AddedFormItemDisplayOrder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Migrations 6 | { 7 | public partial class AddedFormItemDisplayOrder : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "DisplayOrder", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "int", 15 | nullable: false, 16 | defaultValue: 0); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropColumn( 22 | name: "DisplayOrder", 23 | table: "EasyAbpDynamicFormFormItems"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Migrations/20221206060434_AddedGroupProperties.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Migrations 6 | { 7 | public partial class AddedGroupProperties : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "Group", 13 | table: "EasyAbpDynamicFormFormItemTemplates", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | 17 | migrationBuilder.AddColumn( 18 | name: "Group", 19 | table: "EasyAbpDynamicFormFormItems", 20 | type: "nvarchar(max)", 21 | nullable: true); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropColumn( 27 | name: "Group", 28 | table: "EasyAbpDynamicFormFormItemTemplates"); 29 | 30 | migrationBuilder.DropColumn( 31 | name: "Group", 32 | table: "EasyAbpDynamicFormFormItems"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Migrations/20221206063336_AddedFormItemInfoTextProperty.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Migrations 6 | { 7 | public partial class AddedFormItemInfoTextProperty : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "InfoText", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.DropColumn( 21 | name: "InfoText", 22 | table: "EasyAbpDynamicFormFormItems"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Migrations/20230116092437_AddedFormItemTemplateDisabled.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Migrations 6 | { 7 | /// 8 | public partial class AddedFormItemTemplateDisabled : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItemTemplates", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItemTemplates"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Migrations/20230119042746_MovedDisabledToMetadata.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Migrations 6 | { 7 | /// 8 | public partial class MovedDisabledToMetadata : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItems", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItems"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using Volo.Abp.MultiTenancy 3 | @inherits DynamicFormComponentBase 4 | @inject ICurrentTenant CurrentTenant 5 | @inject AuthenticationStateProvider AuthenticationStateProvider 6 |
7 |
8 | 9 | @if (!CurrentUser.IsAuthenticated) 10 | { 11 | @L["Login"] 12 | } 13 | else 14 | { 15 | Claims
16 | @foreach (var claims in CurrentUser.GetAllClaims()) 17 | { 18 |

@($"{claims.Type}={claims.Value}")

19 | } 20 | } 21 |
22 |
23 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Pages/Index.razor.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Blazor.Server.Host.Pages; 2 | 3 | public partial class Index 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Pages/Index.razor.css: -------------------------------------------------------------------------------- 1 | /* Write here your styles for the Index page */ -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44324/", 7 | "sslPort": 44324 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EasyAbp.DynamicForm.Blazor.Server.Host": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:44324/", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using EasyAbp.DynamicForm.Blazor.Server 10 | @using Blazorise 11 | @using Blazorise.DataGrid 12 | @using Volo.Abp.BlazoriseUI 13 | @using Volo.Abp.BlazoriseUI.Components -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/abp.resourcemapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | aliases: { 3 | 4 | }, 5 | clean: [ 6 | 7 | ], 8 | mappings: { 9 | 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "SelfUrl": "https://localhost:44324", 4 | "RedirectAllowedUrls": "https://localhost:44324" 5 | }, 6 | "ConnectionStrings": { 7 | "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=DynamicForm_Unified;Trusted_Connection=True" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "my-app", 4 | "private": true, 5 | "dependencies": { 6 | "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.1.1", 7 | "@abp/aspnetcore.components.server.basictheme": "~9.1.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/wwwroot/blazor-global-styles.css: -------------------------------------------------------------------------------- 1 | #blazor-error-ui { 2 | background: lightyellow; 3 | bottom: 0; 4 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 5 | display: none; 6 | left: 0; 7 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 1000; 11 | } 12 | 13 | #blazor-error-ui .dismiss { 14 | cursor: pointer; 15 | position: absolute; 16 | right: 0.75rem; 17 | top: 0.5rem; 18 | } 19 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/host/EasyAbp.DynamicForm.Blazor.Server.Host/wwwroot/favicon.ico -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Blazor.Server.Host/wwwroot/global-styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | 3 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Host.Shared/EasyAbp.DynamicForm.Host.Shared.abppkg.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Host.Shared/EasyAbp.DynamicForm.Host.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | EasyAbp.DynamicForm 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Host.Shared/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Host.Shared/MultiTenancy/MultiTenancyConsts.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.MultiTenancy; 2 | 3 | public static class MultiTenancyConsts 4 | { 5 | /* Enable/disable multi-tenancy in a single point 6 | * to test your module with multi-tenancy. 7 | */ 8 | public const bool IsEnabled = false; 9 | } 10 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Volo.Abp.AspNetCore.Mvc; 3 | 4 | namespace EasyAbp.DynamicForm.Controllers; 5 | 6 | public class HomeController : AbpController 7 | { 8 | public ActionResult Index() 9 | { 10 | return Redirect("~/swagger"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base 2 | WORKDIR /app 3 | EXPOSE 80 4 | 5 | FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build 6 | WORKDIR /src 7 | COPY . . 8 | WORKDIR /src/templates/service/host/EasyAbp.DynamicForm.HttpApi.Host 9 | RUN dotnet restore -nowarn:msb3202,nu1503 10 | RUN dotnet build --no-restore -c Release -o /app 11 | 12 | FROM build AS publish 13 | RUN dotnet publish --no-restore -c Release -o /app 14 | 15 | FROM base AS final 16 | WORKDIR /app 17 | COPY --from=publish /app . 18 | ENTRYPOINT ["dotnet", "EasyAbp.DynamicForm.HttpApi.Host.dll"] 19 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/EasyAbp.DynamicForm.HttpApi.Host.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "host.http-api" 3 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/EntityFrameworkCore/DynamicFormHttpApiHostMigrationsDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Volo.Abp.EntityFrameworkCore; 3 | 4 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 5 | 6 | public class DynamicFormHttpApiHostMigrationsDbContext : AbpDbContext 7 | { 8 | public DynamicFormHttpApiHostMigrationsDbContext(DbContextOptions options) 9 | : base(options) 10 | { 11 | 12 | } 13 | 14 | protected override void OnModelCreating(ModelBuilder modelBuilder) 15 | { 16 | base.OnModelCreating(modelBuilder); 17 | 18 | modelBuilder.ConfigureDynamicForm(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/EntityFrameworkCore/DynamicFormHttpApiHostMigrationsDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Design; 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public class DynamicFormHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory 9 | { 10 | public DynamicFormHttpApiHostMigrationsDbContext CreateDbContext(string[] args) 11 | { 12 | var configuration = BuildConfiguration(); 13 | 14 | var builder = new DbContextOptionsBuilder() 15 | .UseSqlServer(configuration.GetConnectionString("DynamicForm")); 16 | 17 | return new DynamicFormHttpApiHostMigrationsDbContext(builder.Options); 18 | } 19 | 20 | private static IConfigurationRoot BuildConfiguration() 21 | { 22 | var builder = new ConfigurationBuilder() 23 | .SetBasePath(Directory.GetCurrentDirectory()) 24 | .AddJsonFile("appsettings.json", optional: false); 25 | 26 | return builder.Build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Migrations/20221109191118_AddedFormItemDisplayOrder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedFormItemDisplayOrder : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "DisplayOrder", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "int", 15 | nullable: false, 16 | defaultValue: 0); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropColumn( 22 | name: "DisplayOrder", 23 | table: "EasyAbpDynamicFormFormItems"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Migrations/20221206060550_AddedGroupProperties.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedGroupProperties : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "Group", 13 | table: "EasyAbpDynamicFormFormItemTemplates", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | 17 | migrationBuilder.AddColumn( 18 | name: "Group", 19 | table: "EasyAbpDynamicFormFormItems", 20 | type: "nvarchar(max)", 21 | nullable: true); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropColumn( 27 | name: "Group", 28 | table: "EasyAbpDynamicFormFormItemTemplates"); 29 | 30 | migrationBuilder.DropColumn( 31 | name: "Group", 32 | table: "EasyAbpDynamicFormFormItems"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Migrations/20221206063325_AddedFormItemInfoTextProperty.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedFormItemInfoTextProperty : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "InfoText", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.DropColumn( 21 | name: "InfoText", 22 | table: "EasyAbpDynamicFormFormItems"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Migrations/20230116092440_AddedFormItemTemplateDisabled.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | /// 8 | public partial class AddedFormItemTemplateDisabled : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItemTemplates", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItemTemplates"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Migrations/20230119042746_MovedDisabledToMetadata.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | /// 8 | public partial class MovedDisabledToMetadata : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItems", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItems"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44341", 7 | "sslPort": 44341 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EasyAbp.DynamicForm.DemoApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:44341", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "CorsOrigins": "https://*.DynamicForm.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" 4 | }, 5 | "ConnectionStrings": { 6 | "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=DynamicForm_Main;Trusted_Connection=True", 7 | "DynamicForm": "Server=(LocalDb)\\MSSQLLocalDB;Database=DynamicForm_Module;Trusted_Connection=True" 8 | }, 9 | "Redis": { 10 | "Configuration": "127.0.0.1" 11 | }, 12 | "AuthServer": { 13 | "Authority": "https://localhost:44313/", 14 | "RequireHttpsMetadata": "false", 15 | "SwaggerClientId": "DynamicForm_Swagger", 16 | "SwaggerClientSecret": "1q2w3e*" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.HttpApi.Host/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.AspNetCore.Mvc.Authentication; 2 | 3 | namespace EasyAbp.DynamicForm.Controllers; 4 | 5 | public class AccountController : ChallengeAccountController 6 | { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/DynamicFormBrandingProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Ui.Branding; 2 | using Volo.Abp.DependencyInjection; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | [Dependency(ReplaceServices = true)] 7 | public class DynamicFormBrandingProvider : DefaultBrandingProvider 8 | { 9 | public override string AppName => "DynamicForm"; 10 | } 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/DynamicFormWebAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace EasyAbp.DynamicForm; 4 | 5 | public class DynamicFormWebAutoMapperProfile : Profile 6 | { 7 | public DynamicFormWebAutoMapperProfile() 8 | { 9 | //Define your AutoMapper configuration here for the Web project. 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/EasyAbp.DynamicForm.Web.Host.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "host.mvc" 3 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Pages/DynamicFormPageModel.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Localization; 2 | using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; 3 | 4 | namespace EasyAbp.DynamicForm.Pages; 5 | 6 | public abstract class DynamicFormPageModel : AbpPageModel 7 | { 8 | protected DynamicFormPageModel() 9 | { 10 | LocalizationResourceType = typeof(DynamicFormResource); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using EasyAbp.DynamicForm.Pages 3 | @model IndexModel 4 | @using Microsoft.AspNetCore.Mvc.Localization 5 | @using EasyAbp.DynamicForm.Localization 6 | @using Volo.Abp.Users 7 | @inject IHtmlLocalizer L 8 | @inject ICurrentUser CurrentUser 9 | 10 | 11 | Welcome 12 | 13 | @if (!CurrentUser.IsAuthenticated) 14 | { 15 |
16 | 17 |
18 | } 19 | else 20 | { 21 | Claims
22 | @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").OrderBy(x => x).JoinAsString("
")) 23 | } 24 |
25 |

abp.io

26 |
27 |
28 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.Authentication; 3 | 4 | namespace EasyAbp.DynamicForm.Pages; 5 | 6 | public class IndexModel : DynamicFormPageModel 7 | { 8 | public void OnGet() 9 | { 10 | 11 | } 12 | 13 | public async Task OnPostLoginAsync() 14 | { 15 | await HttpContext.ChallengeAsync("oidc"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44314", 7 | "sslPort": 44314 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EasyAbp.DynamicForm.Web.Host": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:44314", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/abp.resourcemapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | aliases: { 3 | 4 | }, 5 | clean: [ 6 | 7 | ], 8 | mappings: { 9 | 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "App": { 3 | "SelfUrl": "https://localhost:44314/" 4 | }, 5 | "RemoteServices": { 6 | "Default": { 7 | "BaseUrl": "https://localhost:44313/" 8 | }, 9 | "DynamicForm": { 10 | "BaseUrl": "https://localhost:44341/" 11 | } 12 | }, 13 | "Redis": { 14 | "Configuration": "127.0.0.1" 15 | }, 16 | "AuthServer": { 17 | "Authority": "https://localhost:44313/", 18 | "RequireHttpsMetadata": "false", 19 | "ClientId": "DynamicForm_Web" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Host/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "my-app", 4 | "private": true, 5 | "dependencies": { 6 | "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.1.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/EasyAbp.DynamicForm.Web.Unified.abppkg.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/EntityFrameworkCore/UnifiedDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Volo.Abp.AuditLogging.EntityFrameworkCore; 3 | using Volo.Abp.EntityFrameworkCore; 4 | using Volo.Abp.FeatureManagement.EntityFrameworkCore; 5 | using Volo.Abp.Identity.EntityFrameworkCore; 6 | using Volo.Abp.PermissionManagement.EntityFrameworkCore; 7 | using Volo.Abp.SettingManagement.EntityFrameworkCore; 8 | using Volo.Abp.TenantManagement.EntityFrameworkCore; 9 | 10 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 11 | 12 | public class UnifiedDbContext : AbpDbContext 13 | { 14 | public UnifiedDbContext(DbContextOptions options) 15 | : base(options) 16 | { 17 | 18 | } 19 | 20 | protected override void OnModelCreating(ModelBuilder modelBuilder) 21 | { 22 | base.OnModelCreating(modelBuilder); 23 | 24 | modelBuilder.ConfigurePermissionManagement(); 25 | modelBuilder.ConfigureSettingManagement(); 26 | modelBuilder.ConfigureAuditLogging(); 27 | modelBuilder.ConfigureIdentity(); 28 | modelBuilder.ConfigureFeatureManagement(); 29 | modelBuilder.ConfigureTenantManagement(); 30 | modelBuilder.ConfigureDynamicForm(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/EntityFrameworkCore/UnifiedDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Design; 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public class UnifiedDbContextFactory : IDesignTimeDbContextFactory 9 | { 10 | public UnifiedDbContext CreateDbContext(string[] args) 11 | { 12 | var configuration = BuildConfiguration(); 13 | 14 | var builder = new DbContextOptionsBuilder() 15 | .UseSqlServer(configuration.GetConnectionString("Default")); 16 | 17 | return new UnifiedDbContext(builder.Options); 18 | } 19 | 20 | private static IConfigurationRoot BuildConfiguration() 21 | { 22 | var builder = new ConfigurationBuilder() 23 | .SetBasePath(Directory.GetCurrentDirectory()) 24 | .AddJsonFile("appsettings.json", optional: false); 25 | 26 | return builder.Build(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20221109191041_AddedFormItemDisplayOrder.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedFormItemDisplayOrder : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "DisplayOrder", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "int", 15 | nullable: false, 16 | defaultValue: 0); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropColumn( 22 | name: "DisplayOrder", 23 | table: "EasyAbpDynamicFormFormItems"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20221206060618_AddedGroupProperties.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedGroupProperties : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "Group", 13 | table: "EasyAbpDynamicFormFormItemTemplates", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | 17 | migrationBuilder.AddColumn( 18 | name: "Group", 19 | table: "EasyAbpDynamicFormFormItems", 20 | type: "nvarchar(max)", 21 | nullable: true); 22 | } 23 | 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropColumn( 27 | name: "Group", 28 | table: "EasyAbpDynamicFormFormItemTemplates"); 29 | 30 | migrationBuilder.DropColumn( 31 | name: "Group", 32 | table: "EasyAbpDynamicFormFormItems"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20221206062933_AddedFormItemInfoTextProperty.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | public partial class AddedFormItemInfoTextProperty : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "InfoText", 13 | table: "EasyAbpDynamicFormFormItems", 14 | type: "nvarchar(max)", 15 | nullable: true); 16 | } 17 | 18 | protected override void Down(MigrationBuilder migrationBuilder) 19 | { 20 | migrationBuilder.DropColumn( 21 | name: "InfoText", 22 | table: "EasyAbpDynamicFormFormItems"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20230116092400_AddedFormItemTemplateDisabled.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | /// 8 | public partial class AddedFormItemTemplateDisabled : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItemTemplates", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItemTemplates"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20230119042704_MovedDisabledToMetadata.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EasyAbp.DynamicForm.Migrations 6 | { 7 | /// 8 | public partial class MovedDisabledToMetadata : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Disabled", 15 | table: "EasyAbpDynamicFormFormItems", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Disabled", 26 | table: "EasyAbpDynamicFormFormItems"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Migrations/20250331065228_Upgraded_To_Abp_9_1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace EasyAbp.DynamicForm.Migrations 7 | { 8 | /// 9 | public partial class Upgraded_To_Abp_9_1 : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.AddColumn( 15 | name: "CreationTime", 16 | table: "AbpRoles", 17 | type: "datetime2", 18 | nullable: false, 19 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); 20 | 21 | migrationBuilder.AddColumn( 22 | name: "CreationTime", 23 | table: "AbpClaimTypes", 24 | type: "datetime2", 25 | nullable: false, 26 | defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); 27 | } 28 | 29 | /// 30 | protected override void Down(MigrationBuilder migrationBuilder) 31 | { 32 | migrationBuilder.DropColumn( 33 | name: "CreationTime", 34 | table: "AbpRoles"); 35 | 36 | migrationBuilder.DropColumn( 37 | name: "CreationTime", 38 | table: "AbpClaimTypes"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using Localization.Resources.AbpUi 3 | @using Microsoft.Extensions.Localization 4 | @using EasyAbp.DynamicForm.Pages 5 | @using Volo.Abp.Users 6 | @model IndexModel 7 | @inject IStringLocalizer Localizer 8 | @inject ICurrentUser CurrentUser 9 | 10 | 11 | Welcome 12 | 13 | @if (!CurrentUser.IsAuthenticated) 14 | { 15 | @Localizer["Login"] 16 | } 17 | else 18 | { 19 | Welcome: @CurrentUser.UserName 20 | } 21 |
22 |

abp.io

23 |
24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace EasyAbp.DynamicForm.Pages; 4 | 5 | public class IndexModel : PageModel 6 | { 7 | public void OnGet() 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44369", 7 | "sslPort": 44369 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "EasyAbp.DynamicForm.DemoApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:44369", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/abp.resourcemapping.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | aliases: { 3 | "@node_modules": "./node_modules", 4 | "@libs": "./wwwroot/libs" 5 | }, 6 | clean: [ 7 | "@libs" 8 | ], 9 | mappings: { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=DynamicForm_Unified;Trusted_Connection=True" 4 | } 5 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /host/EasyAbp.DynamicForm.Web.Unified/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "my-app", 4 | "private": true, 5 | "dependencies": { 6 | "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.1.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp.DynamicForm.Application.Contracts.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.application-contracts" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp.DynamicForm.Application.Contracts.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/DynamicFormApplicationContractsModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Application; 2 | using Volo.Abp.Modularity; 3 | using Volo.Abp.Authorization; 4 | 5 | namespace EasyAbp.DynamicForm; 6 | 7 | [DependsOn( 8 | typeof(DynamicFormDomainSharedModule), 9 | typeof(AbpDddApplicationContractsModule), 10 | typeof(AbpAuthorizationModule) 11 | )] 12 | public class DynamicFormApplicationContractsModule : AbpModule 13 | { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/DynamicFormRemoteServiceConsts.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | public class DynamicFormRemoteServiceConsts 4 | { 5 | public const string RemoteServiceName = "EasyAbpDynamicForm"; 6 | 7 | public const string ModuleName = "easyAbpDynamicForm"; 8 | } 9 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/CreateFormItemTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | 6 | [Serializable] 7 | public class CreateFormItemTemplateDto 8 | { 9 | public string Name { get; set; } 10 | 11 | public string Group { get; set; } 12 | 13 | public string InfoText { get; set; } 14 | 15 | public string Type { get; set; } 16 | 17 | public bool Optional { get; set; } 18 | 19 | public string Configurations { get; set; } 20 | 21 | public AvailableValues AvailableValues { get; set; } 22 | 23 | public int DisplayOrder { get; set; } 24 | 25 | public bool Disabled { get; set; } 26 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/CreateFormTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | 6 | [Serializable] 7 | public class CreateFormTemplateDto 8 | { 9 | public string FormDefinitionName { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string CustomTag { get; set; } 14 | 15 | public List FormItemTemplates { get; set; } = new(); 16 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/DynamicFormBaseInfoDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | 6 | [Serializable] 7 | public class DynamicFormBaseInfoDto 8 | { 9 | public List FormItemTypeDefinitions { get; set; } 10 | 11 | public List FormDefinitions { get; set; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/FormDefinitionDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 4 | 5 | [Serializable] 6 | public class FormDefinitionDto 7 | { 8 | public string Name { get; set; } 9 | 10 | public string DisplayName { get; set; } 11 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/FormItemTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | using Volo.Abp.Application.Dtos; 4 | 5 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 6 | 7 | [Serializable] 8 | public class FormItemTemplateDto : EntityDto 9 | { 10 | public Guid FormTemplateId { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | public string Group { get; set; } 15 | 16 | public string InfoText { get; set; } 17 | 18 | public string Type { get; set; } 19 | 20 | public bool Optional { get; set; } 21 | 22 | public string Configurations { get; set; } 23 | 24 | public AvailableValues AvailableValues { get; set; } 25 | 26 | public int DisplayOrder { get; set; } 27 | 28 | public bool Disabled { get; set; } 29 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/FormItemTypeDefinitionDto.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 2 | 3 | public class FormItemTypeDefinitionDto 4 | { 5 | /// 6 | /// Used as Value of `FormItem.Type`. 7 | /// 8 | public string Name { get; set; } 9 | 10 | /// 11 | /// Localization item key for UI to display the name of this form item type. 12 | /// 13 | public string LocalizationItemKey { get; set; } 14 | 15 | /// 16 | /// Used as the JSON serialized form item configuration template. 17 | /// 18 | public string ConfigurationsJsonTemplate { get; set; } 19 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/FormTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Volo.Abp.Application.Dtos; 4 | 5 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 6 | 7 | [Serializable] 8 | public class FormTemplateDto : FullAuditedEntityDto 9 | { 10 | public string FormDefinitionName { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | public string CustomTag { get; set; } 15 | 16 | public List FormItemTemplates { get; set; } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/FormTemplateGetListInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Application.Dtos; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | 6 | [Serializable] 7 | public class FormTemplateGetListInput : PagedAndSortedResultRequestDto 8 | { 9 | public string FormDefinitionName { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string CustomTag { get; set; } 14 | 15 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/UpdateFormItemTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | 6 | [Serializable] 7 | public class UpdateFormItemTemplateDto 8 | { 9 | public string Group { get; set; } 10 | 11 | public string InfoText { get; set; } 12 | 13 | public string Type { get; set; } 14 | 15 | public bool Optional { get; set; } 16 | 17 | public string Configurations { get; set; } 18 | 19 | public AvailableValues AvailableValues { get; set; } 20 | 21 | public int DisplayOrder { get; set; } 22 | 23 | public bool Disabled { get; set; } 24 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/Dtos/UpdateFormTemplateDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.FormTemplates.Dtos; 4 | 5 | [Serializable] 6 | public class UpdateFormTemplateDto 7 | { 8 | public string Name { get; set; } 9 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/FormTemplates/IFormTemplateAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using EasyAbp.DynamicForm.FormTemplates.Dtos; 4 | using JetBrains.Annotations; 5 | using Volo.Abp.Application.Services; 6 | 7 | namespace EasyAbp.DynamicForm.FormTemplates; 8 | 9 | public interface IFormTemplateAppService : 10 | ICrudAppService< 11 | FormTemplateDto, 12 | Guid, 13 | FormTemplateGetListInput, 14 | CreateFormTemplateDto, 15 | UpdateFormTemplateDto> 16 | { 17 | Task GetBaseInfoAsync(); 18 | 19 | Task CreateFormItemAsync(Guid id, CreateFormItemTemplateDto input); 20 | 21 | Task UpdateFormItemAsync(Guid id, [NotNull] string name, UpdateFormItemTemplateDto input); 22 | 23 | Task DeleteFormItemAsync(Guid id, [NotNull] string name); 24 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/CreateFormDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace EasyAbp.DynamicForm.Forms.Dtos; 5 | 6 | [Serializable] 7 | public class CreateFormDto 8 | { 9 | public Guid FormTemplateId { get; set; } 10 | 11 | public List FormItems { get; set; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/CreateFormItemDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.Forms.Dtos; 4 | 5 | [Serializable] 6 | public class CreateFormItemDto 7 | { 8 | public string Name { get; set; } = null!; 9 | 10 | public string Value { get; set; } 11 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/FormDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Volo.Abp.Application.Dtos; 4 | 5 | namespace EasyAbp.DynamicForm.Forms.Dtos; 6 | 7 | [Serializable] 8 | public class FormDto : FullAuditedEntityDto 9 | { 10 | public string FormDefinitionName { get; set; } 11 | 12 | public Guid FormTemplateId { get; set; } 13 | 14 | public string FormTemplateName { get; set; } 15 | 16 | public List FormItems { get; set; } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/FormGetListInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Application.Dtos; 3 | 4 | namespace EasyAbp.DynamicForm.Forms.Dtos; 5 | 6 | [Serializable] 7 | public class FormGetListInput : PagedAndSortedResultRequestDto 8 | { 9 | public string FormDefinitionName { get; set; } 10 | 11 | public Guid? FormTemplateId { get; set; } 12 | 13 | public string FormTemplateName { get; set; } 14 | 15 | public Guid? CreatorId { get; set; } 16 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/FormItemDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | using Volo.Abp.Application.Dtos; 4 | 5 | namespace EasyAbp.DynamicForm.Forms.Dtos; 6 | 7 | [Serializable] 8 | public class FormItemDto : EntityDto 9 | { 10 | public Guid FormId { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | public string Group { get; set; } 15 | 16 | public string InfoText { get; set; } 17 | 18 | public string Type { get; set; } 19 | 20 | public bool Optional { get; set; } 21 | 22 | public string Configurations { get; set; } 23 | 24 | public AvailableValues AvailableValues { get; set; } 25 | 26 | public int DisplayOrder { get; set; } 27 | 28 | public string Value { get; set; } 29 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/UpdateFormDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.Forms.Dtos; 4 | 5 | [Serializable] 6 | public class UpdateFormDto 7 | { 8 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/Dtos/UpdateFormItemDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.Forms.Dtos; 4 | 5 | [Serializable] 6 | public class UpdateFormItemDto 7 | { 8 | public string Value { get; set; } 9 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Forms/IFormAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using EasyAbp.DynamicForm.Forms.Dtos; 4 | using JetBrains.Annotations; 5 | using Volo.Abp.Application.Services; 6 | 7 | namespace EasyAbp.DynamicForm.Forms; 8 | 9 | public interface IFormAppService : 10 | ICrudAppService< 11 | FormDto, 12 | Guid, 13 | FormGetListInput, 14 | CreateFormDto, 15 | UpdateFormDto> 16 | { 17 | Task UpdateFormItemAsync(Guid id, [NotNull] string name, UpdateFormItemDto input); 18 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/EasyAbp/DynamicForm/Permissions/DynamicFormPermissions.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Reflection; 2 | 3 | namespace EasyAbp.DynamicForm.Permissions; 4 | 5 | public class DynamicFormPermissions 6 | { 7 | public const string GroupName = "EasyAbp.DynamicForm"; 8 | 9 | public static string[] GetAll() 10 | { 11 | return ReflectionHelper.GetPublicConstantsRecursively(typeof(DynamicFormPermissions)); 12 | } 13 | 14 | public class Form 15 | { 16 | public const string Default = GroupName + ".Form"; 17 | public const string Manage = Default + ".Manage"; 18 | public const string Update = Default + ".Update"; 19 | public const string Create = Default + ".Create"; 20 | public const string Delete = Default + ".Delete"; 21 | } 22 | 23 | public class FormTemplate 24 | { 25 | public const string Default = GroupName + ".FormTemplate"; 26 | public const string Manage = Default + ".Manage"; 27 | public const string Update = Default + ".Update"; 28 | public const string Create = Default + ".Create"; 29 | public const string Delete = Default + ".Delete"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application.Contracts/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp.DynamicForm.Application.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.application" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp.DynamicForm.Application.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp/DynamicForm/DynamicFormAppService.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Localization; 2 | using Volo.Abp.Application.Services; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | public abstract class DynamicFormAppService : ApplicationService 7 | { 8 | protected DynamicFormAppService() 9 | { 10 | LocalizationResource = typeof(DynamicFormResource); 11 | ObjectMapperContext = typeof(DynamicFormApplicationModule); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp/DynamicForm/DynamicFormApplicationAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Forms; 2 | using EasyAbp.DynamicForm.Forms.Dtos; 3 | using EasyAbp.DynamicForm.FormTemplates; 4 | using EasyAbp.DynamicForm.FormTemplates.Dtos; 5 | using AutoMapper; 6 | 7 | namespace EasyAbp.DynamicForm; 8 | 9 | public class DynamicFormApplicationAutoMapperProfile : Profile 10 | { 11 | public DynamicFormApplicationAutoMapperProfile() 12 | { 13 | /* You can configure your AutoMapper mapping configuration here. 14 | * Alternatively, you can split your mapping configurations 15 | * into multiple profile classes for a better organization. */ 16 | CreateMap(); 17 | CreateMap(); 18 | CreateMap(); 19 | CreateMap(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp/DynamicForm/DynamicFormApplicationModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp.AutoMapper; 3 | using Volo.Abp.Modularity; 4 | using Volo.Abp.Application; 5 | 6 | namespace EasyAbp.DynamicForm; 7 | 8 | [DependsOn( 9 | typeof(DynamicFormDomainModule), 10 | typeof(DynamicFormApplicationContractsModule), 11 | typeof(AbpDddApplicationModule), 12 | typeof(AbpAutoMapperModule) 13 | )] 14 | public class DynamicFormApplicationModule : AbpModule 15 | { 16 | public override void ConfigureServices(ServiceConfigurationContext context) 17 | { 18 | context.Services.AddAutoMapperObjectMapper(); 19 | Configure(options => 20 | { 21 | options.AddMaps(validate: true); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp/DynamicForm/FormTemplates/FormTemplateOperationInfoModel.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormTemplates; 2 | 3 | public class FormTemplateOperationInfoModel 4 | { 5 | public string FormDefinitionName { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string CustomTag { get; set; } 10 | 11 | public FormTemplate FormTemplate { get; set; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/EasyAbp/DynamicForm/Forms/FormOperationInfoModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm.Forms; 4 | 5 | public class FormOperationInfoModel 6 | { 7 | public string FormDefinitionName { get; set; } 8 | 9 | public Guid? FormTemplateId { get; set; } 10 | 11 | public Guid? CreatorId { get; set; } 12 | 13 | public Form Form { get; set; } 14 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Application/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.Server/DynamicFormBlazorServerModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.AspNetCore.Components.Server.Theming; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace EasyAbp.DynamicForm.Blazor.Server; 5 | 6 | [DependsOn( 7 | typeof(AbpAspNetCoreComponentsServerThemingModule), 8 | typeof(DynamicFormBlazorModule) 9 | )] 10 | public class DynamicFormBlazorServerModule : AbpModule 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.Server/EasyAbp.DynamicForm.Blazor.Server.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.blazor-server" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.Server/EasyAbp.DynamicForm.Blazor.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.Server/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.WebAssembly/DynamicFormBlazorWebAssemblyModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.AspNetCore.Components.WebAssembly.Theming; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace EasyAbp.DynamicForm.Blazor.WebAssembly; 5 | 6 | [DependsOn( 7 | typeof(DynamicFormBlazorModule), 8 | typeof(DynamicFormHttpApiClientModule), 9 | typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule) 10 | )] 11 | public class DynamicFormBlazorWebAssemblyModule : AbpModule 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.WebAssembly/EasyAbp.DynamicForm.Blazor.WebAssembly.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.blazor-wasm" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.WebAssembly/EasyAbp.DynamicForm.Blazor.WebAssembly.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor.WebAssembly/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/DynamicFormBlazorAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace EasyAbp.DynamicForm.Blazor; 4 | 5 | public class DynamicFormBlazorAutoMapperProfile : Profile 6 | { 7 | public DynamicFormBlazorAutoMapperProfile() 8 | { 9 | /* You can configure your AutoMapper mapping configuration here. 10 | * Alternatively, you can split your mapping configurations 11 | * into multiple profile classes for a better organization. */ 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/DynamicFormBlazorModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using EasyAbp.DynamicForm.Blazor.Menus; 3 | using Volo.Abp.AspNetCore.Components.Web.Theming; 4 | using Volo.Abp.AspNetCore.Components.Web.Theming.Routing; 5 | using Volo.Abp.AutoMapper; 6 | using Volo.Abp.Modularity; 7 | using Volo.Abp.UI.Navigation; 8 | 9 | namespace EasyAbp.DynamicForm.Blazor; 10 | 11 | [DependsOn( 12 | typeof(DynamicFormApplicationContractsModule), 13 | typeof(AbpAspNetCoreComponentsWebThemingModule), 14 | typeof(AbpAutoMapperModule) 15 | )] 16 | public class DynamicFormBlazorModule : AbpModule 17 | { 18 | public override void ConfigureServices(ServiceConfigurationContext context) 19 | { 20 | context.Services.AddAutoMapperObjectMapper(); 21 | 22 | Configure(options => 23 | { 24 | options.AddProfile(validate: true); 25 | }); 26 | 27 | Configure(options => 28 | { 29 | options.MenuContributors.Add(new DynamicFormMenuContributor()); 30 | }); 31 | 32 | Configure(options => 33 | { 34 | options.AdditionalAssemblies.Add(typeof(DynamicFormBlazorModule).Assembly); 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/EasyAbp.DynamicForm.Blazor.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.blazor" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/EasyAbp.DynamicForm.Blazor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 16 | 17 | 18 | 19 | 20 | A comma-separated list of error codes that can be safely ignored in assembly verification. 21 | 22 | 23 | 24 | 25 | 'false' to turn off automatic generation of the XML Schema file. 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/Menus/DynamicFormMenuContributor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.Localization; 3 | using Volo.Abp.UI.Navigation; 4 | 5 | namespace EasyAbp.DynamicForm.Blazor.Menus; 6 | 7 | public class DynamicFormMenuContributor : IMenuContributor 8 | { 9 | public async Task ConfigureMenuAsync(MenuConfigurationContext context) 10 | { 11 | if (context.Menu.Name == StandardMenus.Main) 12 | { 13 | await ConfigureMainMenuAsync(context); 14 | } 15 | } 16 | 17 | private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) 18 | { 19 | var l = context.GetLocalizer(); 20 | //Add main menu items. 21 | 22 | var dynamicFormMenu = new ApplicationMenuItem(DynamicFormMenus.Prefix, 23 | displayName: l["Menu:DynamicForm"], "/DynamicForm/FormTemplates/FormTemplate", icon: "fa fa-wpforms"); 24 | 25 | context.Menu.GetAdministration().AddItem(dynamicFormMenu); 26 | } 27 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/Menus/DynamicFormMenus.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Blazor.Menus; 2 | 3 | public class DynamicFormMenus 4 | { 5 | public const string Prefix = "EasyAbp.DynamicForm"; 6 | 7 | //Add your menu items here... 8 | //public const string Home = Prefix + ".MyNewMenuItem"; 9 | 10 | public const string Form = Prefix + ".Form"; 11 | public const string FormTemplate = Prefix + ".FormTemplate"; 12 | } 13 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/Pages/DynamicForm/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/DynamicForm" 2 | @using Microsoft.Extensions.Localization 3 | @using global::EasyAbp.DynamicForm.Localization 4 | @inject IStringLocalizer L 5 | @{ 6 | } 7 |

DynamicForm

8 |

@L["SamplePageMessage"]

-------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Blazor/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @using Volo.Abp.AspNetCore.Components.Web 3 | @using Volo.Abp.BlazoriseUI 4 | @using Blazorise 5 | @using Blazorise.DataGrid -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp.DynamicForm.Domain.Core.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.domain" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp.DynamicForm.Domain.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/DynamicFormDomainCoreModule.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Options; 2 | using Volo.Abp.Json; 3 | using Volo.Abp.Modularity; 4 | 5 | namespace EasyAbp.DynamicForm; 6 | 7 | [DependsOn( 8 | typeof(AbpJsonModule), 9 | typeof(DynamicFormDomainSharedModule) 10 | )] 11 | public class DynamicFormDomainCoreModule : AbpModule 12 | { 13 | public override void ConfigureServices(ServiceConfigurationContext context) 14 | { 15 | Configure(options => { options.AddBuiltInFormItemTypes(); }); 16 | } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/ColorPicker/ColorPickerFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EasyAbp.DynamicForm.FormItemTypes.ColorPicker; 4 | 5 | public class ColorPickerFormItemConfigurations 6 | { 7 | [CanBeNull] 8 | public string RegexPattern { get; set; } 9 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/FileBox/FileBoxFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EasyAbp.DynamicForm.FormItemTypes.FileBox; 4 | 5 | public class FileBoxFormItemConfigurations 6 | { 7 | [NotNull] 8 | public string ProviderName { get; set; } = null!; 9 | 10 | [CanBeNull] 11 | public string ProviderKey { get; set; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/FileBox/FileBoxFormItemProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using EasyAbp.DynamicForm.Shared; 4 | using Volo.Abp.DependencyInjection; 5 | 6 | namespace EasyAbp.DynamicForm.FormItemTypes.FileBox; 7 | 8 | public class FileBoxFormItemProvider : FormItemProviderBase, IScopedDependency 9 | { 10 | public static string Name { get; set; } = "FileBox"; 11 | public static string LocalizationItemKey { get; set; } = "FormItemType.FileBox"; 12 | 13 | protected IEnumerable ValueValidators { get; } 14 | 15 | public FileBoxFormItemProvider(IEnumerable valueValidators) 16 | { 17 | ValueValidators = valueValidators; 18 | } 19 | 20 | public override Task ValidateTemplateAsync(IFormItemMetadata metadata) 21 | { 22 | return Task.CompletedTask; 23 | } 24 | 25 | public override async Task ValidateValueAsync(IFormItemMetadata metadata, string value) 26 | { 27 | foreach (var valueValidator in ValueValidators) 28 | { 29 | await valueValidator.ValidateAsync(metadata, value); 30 | } 31 | } 32 | 33 | public override Task CreateConfigurationsObjectOrNullAsync() 34 | { 35 | return Task.FromResult(new FileBoxFormItemConfigurations()); 36 | } 37 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/FileBox/IFileBoxValueValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.Shared; 3 | 4 | namespace EasyAbp.DynamicForm.FormItemTypes.FileBox; 5 | 6 | public interface IFileBoxValueValidator 7 | { 8 | Task ValidateAsync(IFormItemMetadata metadata, string value); 9 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/FormItemProviderBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using EasyAbp.DynamicForm.Shared; 4 | using Volo.Abp.DependencyInjection; 5 | using Volo.Abp.Json; 6 | 7 | namespace EasyAbp.DynamicForm.FormItemTypes; 8 | 9 | public abstract class FormItemProviderBase : IFormItemProvider 10 | { 11 | public IAbpLazyServiceProvider LazyServiceProvider { get; set; } 12 | 13 | protected IJsonSerializer JsonSerializer => LazyServiceProvider.LazyGetRequiredService(); 14 | 15 | public abstract Task ValidateTemplateAsync(IFormItemMetadata metadata); 16 | 17 | public abstract Task ValidateValueAsync(IFormItemMetadata metadata, string value); 18 | 19 | public abstract Task CreateConfigurationsObjectOrNullAsync(); 20 | 21 | protected virtual TConfigurations GetConfigurations(IFormItemMetadata metadata) 22 | { 23 | return JsonSerializer.Deserialize(metadata.Configurations.IsNullOrWhiteSpace() 24 | ? "{}" 25 | : metadata.Configurations); 26 | } 27 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/FormItemProviderResolver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Options; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Options; 5 | using Volo.Abp.DependencyInjection; 6 | 7 | namespace EasyAbp.DynamicForm.FormItemTypes; 8 | 9 | public class FormItemProviderResolver : IFormItemProviderResolver, IScopedDependency 10 | { 11 | protected IServiceProvider ServiceProvider { get; } 12 | protected DynamicFormCoreOptions Options { get; } 13 | 14 | public FormItemProviderResolver( 15 | IServiceProvider serviceProvider, 16 | IOptions options) 17 | { 18 | ServiceProvider = serviceProvider; 19 | Options = options.Value; 20 | } 21 | 22 | public IFormItemProvider Resolve(string providerName) 23 | { 24 | return (IFormItemProvider)ServiceProvider.GetRequiredService( 25 | Options.GetFormItemTypeDefinition(providerName).ProviderType); 26 | } 27 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/IFormItemProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.Shared; 3 | using JetBrains.Annotations; 4 | 5 | namespace EasyAbp.DynamicForm.FormItemTypes; 6 | 7 | public interface IFormItemProvider 8 | { 9 | Task ValidateTemplateAsync(IFormItemMetadata metadata); 10 | 11 | Task ValidateValueAsync(IFormItemMetadata metadata, [CanBeNull] string value); 12 | 13 | [ItemCanBeNull] 14 | Task CreateConfigurationsObjectOrNullAsync(); 15 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/IFormItemProviderResolver.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes; 2 | 3 | public interface IFormItemProviderResolver 4 | { 5 | IFormItemProvider Resolve(string providerName); 6 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/NumberBox/NumberBoxFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.NumberBox; 2 | 3 | public class NumberBoxFormItemConfigurations 4 | { 5 | public byte DecimalPlaces { get; set; } 6 | 7 | public long? MaxValue { get; set; } 8 | 9 | public long? MinValue { get; set; } 10 | 11 | public NumberUi NumberUi { get; set; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/NumberBox/NumberUi.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.NumberBox; 2 | 3 | public enum NumberUi 4 | { 5 | Default = 0, 6 | 7 | /// 8 | /// Normal numerical input box. 9 | /// 10 | NumberInput = 1, 11 | 12 | /// 13 | /// The provides a ranged number selection. 14 | /// High-precision decimals or a wider range of numbers may not be well-supported. 15 | /// 16 | Slider = 2, 17 | 18 | /// 19 | /// The provides a simple stars selection, usually integers like 1 to 5. 20 | /// High-precision decimals or a wider range of numbers may not be well-supported. 21 | /// 22 | Rating = 3 23 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/OptionButtons/OptionButtonsFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.OptionButtons; 2 | 3 | public class OptionButtonsFormItemConfigurations 4 | { 5 | public bool IsMultiSelection { get; set; } 6 | 7 | public int? MaxSelection { get; set; } 8 | 9 | public int? MinSelection { get; set; } 10 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/TextBox/TextBoxFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EasyAbp.DynamicForm.FormItemTypes.TextBox; 4 | 5 | public class TextBoxFormItemConfigurations 6 | { 7 | public int Rows { get; set; } = 1; 8 | 9 | /// 10 | /// This option works when ` == 1` and ` == `. 11 | /// 12 | public bool IsSecret { get; set; } 13 | 14 | public uint? MaxLength { get; set; } 15 | 16 | public uint? MinLength { get; set; } 17 | 18 | public TextFormat TextFormat { get; set; } 19 | 20 | [CanBeNull] 21 | public string RegexPattern { get; set; } 22 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/TextBox/TextFormat.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.TextBox; 2 | 3 | public enum TextFormat 4 | { 5 | Default = 0, 6 | PlainText = 1, 7 | Markdown = 2 8 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/TimePicker/TimeDimension.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.TimePicker; 2 | 3 | public enum TimeDimension 4 | { 5 | Default = 0, 6 | 7 | /// 8 | /// 2024-08-21T12:55:20.132Z 9 | /// 10 | DateTime = 1, 11 | 12 | /// 13 | /// 2024-01-01 14 | /// 15 | Year = 2, 16 | 17 | /// 18 | /// 2024-08-01 19 | /// 20 | Month = 3, 21 | 22 | /// 23 | /// 2024-08-21 24 | /// 25 | Day = 4, 26 | 27 | /// 28 | /// 12:55:20.132 29 | /// 30 | Time = 5 31 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/TimePicker/TimePickerFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.TimePicker; 2 | 3 | public class TimePickerFormItemConfigurations 4 | { 5 | public TimeDimension TimeDimension { get; set; } 6 | 7 | public TimePrecision TimePrecision { get; set; } 8 | 9 | /// 10 | /// If true, the value represents a time range (including start and end times). 11 | /// Example for a single time: 2024-08-21T12:55:20.132Z. 12 | /// Example for a ranged time: 2024-08-21T12:55:20.132Z;2024-08-22T12:55:20.132Z. 13 | /// 14 | public bool IsTimeRange { get; set; } 15 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/TimePicker/TimePrecision.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.TimePicker; 2 | 3 | public enum TimePrecision 4 | { 5 | Default = 0, 6 | 7 | /// 8 | /// 1970-01-01T12:55:20.132Z 9 | /// 10 | Full = 1, 11 | 12 | /// 13 | /// 1970-01-01T12:55:20.000Z 14 | /// 15 | Seconds = 2, 16 | 17 | /// 18 | /// 1970-01-01T12:55:00.000Z 19 | /// 20 | Minutes = 3, 21 | 22 | /// 23 | /// 1970-01-01T12:00:00.000Z 24 | /// 25 | Hours = 4 26 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/FormItemTypes/Toggle/ToggleFormItemConfigurations.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormItemTypes.Toggle; 2 | 3 | public class ToggleFormItemConfigurations 4 | { 5 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/IDynamicFormValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using EasyAbp.DynamicForm.Forms; 4 | using EasyAbp.DynamicForm.Shared; 5 | 6 | namespace EasyAbp.DynamicForm; 7 | 8 | public interface IDynamicFormValidator 9 | { 10 | Task ValidateTemplatesAsync(IEnumerable metadataList); 11 | 12 | Task ValidateValuesAsync(IEnumerable metadataList, IEnumerable formItems); 13 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/Options/DynamicFormCoreOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using JetBrains.Annotations; 4 | using Volo.Abp; 5 | 6 | namespace EasyAbp.DynamicForm.Options; 7 | 8 | public class DynamicFormCoreOptions 9 | { 10 | protected Dictionary FormItemTypeDefinitions { get; } = new(); 11 | 12 | public FormItemTypeDefinition GetFormItemTypeDefinition([NotNull] string formItemTypeDefinitionName) 13 | { 14 | return FormItemTypeDefinitions[formItemTypeDefinitionName]; 15 | } 16 | 17 | public List GetFormItemTypeDefinitions() 18 | { 19 | return FormItemTypeDefinitions.Values.ToList(); 20 | } 21 | 22 | public void AddOrUpdateFormItemTypeDefinition([NotNull] FormItemTypeDefinition formItemTypeDefinition) 23 | { 24 | Check.NotNull(formItemTypeDefinition, nameof(formItemTypeDefinition)); 25 | 26 | FormItemTypeDefinitions[formItemTypeDefinition.Name] = formItemTypeDefinition; 27 | } 28 | 29 | public void RemoveFormItemTypeDefinition([NotNull] string formItemTypeDefinitionName) 30 | { 31 | FormItemTypeDefinitions.Remove(formItemTypeDefinitionName); 32 | } 33 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/EasyAbp/DynamicForm/Options/FormItemTypeDefinition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.FormItemTypes; 3 | using JetBrains.Annotations; 4 | using Volo.Abp; 5 | 6 | namespace EasyAbp.DynamicForm.Options; 7 | 8 | public class FormItemTypeDefinition 9 | { 10 | /// 11 | /// Used as Value of `FormItem.Type`. 12 | /// 13 | [NotNull] 14 | public string Name { get; } 15 | 16 | /// 17 | /// Localization item key for UI to display the name of this form item type. 18 | /// 19 | [CanBeNull] 20 | public string LocalizationItemKey { get; } 21 | 22 | /// 23 | /// This type should implement . 24 | /// 25 | public Type ProviderType { get; } 26 | 27 | public FormItemTypeDefinition( 28 | [NotNull] string name, [CanBeNull] string localizationItemKey, [NotNull] Type providerType) 29 | { 30 | Name = Check.NotNullOrWhiteSpace(name, nameof(name)); 31 | LocalizationItemKey = localizationItemKey; 32 | ProviderType = Check.NotNull(providerType, nameof(providerType)); 33 | } 34 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Core/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp.DynamicForm.Domain.Shared.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.domain-shared" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp.DynamicForm.Domain.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/DynamicFormDomainSharedModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Domain; 2 | using Volo.Abp.Modularity; 3 | using Volo.Abp.Localization; 4 | using EasyAbp.DynamicForm.Localization; 5 | using Volo.Abp.Localization.ExceptionHandling; 6 | using Volo.Abp.Validation; 7 | using Volo.Abp.Validation.Localization; 8 | using Volo.Abp.VirtualFileSystem; 9 | 10 | namespace EasyAbp.DynamicForm; 11 | 12 | [DependsOn( 13 | typeof(AbpValidationModule), 14 | typeof(AbpDddDomainSharedModule) 15 | )] 16 | public class DynamicFormDomainSharedModule : AbpModule 17 | { 18 | public override void ConfigureServices(ServiceConfigurationContext context) 19 | { 20 | Configure(options => 21 | { 22 | options.FileSets.AddEmbedded(); 23 | }); 24 | 25 | Configure(options => 26 | { 27 | options.Resources 28 | .Add("en") 29 | .AddBaseTypes(typeof(AbpValidationResource)) 30 | .AddVirtualJson("/EasyAbp/DynamicForm/Localization"); 31 | }); 32 | 33 | Configure(options => 34 | { 35 | options.MapCodeNamespace("EasyAbp.DynamicForm", typeof(DynamicFormResource)); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/DynamicFormErrorCodes.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | public static class DynamicFormErrorCodes 4 | { 5 | //Add your business exception error codes here... 6 | } 7 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/Forms/CreateUpdateFormItemModel.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Volo.Abp; 3 | 4 | namespace EasyAbp.DynamicForm.Forms; 5 | 6 | public class CreateUpdateFormItemModel : IFormItem 7 | { 8 | public string Name { get; set; } 9 | 10 | public string Value { get; set; } 11 | 12 | public CreateUpdateFormItemModel([NotNull] string name, [CanBeNull] string value) 13 | { 14 | Name = Check.NotNullOrWhiteSpace(name, nameof(name)); 15 | Value = value; 16 | } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/Forms/IFormItem.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace EasyAbp.DynamicForm.Forms; 4 | 5 | public interface IFormItem 6 | { 7 | [NotNull] 8 | string Name { get; } 9 | 10 | [CanBeNull] 11 | string Value { get; } 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/Localization/DynamicFormResource.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Localization; 2 | 3 | namespace EasyAbp.DynamicForm.Localization; 4 | 5 | [LocalizationResourceName("EasyAbpDynamicForm")] 6 | public class DynamicFormResource 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/Shared/AvailableValues.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace EasyAbp.DynamicForm.Shared; 4 | 5 | public class AvailableValues : List 6 | { 7 | public AvailableValues() : base(new List()) 8 | { 9 | } 10 | 11 | public AvailableValues(IEnumerable collection) : base(collection) 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/EasyAbp/DynamicForm/Shared/IHasAvailableValues.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Shared; 2 | 3 | public interface IHasAvailableValues 4 | { 5 | /// 6 | /// Available radio values. It only affects if not null. 7 | /// 8 | AvailableValues AvailableValues { get; } 9 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain.Shared/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp.DynamicForm.Domain.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.domain" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp.DynamicForm.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/DynamicFormDbProperties.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | public static class DynamicFormDbProperties 4 | { 5 | public static string DbTablePrefix { get; set; } = "EasyAbpDynamicForm"; 6 | 7 | public static string DbSchema { get; set; } = null; 8 | 9 | public const string ConnectionStringName = "EasyAbpDynamicForm"; 10 | } 11 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/DynamicFormDomainModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Domain; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | [DependsOn( 7 | typeof(AbpDddDomainModule), 8 | typeof(DynamicFormDomainCoreModule) 9 | )] 10 | public class DynamicFormDomainModule : AbpModule 11 | { 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/DynamicFormErrorCodes.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | public static class DynamicFormErrorCodes 4 | { 5 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/FormTemplates/ICustomFormItemValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.Shared; 3 | using JetBrains.Annotations; 4 | 5 | namespace EasyAbp.DynamicForm.FormTemplates; 6 | 7 | public interface ICustomFormItemValidator 8 | { 9 | Task ValidateValueAsync(IFormItemMetadata formItemMetadata, [CanBeNull] string value); 10 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/FormTemplates/IFormTemplateRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Domain.Repositories; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates; 5 | 6 | public interface IFormTemplateRepository : IRepository 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/Forms/IFormRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Domain.Repositories; 3 | 4 | namespace EasyAbp.DynamicForm.Forms; 5 | 6 | public interface IFormRepository : IRepository 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/Options/DynamicFormOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using JetBrains.Annotations; 4 | using Volo.Abp; 5 | 6 | namespace EasyAbp.DynamicForm.Options; 7 | 8 | public class DynamicFormOptions 9 | { 10 | protected Dictionary FormDefinitions { get; } = new(); 11 | 12 | public FormDefinition GetFormDefinition([NotNull] string formDefinitionName) 13 | { 14 | return FormDefinitions[formDefinitionName]; 15 | } 16 | 17 | public List GetFormDefinitions() 18 | { 19 | return FormDefinitions.Values.ToList(); 20 | } 21 | 22 | public void AddOrUpdateFormDefinition([NotNull] FormDefinition formDefinition) 23 | { 24 | Check.NotNull(formDefinition, nameof(formDefinition)); 25 | 26 | FormDefinitions[formDefinition.Name] = formDefinition; 27 | } 28 | 29 | public void RemoveFormDefinition([NotNull] string formDefinitionName) 30 | { 31 | FormDefinitions.Remove(formDefinitionName); 32 | } 33 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/Options/FormDefinition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Volo.Abp; 5 | 6 | namespace EasyAbp.DynamicForm.Options; 7 | 8 | public class FormDefinition 9 | { 10 | [NotNull] 11 | public string Name { get; } 12 | 13 | [CanBeNull] 14 | public string DisplayName { get; } 15 | 16 | /// 17 | /// Should implement the ICustomFormItemValidator interface. 18 | /// 19 | public List CustomFormItemValidatorTypes { get; } 20 | 21 | public FormDefinition( 22 | [NotNull] string name, 23 | [CanBeNull] string displayName, 24 | List customFormItemValidatorTypes = null) 25 | { 26 | Name = Check.NotNullOrWhiteSpace(name, nameof(name)); 27 | DisplayName = displayName; 28 | CustomFormItemValidatorTypes = customFormItemValidatorTypes ?? new List(); 29 | } 30 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/Settings/DynamicFormSettingDefinitionProvider.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Settings; 2 | 3 | namespace EasyAbp.DynamicForm.Settings; 4 | 5 | public class DynamicFormSettingDefinitionProvider : SettingDefinitionProvider 6 | { 7 | public override void Define(ISettingDefinitionContext context) 8 | { 9 | /* Define module settings here. 10 | * Use names from DynamicFormSettings class. 11 | */ 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/EasyAbp/DynamicForm/Settings/DynamicFormSettings.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Settings; 2 | 3 | public static class DynamicFormSettings 4 | { 5 | public const string GroupName = "EasyAbp.DynamicForm"; 6 | 7 | /* Add constants for setting names. Example: 8 | * public const string MySettingName = GroupName + ".MySettingName"; 9 | */ 10 | } 11 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Domain/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 16 | 17 | 18 | 19 | 20 | A comma-separated list of error codes that can be safely ignored in assembly verification. 21 | 22 | 23 | 24 | 25 | 'false' to turn off automatic generation of the XML Schema file. 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp.DynamicForm.EntityFrameworkCore.Shared.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.ef" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp.DynamicForm.EntityFrameworkCore.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp/DynamicForm/EntityFrameworkCore/AvailableValuesValueComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using EasyAbp.DynamicForm.Shared; 4 | using Microsoft.EntityFrameworkCore.ChangeTracking; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public class AvailableValuesValueComparer : ValueComparer 9 | { 10 | public AvailableValuesValueComparer() 11 | : base( 12 | (d1, d2) => d1.SequenceEqual(d2), 13 | d => d.Aggregate(0, (k, v) => HashCode.Combine(k, v.GetHashCode())), 14 | d => new AvailableValues(d)) 15 | { 16 | } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp/DynamicForm/EntityFrameworkCore/AvailableValuesValueConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EasyAbp.DynamicForm.Shared; 4 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public class AvailableValuesValueConverter : ValueConverter 9 | { 10 | public static string Separator { get; set; } = ","; 11 | 12 | public AvailableValuesValueConverter() : base( 13 | v => v.JoinAsString(Separator), 14 | v => new AvailableValues(v.Split(Separator, StringSplitOptions.RemoveEmptyEntries))) 15 | { 16 | } 17 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp/DynamicForm/EntityFrameworkCore/DynamicFormEntityFrameworkCoreSharedModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.EntityFrameworkCore; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 5 | 6 | [DependsOn( 7 | typeof(DynamicFormDomainCoreModule), 8 | typeof(AbpEntityFrameworkCoreModule) 9 | )] 10 | public class DynamicFormEntityFrameworkCoreSharedModule : AbpModule 11 | { 12 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/EasyAbp/DynamicForm/EntityFrameworkCore/DynamicFormEntityTypeBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 5 | 6 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 7 | 8 | public static class DynamicFormEntityTypeBuilderExtensions 9 | { 10 | public static void TryConfigureAvailableValues(this EntityTypeBuilder b) 11 | { 12 | if (b.Metadata.ClrType.IsAssignableTo()) 13 | { 14 | b.Property(nameof(IHasAvailableValues.AvailableValues)) 15 | .HasConversion() 16 | .HasColumnName(nameof(IHasAvailableValues.AvailableValues)) 17 | .Metadata.SetValueComparer(new AvailableValuesValueComparer()); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore.Shared/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp.DynamicForm.EntityFrameworkCore.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.ef" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp.DynamicForm.EntityFrameworkCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/EntityFrameworkCore/DynamicFormDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Volo.Abp.Data; 3 | using Volo.Abp.EntityFrameworkCore; 4 | using EasyAbp.DynamicForm.Forms; 5 | using EasyAbp.DynamicForm.FormTemplates; 6 | 7 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 8 | 9 | [ConnectionStringName(DynamicFormDbProperties.ConnectionStringName)] 10 | public class DynamicFormDbContext : AbpDbContext, IDynamicFormDbContext 11 | { 12 | /* Add DbSet for each Aggregate Root here. Example: 13 | * public DbSet Questions { get; set; } 14 | */ 15 | public DbSet
Forms { get; set; } 16 | public DbSet FormItems { get; set; } 17 | public DbSet FormTemplates { get; set; } 18 | public DbSet FormItemTemplates { get; set; } 19 | 20 | public DynamicFormDbContext(DbContextOptions options) 21 | : base(options) 22 | { 23 | } 24 | 25 | protected override void OnModelCreating(ModelBuilder builder) 26 | { 27 | base.OnModelCreating(builder); 28 | 29 | builder.ConfigureDynamicForm(); 30 | } 31 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/EntityFrameworkCore/DynamicFormEntityFrameworkCoreModule.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.FormTemplates; 2 | using EasyAbp.DynamicForm.Forms; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Volo.Abp.EntityFrameworkCore; 5 | using Volo.Abp.Modularity; 6 | 7 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 8 | 9 | [DependsOn( 10 | typeof(DynamicFormDomainModule), 11 | typeof(DynamicFormEntityFrameworkCoreSharedModule), 12 | typeof(AbpEntityFrameworkCoreModule) 13 | )] 14 | public class DynamicFormEntityFrameworkCoreModule : AbpModule 15 | { 16 | public override void ConfigureServices(ServiceConfigurationContext context) 17 | { 18 | context.Services.AddAbpDbContext(options => 19 | { 20 | /* Add custom repositories here. Example: 21 | * options.AddRepository(); 22 | */ 23 | options.AddRepository(); 24 | options.AddRepository(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/EntityFrameworkCore/IDynamicFormDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Volo.Abp.Data; 3 | using Volo.Abp.EntityFrameworkCore; 4 | using EasyAbp.DynamicForm.Forms; 5 | using EasyAbp.DynamicForm.FormTemplates; 6 | 7 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 8 | 9 | [ConnectionStringName(DynamicFormDbProperties.ConnectionStringName)] 10 | public interface IDynamicFormDbContext : IEfCoreDbContext 11 | { 12 | /* Add DbSet for each Aggregate Root here. Example: 13 | * DbSet Questions { get; } 14 | */ 15 | DbSet Forms { get; set; } 16 | DbSet FormTemplates { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/FormTemplates/FormTemplateEfCoreQuerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace EasyAbp.DynamicForm.FormTemplates; 5 | 6 | public static class FormTemplateEfCoreQueryableExtensions 7 | { 8 | public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) 9 | { 10 | if (!include) 11 | { 12 | return queryable; 13 | } 14 | 15 | return queryable 16 | .Include(x => x.FormItemTemplates) 17 | ; 18 | } 19 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/FormTemplates/FormTemplateRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using EasyAbp.DynamicForm.EntityFrameworkCore; 5 | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; 6 | using Volo.Abp.EntityFrameworkCore; 7 | 8 | namespace EasyAbp.DynamicForm.FormTemplates; 9 | 10 | public class FormTemplateRepository : EfCoreRepository, IFormTemplateRepository 11 | { 12 | public FormTemplateRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) 13 | { 14 | } 15 | 16 | public override async Task> WithDetailsAsync() 17 | { 18 | return (await GetQueryableAsync()).IncludeDetails(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/Forms/FormEfCoreQuerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace EasyAbp.DynamicForm.Forms; 5 | 6 | public static class FormEfCoreQueryableExtensions 7 | { 8 | public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) 9 | { 10 | if (!include) 11 | { 12 | return queryable; 13 | } 14 | 15 | return queryable 16 | .Include(x => x.FormItems) 17 | ; 18 | } 19 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/EasyAbp/DynamicForm/Forms/FormRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using EasyAbp.DynamicForm.EntityFrameworkCore; 5 | using Volo.Abp.Domain.Repositories.EntityFrameworkCore; 6 | using Volo.Abp.EntityFrameworkCore; 7 | 8 | namespace EasyAbp.DynamicForm.Forms; 9 | 10 | public class FormRepository : EfCoreRepository, IFormRepository 11 | { 12 | public FormRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) 13 | { 14 | } 15 | 16 | public override async Task> WithDetailsAsync() 17 | { 18 | return (await GetQueryableAsync()).IncludeDetails(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.EntityFrameworkCore/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi.Client/EasyAbp.DynamicForm.HttpApi.Client.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.http-api-client" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi.Client/EasyAbp.DynamicForm.HttpApi.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi.Client/EasyAbp/DynamicForm/DynamicFormHttpApiClientModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp.Http.Client; 3 | using Volo.Abp.Modularity; 4 | using Volo.Abp.VirtualFileSystem; 5 | 6 | namespace EasyAbp.DynamicForm; 7 | 8 | [DependsOn( 9 | typeof(DynamicFormApplicationContractsModule), 10 | typeof(AbpHttpClientModule))] 11 | public class DynamicFormHttpApiClientModule : AbpModule 12 | { 13 | public override void ConfigureServices(ServiceConfigurationContext context) 14 | { 15 | context.Services.AddHttpClientProxies( 16 | typeof(DynamicFormApplicationContractsModule).Assembly, 17 | DynamicFormRemoteServiceConsts.RemoteServiceName 18 | ); 19 | 20 | Configure(options => 21 | { 22 | options.FileSets.AddEmbedded(); 23 | }); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi.Client/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi/EasyAbp.DynamicForm.HttpApi.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.http-api" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi/EasyAbp.DynamicForm.HttpApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi/EasyAbp/DynamicForm/DynamicFormController.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Localization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Volo.Abp.AspNetCore.Mvc; 4 | 5 | namespace EasyAbp.DynamicForm; 6 | 7 | [Area(DynamicFormRemoteServiceConsts.ModuleName)] 8 | public abstract class DynamicFormController : AbpControllerBase 9 | { 10 | protected DynamicFormController() 11 | { 12 | LocalizationResource = typeof(DynamicFormResource); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi/EasyAbp/DynamicForm/DynamicFormHttpApiModule.cs: -------------------------------------------------------------------------------- 1 | using Localization.Resources.AbpUi; 2 | using EasyAbp.DynamicForm.Localization; 3 | using Volo.Abp.AspNetCore.Mvc; 4 | using Volo.Abp.Localization; 5 | using Volo.Abp.Modularity; 6 | using Microsoft.Extensions.DependencyInjection; 7 | 8 | namespace EasyAbp.DynamicForm; 9 | 10 | [DependsOn( 11 | typeof(DynamicFormApplicationContractsModule), 12 | typeof(AbpAspNetCoreMvcModule))] 13 | public class DynamicFormHttpApiModule : AbpModule 14 | { 15 | public override void PreConfigureServices(ServiceConfigurationContext context) 16 | { 17 | PreConfigure(mvcBuilder => 18 | { 19 | mvcBuilder.AddApplicationPartIfNotExists(typeof(DynamicFormHttpApiModule).Assembly); 20 | }); 21 | } 22 | 23 | public override void ConfigureServices(ServiceConfigurationContext context) 24 | { 25 | Configure(options => 26 | { 27 | options.Resources 28 | .Get() 29 | .AddBaseTypes(typeof(AbpUiResource)); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.HttpApi/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Installer/EasyAbp.DynamicForm.Installer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | true 19 | content\ 20 | 21 | 22 | 23 | true 24 | content\ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Installer/EasyAbp/DynamicForm/DynamicFormInstallerModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Modularity; 2 | using Volo.Abp.VirtualFileSystem; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | [DependsOn( 7 | typeof(AbpVirtualFileSystemModule) 8 | )] 9 | public class DynamicFormInstallerModule : AbpModule 10 | { 11 | public override void ConfigureServices(ServiceConfigurationContext context) 12 | { 13 | Configure(options => 14 | { 15 | options.FileSets.AddEmbedded(); 16 | }); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Installer/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp.DynamicForm.MongoDB.abppkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.mongodb" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp.DynamicForm.MongoDB.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | net9.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp/DynamicForm/MongoDB/DynamicFormMongoDbContext.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Data; 2 | using Volo.Abp.MongoDB; 3 | 4 | namespace EasyAbp.DynamicForm.MongoDB; 5 | 6 | [ConnectionStringName(DynamicFormDbProperties.ConnectionStringName)] 7 | public class DynamicFormMongoDbContext : AbpMongoDbContext, IDynamicFormMongoDbContext 8 | { 9 | /* Add mongo collections here. Example: 10 | * public IMongoCollection Questions => Collection(); 11 | */ 12 | 13 | protected override void CreateModel(IMongoModelBuilder modelBuilder) 14 | { 15 | base.CreateModel(modelBuilder); 16 | 17 | modelBuilder.ConfigureDynamicForm(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp/DynamicForm/MongoDB/DynamicFormMongoDbContextExtensions.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp; 2 | using Volo.Abp.MongoDB; 3 | 4 | namespace EasyAbp.DynamicForm.MongoDB; 5 | 6 | public static class DynamicFormMongoDbContextExtensions 7 | { 8 | public static void ConfigureDynamicForm( 9 | this IMongoModelBuilder builder) 10 | { 11 | Check.NotNull(builder, nameof(builder)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp/DynamicForm/MongoDB/DynamicFormMongoDbModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Volo.Abp.Modularity; 3 | using Volo.Abp.MongoDB; 4 | 5 | namespace EasyAbp.DynamicForm.MongoDB; 6 | 7 | [DependsOn( 8 | typeof(DynamicFormDomainModule), 9 | typeof(AbpMongoDbModule) 10 | )] 11 | public class DynamicFormMongoDbModule : AbpModule 12 | { 13 | public override void ConfigureServices(ServiceConfigurationContext context) 14 | { 15 | context.Services.AddMongoDbContext(options => 16 | { 17 | /* Add custom repositories here. Example: 18 | * options.AddRepository(); 19 | */ 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/EasyAbp/DynamicForm/MongoDB/IDynamicFormMongoDbContext.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Data; 2 | using Volo.Abp.MongoDB; 3 | 4 | namespace EasyAbp.DynamicForm.MongoDB; 5 | 6 | [ConnectionStringName(DynamicFormDbProperties.ConnectionStringName)] 7 | public interface IDynamicFormMongoDbContext : IAbpMongoDbContext 8 | { 9 | /* Define mongo collections here. Example: 10 | * IMongoCollection Questions { get; } 11 | */ 12 | } 13 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.MongoDB/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/DynamicFormWebAutoMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using EasyAbp.DynamicForm.FormTemplates.Dtos; 3 | using EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.ViewModels; 4 | 5 | namespace EasyAbp.DynamicForm.Web; 6 | 7 | public class DynamicFormWebAutoMapperProfile : Profile 8 | { 9 | public DynamicFormWebAutoMapperProfile() 10 | { 11 | /* You can configure your AutoMapper mapping configuration here. 12 | * Alternatively, you can split your mapping configurations 13 | * into multiple profile classes for a better organization. */ 14 | 15 | CreateMap(); 16 | CreateMap(); 17 | } 18 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/EasyAbp.DynamicForm.Web.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.mvc" 3 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Menus/DynamicFormMenuContributor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using EasyAbp.DynamicForm.Localization; 3 | using EasyAbp.DynamicForm.Permissions; 4 | using Volo.Abp.UI.Navigation; 5 | 6 | namespace EasyAbp.DynamicForm.Web.Menus; 7 | 8 | public class DynamicFormMenuContributor : IMenuContributor 9 | { 10 | public async Task ConfigureMenuAsync(MenuConfigurationContext context) 11 | { 12 | if (context.Menu.Name == StandardMenus.Main) 13 | { 14 | await ConfigureMainMenuAsync(context); 15 | } 16 | } 17 | 18 | private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) 19 | { 20 | var l = context.GetLocalizer(); 21 | //Add main menu items. 22 | 23 | if (await context.IsGrantedAsync(DynamicFormPermissions.FormTemplate.Default)) 24 | { 25 | context.Menu.GetAdministration().AddItem(new ApplicationMenuItem(DynamicFormMenus.Prefix, 26 | displayName: l["Menu:DynamicForm"], "~/DynamicForm/FormTemplates/FormTemplate", icon: "fa fa-wpforms")); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Menus/DynamicFormMenus.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Web.Menus; 2 | 3 | public class DynamicFormMenus 4 | { 5 | public const string Prefix = "DynamicForm"; 6 | 7 | //Add your menu items here... 8 | //public const string Home = Prefix + ".MyNewMenuItem"; 9 | 10 | public const string Form = Prefix + ".Form"; 11 | public const string FormTemplate = Prefix + ".FormTemplate"; 12 | } 13 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/CreateModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using Microsoft.AspNetCore.Mvc.Localization 3 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 4 | @using EasyAbp.DynamicForm.Localization 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormItemTemplate.CreateModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/EditModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using EasyAbp.DynamicForm.Localization 3 | @using Microsoft.AspNetCore.Mvc.Localization 4 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormItemTemplate.EditModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using EasyAbp.DynamicForm.FormTemplates; 5 | using EasyAbp.DynamicForm.FormTemplates.Dtos; 6 | using Microsoft.AspNetCore.Mvc; 7 | 8 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormItemTemplate; 9 | 10 | public class IndexModel : DynamicFormPageModel 11 | { 12 | [BindProperty(SupportsGet = true)] 13 | public Guid FormTemplateId { get; set; } 14 | 15 | public List FormItemTypes { get; set; } 16 | 17 | private readonly IFormTemplateAppService _formTemplateAppService; 18 | 19 | public IndexModel(IFormTemplateAppService formTemplateAppService) 20 | { 21 | _formTemplateAppService = formTemplateAppService; 22 | } 23 | 24 | public virtual async Task OnGetAsync() 25 | { 26 | FormItemTypes = (await _formTemplateAppService.GetBaseInfoAsync()).FormItemTypeDefinitions; 27 | } 28 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/ViewModels/EditFormItemTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 3 | 4 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormItemTemplate.ViewModels; 5 | 6 | public class EditFormItemTemplateViewModel 7 | { 8 | [Display(Name = "FormItemTemplateGroup")] 9 | public string Group { get; set; } 10 | 11 | [Display(Name = "FormItemTemplateInfoText")] 12 | public string InfoText { get; set; } 13 | 14 | [Display(Name = "FormItemTemplateType")] 15 | [SelectItems("FormItemTypes")] 16 | [Required] 17 | [DisabledInput] 18 | public string Type { get; set; } 19 | 20 | [Display(Name = "FormItemTemplateOptional")] 21 | public bool Optional { get; set; } 22 | 23 | [Display(Name = "FormItemTemplateConfigurations")] 24 | [TextArea(Rows = 5)] 25 | public string Configurations { get; set; } 26 | 27 | /// 28 | /// Split available values with commas. 29 | /// 30 | [Display(Name = "FormItemTemplateAvailableValues")] 31 | [InputInfoText("FormItemTemplateAvailableValuesInfo")] 32 | public string AvailableValues { get; set; } 33 | 34 | [Display(Name = "FormItemTemplateDisplayOrder")] 35 | public int DisplayOrder { get; set; } 36 | 37 | [Display(Name = "FormItemTemplateDisabled")] 38 | public bool Disabled { get; set; } 39 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormItemTemplate/index.css -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/CreateModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using Microsoft.AspNetCore.Mvc.Localization 3 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 4 | @using EasyAbp.DynamicForm.Localization 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.CreateModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/EditModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using EasyAbp.DynamicForm.Localization 3 | @using Microsoft.AspNetCore.Mvc.Localization 4 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.EditModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/EditModal.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Mvc; 4 | using EasyAbp.DynamicForm.FormTemplates; 5 | using EasyAbp.DynamicForm.FormTemplates.Dtos; 6 | using EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.ViewModels; 7 | 8 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate; 9 | 10 | public class EditModalModel : DynamicFormPageModel 11 | { 12 | [HiddenInput] 13 | [BindProperty(SupportsGet = true)] 14 | public Guid Id { get; set; } 15 | 16 | [BindProperty] 17 | public EditFormTemplateViewModel ViewModel { get; set; } 18 | 19 | private readonly IFormTemplateAppService _service; 20 | 21 | public EditModalModel(IFormTemplateAppService service) 22 | { 23 | _service = service; 24 | } 25 | 26 | public virtual async Task OnGetAsync() 27 | { 28 | var dto = await _service.GetAsync(Id); 29 | ViewModel = ObjectMapper.Map(dto); 30 | } 31 | 32 | public virtual async Task OnPostAsync() 33 | { 34 | var dto = ObjectMapper.Map(ViewModel); 35 | await _service.UpdateAsync(Id, dto); 36 | return NoContent(); 37 | } 38 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using System.ComponentModel.DataAnnotations; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 5 | 6 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate; 7 | 8 | public class IndexModel : DynamicFormPageModel 9 | { 10 | [BindProperty(SupportsGet = true)] 11 | public string FormDefinitionName { get; set; } 12 | 13 | [BindProperty(SupportsGet = true)] 14 | public string CustomTag { get; set; } 15 | 16 | public FormTemplateFilterInput FormTemplateFilter { get; set; } = new(); 17 | 18 | public virtual async Task OnGetAsync() 19 | { 20 | FormTemplateFilter.FormDefinitionName = FormDefinitionName; 21 | FormTemplateFilter.CustomTag = CustomTag; 22 | 23 | await Task.CompletedTask; 24 | } 25 | } 26 | 27 | public class FormTemplateFilterInput 28 | { 29 | [FormControlSize(AbpFormControlSize.Small)] 30 | [Display(Name = "FormTemplateFormDefinitionName")] 31 | public string FormDefinitionName { get; set; } 32 | 33 | [FormControlSize(AbpFormControlSize.Small)] 34 | [Display(Name = "FormTemplateName")] 35 | public string Name { get; set; } 36 | 37 | [FormControlSize(AbpFormControlSize.Small)] 38 | [Display(Name = "FormTemplateCustomTag")] 39 | public string CustomTag { get; set; } 40 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/ViewModels/CreateFormTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 3 | 4 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.ViewModels; 5 | 6 | public class CreateFormTemplateViewModel 7 | { 8 | [Display(Name = "FormTemplateFormDefinitionName")] 9 | [SelectItems("FormDefinitionNames")] 10 | public string FormDefinitionName { get; set; } 11 | 12 | [Display(Name = "FormTemplateName")] 13 | [Required] 14 | public string Name { get; set; } 15 | 16 | [Display(Name = "FormTemplateCustomTag")] 17 | public string CustomTag { get; set; } 18 | } 19 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/ViewModels/EditFormTemplateViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.FormTemplates.FormTemplate.ViewModels; 4 | 5 | public class EditFormTemplateViewModel 6 | { 7 | [Display(Name = "FormTemplateName")] 8 | [Required] 9 | public string Name { get; set; } 10 | } 11 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/FormTemplates/FormTemplate/index.css -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/CreateModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using Microsoft.AspNetCore.Mvc.Localization 3 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 4 | @using EasyAbp.DynamicForm.Localization 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form.CreateModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/EditModal.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using EasyAbp.DynamicForm.Localization 3 | @using Microsoft.AspNetCore.Mvc.Localization 4 | @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; 5 | @inject IHtmlLocalizer L 6 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form.EditModalModel 7 | @{ 8 | Layout = null; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using System.ComponentModel.DataAnnotations; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 6 | 7 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form; 8 | 9 | public class IndexModel : DynamicFormPageModel 10 | { 11 | [BindProperty(SupportsGet = true)] 12 | public Guid FormTemplateId { get; set; } 13 | 14 | public FormFilterInput FormFilter { get; set; } = new(); 15 | 16 | public virtual async Task OnGetAsync() 17 | { 18 | FormFilter.FormTemplateId = FormTemplateId; 19 | 20 | await Task.CompletedTask; 21 | } 22 | } 23 | 24 | public class FormFilterInput 25 | { 26 | [FormControlSize(AbpFormControlSize.Small)] 27 | [Display(Name = "FormFormDefinitionName")] 28 | public string FormDefinitionName { get; set; } 29 | 30 | [FormControlSize(AbpFormControlSize.Small)] 31 | [Display(Name = "FormFormTemplateId")] 32 | public Guid? FormTemplateId { get; set; } 33 | 34 | [FormControlSize(AbpFormControlSize.Small)] 35 | [Display(Name = "FormFormTemplateName")] 36 | public string FormTemplateName { get; set; } 37 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/ViewModels/CreateEditFormItemViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form.ViewModels; 2 | 3 | public class CreateEditFormItemViewModel 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Value { get; set; } 8 | } -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/ViewModels/CreateFormViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 5 | 6 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form.ViewModels; 7 | 8 | public class CreateFormViewModel 9 | { 10 | [HiddenInput] 11 | [Display(Name = "FormFormTemplateId")] 12 | public Guid FormTemplateId { get; set; } 13 | 14 | [Display(Name = "FormFormItemTemplates")] 15 | [TextArea(Rows = 10)] 16 | [DisabledInput] 17 | public string FormItemTemplates { get; set; } 18 | 19 | [Display(Name = "FormFormItems")] 20 | [TextArea(Rows = 10)] 21 | [Required] 22 | public string FormItems { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/ViewModels/EditFormViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; 3 | 4 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm.Forms.Form.ViewModels; 5 | 6 | public class EditFormViewModel 7 | { 8 | [Display(Name = "FormFormItemTemplates")] 9 | [TextArea(Rows = 10)] 10 | [DisabledInput] 11 | public string FormItemTemplates { get; set; } 12 | 13 | [Display(Name = "FormFormItems")] 14 | [TextArea(Rows = 10)] 15 | [Required] 16 | public string FormItems { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EasyAbp/DynamicForm/850f99a0b64e2e3ec01d12a3c7b3953b91fb3fc8/src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Forms/Form/index.css -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @using Microsoft.Extensions.Localization 3 | @using EasyAbp.DynamicForm.Localization 4 | @model EasyAbp.DynamicForm.Web.Pages.DynamicForm.IndexModel 5 | @inject IStringLocalizer L 6 | 7 | @{ 8 | } 9 |

DynamicForm

10 |

@L["SamplePageMessage"]

11 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicForm/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Web.Pages.DynamicForm; 2 | 3 | public class IndexModel : DynamicFormPageModel 4 | { 5 | public void OnGet() 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/DynamicFormPageModel.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Localization; 2 | using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; 3 | 4 | namespace EasyAbp.DynamicForm.Web.Pages; 5 | 6 | /* Inherit your PageModel classes from this class. 7 | */ 8 | public abstract class DynamicFormPageModel : AbpPageModel 9 | { 10 | protected DynamicFormPageModel() 11 | { 12 | LocalizationResourceType = typeof(DynamicFormResource); 13 | ObjectMapperContext = typeof(DynamicFormWebModule); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/EasyAbp.DynamicForm.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 2 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI 3 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap 4 | @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/DynamicFormApplicationTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | /* Inherit from this class for your application layer tests. 4 | * See SampleAppService_Tests for example. 5 | */ 6 | public abstract class DynamicFormApplicationTestBase : DynamicFormTestBase 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/DynamicFormApplicationTestModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Modularity; 2 | 3 | namespace EasyAbp.DynamicForm; 4 | 5 | [DependsOn( 6 | typeof(DynamicFormApplicationModule), 7 | typeof(DynamicFormDomainTestModule) 8 | )] 9 | public class DynamicFormApplicationTestModule : AbpModule 10 | { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/EasyAbp.DynamicForm.Application.Tests.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.test" 3 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/EasyAbp.DynamicForm.Application.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | EasyAbp.DynamicForm 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/FormTemplates/FormTemplateAppServiceTests.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormTemplates; 2 | 3 | public class FormTemplateAppServiceTests : DynamicFormApplicationTestBase 4 | { 5 | private readonly IFormTemplateAppService _formTemplateAppService; 6 | 7 | public FormTemplateAppServiceTests() 8 | { 9 | _formTemplateAppService = GetRequiredService(); 10 | } 11 | 12 | /* 13 | [Fact] 14 | public async Task Test1() 15 | { 16 | // Arrange 17 | 18 | // Act 19 | 20 | // Assert 21 | } 22 | */ 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Application.Tests/Forms/FormAppServiceTests.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.Forms; 2 | 3 | public class FormAppServiceTests : DynamicFormApplicationTestBase 4 | { 5 | private readonly IFormAppService _formAppService; 6 | 7 | public FormAppServiceTests() 8 | { 9 | _formAppService = GetRequiredService(); 10 | } 11 | 12 | /* 13 | [Fact] 14 | public async Task Test1() 15 | { 16 | // Arrange 17 | 18 | // Act 19 | 20 | // Assert 21 | } 22 | */ 23 | } 24 | 25 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/DynamicFormDomainTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm; 2 | 3 | /* Inherit from this class for your domain layer tests. 4 | * See SampleManager_Tests for example. 5 | */ 6 | public abstract class DynamicFormDomainTestBase : DynamicFormTestBase 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/DynamicFormDomainTestModule.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.EntityFrameworkCore; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | /* Domain tests are configured to use the EF Core provider. 7 | * You can switch to MongoDB, however your domain tests should be 8 | * database independent anyway. 9 | */ 10 | [DependsOn( 11 | typeof(DynamicFormEntityFrameworkCoreTestModule) 12 | )] 13 | public class DynamicFormDomainTestModule : AbpModule 14 | { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/EasyAbp.DynamicForm.Domain.Tests.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.test" 3 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/EasyAbp.DynamicForm.Domain.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | EasyAbp.DynamicForm 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/FormTemplates/FormTemplateDomainTests.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.FormTemplates; 2 | 3 | public class FormTemplateDomainTests : DynamicFormDomainTestBase 4 | { 5 | public FormTemplateDomainTests() 6 | { 7 | } 8 | 9 | /* 10 | [Fact] 11 | public async Task Test1() 12 | { 13 | // Arrange 14 | 15 | // Assert 16 | 17 | // Assert 18 | } 19 | */ 20 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.Domain.Tests/Forms/FormDomainTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using EasyAbp.DynamicForm.FormTemplates; 5 | using Shouldly; 6 | using Xunit; 7 | 8 | namespace EasyAbp.DynamicForm.Forms; 9 | 10 | public class FormDomainTests : DynamicFormDomainTestBase 11 | { 12 | private readonly IFormTemplateRepository _formTemplateRepository; 13 | private readonly FormManager _formManager; 14 | 15 | public FormDomainTests() 16 | { 17 | _formTemplateRepository = GetRequiredService(); 18 | _formManager = GetRequiredService(); 19 | } 20 | 21 | [Fact] 22 | public async Task Should_Create_Form() 23 | { 24 | await WithUnitOfWorkAsync(async () => 25 | { 26 | var creatingFormItems = FormItemTestHelper.CreateStandardFormItems(); 27 | 28 | var formTemplate = await _formTemplateRepository.GetAsync(DynamicFormTestConsts.FormTemplate1Id); 29 | var form = await _formManager.CreateAsync(formTemplate, creatingFormItems); 30 | 31 | form.FormItems.Count.ShouldBe(creatingFormItems.Count - 1); 32 | 33 | foreach (var creatingFormItem in creatingFormItems.Where(x => x.Name != "DisabledTextBox")) 34 | { 35 | form.FormItems.ShouldContain(x => x.Name == creatingFormItem.Name && x.Value == creatingFormItem.Value); 36 | } 37 | }); 38 | } 39 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/EasyAbp.DynamicForm.EntityFrameworkCore.Tests.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.test" 3 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/EasyAbp.DynamicForm.EntityFrameworkCore.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | EasyAbp.DynamicForm 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/EntityFrameworkCore/DynamicFormEntityFrameworkCoreTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.EntityFrameworkCore; 2 | 3 | /* This class can be used as a base class for EF Core integration tests, 4 | * while SampleRepository_Tests uses a different approach. 5 | */ 6 | public abstract class DynamicFormEntityFrameworkCoreTestBase : DynamicFormTestBase 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/EntityFrameworkCore/FormTemplates/FormTemplateRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.FormTemplates; 2 | 3 | namespace EasyAbp.DynamicForm.EntityFrameworkCore.FormTemplates; 4 | 5 | public class FormTemplateRepositoryTests : DynamicFormEntityFrameworkCoreTestBase 6 | { 7 | private readonly IFormTemplateRepository _formTemplateRepository; 8 | 9 | public FormTemplateRepositoryTests() 10 | { 11 | _formTemplateRepository = GetRequiredService(); 12 | } 13 | 14 | /* 15 | [Fact] 16 | public async Task Test1() 17 | { 18 | await WithUnitOfWorkAsync(async () => 19 | { 20 | // Arrange 21 | 22 | // Act 23 | 24 | //Assert 25 | }); 26 | } 27 | */ 28 | } 29 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/EntityFrameworkCore/Forms/FormRepositoryTests.cs: -------------------------------------------------------------------------------- 1 | using EasyAbp.DynamicForm.Forms; 2 | 3 | namespace EasyAbp.DynamicForm.EntityFrameworkCore.Forms; 4 | 5 | public class FormRepositoryTests : DynamicFormEntityFrameworkCoreTestBase 6 | { 7 | private readonly IFormRepository _formRepository; 8 | 9 | public FormRepositoryTests() 10 | { 11 | _formRepository = GetRequiredService(); 12 | } 13 | 14 | /* 15 | [Fact] 16 | public async Task Test1() 17 | { 18 | await WithUnitOfWorkAsync(async () => 19 | { 20 | // Arrange 21 | 22 | // Act 23 | 24 | //Assert 25 | }); 26 | } 27 | */ 28 | } 29 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.EntityFrameworkCore.Tests/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Volo.Abp; 7 | 8 | namespace EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp; 9 | 10 | public class ConsoleTestAppHostedService : IHostedService 11 | { 12 | private readonly IConfiguration _configuration; 13 | 14 | public ConsoleTestAppHostedService(IConfiguration configuration) 15 | { 16 | _configuration = configuration; 17 | } 18 | 19 | public async Task StartAsync(CancellationToken cancellationToken) 20 | { 21 | using (var application = await AbpApplicationFactory.CreateAsync(options => 22 | { 23 | options.Services.ReplaceConfiguration(_configuration); 24 | options.UseAutofac(); 25 | })) 26 | { 27 | await application.InitializeAsync(); 28 | 29 | var demo = application.ServiceProvider.GetRequiredService(); 30 | await demo.RunAsync(); 31 | 32 | await application.ShutdownAsync(); 33 | } 34 | } 35 | 36 | public Task StopAsync(CancellationToken cancellationToken) 37 | { 38 | return Task.CompletedTask; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/DynamicFormConsoleApiClientModule.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.Autofac; 2 | using Volo.Abp.Http.Client.IdentityModel; 3 | using Volo.Abp.Modularity; 4 | 5 | namespace EasyAbp.DynamicForm; 6 | 7 | [DependsOn( 8 | typeof(AbpAutofacModule), 9 | typeof(DynamicFormHttpApiClientModule), 10 | typeof(AbpHttpClientIdentityModelModule) 11 | )] 12 | public class DynamicFormConsoleApiClientModule : AbpModule 13 | { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp.abppkg: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | EasyAbp.DynamicForm 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | PreserveNewest 19 | Always 20 | 21 | 22 | 23 | PreserveNewest 24 | Always 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp; 6 | 7 | class Program 8 | { 9 | static async Task Main(string[] args) 10 | { 11 | await CreateHostBuilder(args).RunConsoleAsync(); 12 | } 13 | 14 | public static IHostBuilder CreateHostBuilder(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .AddAppSettingsSecretsJson() 17 | .ConfigureServices((hostContext, services) => 18 | { 19 | services.AddHostedService(); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "RemoteServices": { 3 | "Default": { 4 | "BaseUrl": "https://localhost:44313/" 5 | }, 6 | "DynamicForm": { 7 | "BaseUrl": "https://localhost:44341/" 8 | } 9 | }, 10 | "IdentityClients": { 11 | "Default": { 12 | "GrantType": "password", 13 | "ClientId": "DynamicForm_App", 14 | "ClientSecret": "1q2w3e*", 15 | "UserName": "admin", 16 | "UserPassword": "1q2w3E*", 17 | "Authority": "https://localhost:44313/", 18 | "Scope": "DynamicForm" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/EasyAbp.DynamicForm.MongoDB.Tests.abppkg: -------------------------------------------------------------------------------- 1 | { 2 | "role": "lib.test" 3 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/EasyAbp.DynamicForm.MongoDB.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | EasyAbp.DynamicForm 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/MongoDB/DynamicFormMongoDbTestBase.cs: -------------------------------------------------------------------------------- 1 | namespace EasyAbp.DynamicForm.MongoDB; 2 | 3 | /* This class can be used as a base class for MongoDB integration tests, 4 | * while SampleRepository_Tests uses a different approach. 5 | */ 6 | public abstract class DynamicFormMongoDbTestBase : DynamicFormTestBase 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/MongoDB/DynamicFormMongoDbTestModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Data; 3 | using Volo.Abp.Modularity; 4 | 5 | namespace EasyAbp.DynamicForm.MongoDB; 6 | 7 | [DependsOn( 8 | typeof(DynamicFormTestBaseModule), 9 | typeof(DynamicFormMongoDbModule) 10 | )] 11 | public class DynamicFormMongoDbTestModule : AbpModule 12 | { 13 | public override void ConfigureServices(ServiceConfigurationContext context) 14 | { 15 | Configure(options => 16 | { 17 | options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/MongoDB/MongoDbFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EphemeralMongo; 3 | 4 | namespace EasyAbp.DynamicForm.MongoDB; 5 | 6 | public class MongoDbFixture : IDisposable 7 | { 8 | public readonly static IMongoRunner MongoDbRunner; 9 | 10 | static MongoDbFixture() 11 | { 12 | MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions 13 | { 14 | UseSingleNodeReplicaSet = true 15 | }); 16 | } 17 | 18 | public static string GetRandomConnectionString() 19 | { 20 | return GetConnectionString("Db_" + Guid.NewGuid().ToString("N")); 21 | } 22 | 23 | public static string GetConnectionString(string databaseName) 24 | { 25 | var stringArray = MongoDbRunner.ConnectionString.Split('?'); 26 | var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1]; 27 | return connectionString; 28 | } 29 | 30 | public void Dispose() 31 | { 32 | MongoDbRunner?.Dispose(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.MongoDB.Tests/MongoDB/MongoTestCollection.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace EasyAbp.DynamicForm.MongoDB; 4 | 5 | [CollectionDefinition(Name)] 6 | public class MongoTestCollection : ICollectionFixture 7 | { 8 | public const string Name = "MongoDB Collection"; 9 | } 10 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/BookRentalRequests/BookRentalRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Volo.Abp.Domain.Entities; 4 | 5 | namespace EasyAbp.DynamicForm.BookRentalRequests; 6 | 7 | public class BookRentalRequest : AggregateRoot 8 | { 9 | public Guid BookRentalId { get; set; } 10 | 11 | public Guid RenterUserId { get; set; } 12 | 13 | public List FormItems { get; set; } = new(); 14 | 15 | protected BookRentalRequest() 16 | { 17 | } 18 | 19 | public BookRentalRequest(Guid id, Guid bookRentalId, Guid renterUserId) : base(id) 20 | { 21 | BookRentalId = bookRentalId; 22 | RenterUserId = renterUserId; 23 | } 24 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/BookRentalRequests/BookRentalRequestFormItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Forms; 3 | using Volo.Abp.Domain.Entities; 4 | 5 | namespace EasyAbp.DynamicForm.BookRentalRequests; 6 | 7 | public class BookRentalRequestFormItem : Entity, IFormItem 8 | { 9 | public Guid BookRentalRequestId { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string Value { get; set; } 14 | 15 | public override object[] GetKeys() 16 | { 17 | return new object[] { BookRentalRequestId, Name }; 18 | } 19 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/BookRentals/BookRental.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Volo.Abp.Domain.Entities; 4 | 5 | namespace EasyAbp.DynamicForm.BookRentals; 6 | 7 | public class BookRental : AggregateRoot 8 | { 9 | public string BookName { get; set; } 10 | 11 | public List FormItems { get; set; } = new(); 12 | 13 | protected BookRental() 14 | { 15 | } 16 | 17 | public BookRental(Guid id, string bookName) : base(id) 18 | { 19 | BookName = bookName; 20 | } 21 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/BookRentals/BookRentalFormItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EasyAbp.DynamicForm.Shared; 3 | using Volo.Abp.Domain.Entities; 4 | 5 | namespace EasyAbp.DynamicForm.BookRentals; 6 | 7 | public class BookRentalFormItem : Entity, IFormItemMetadata 8 | { 9 | public Guid BookRentalId { get; set; } 10 | 11 | public string Name { get; set; } = null!; 12 | 13 | public string Group { get; set; } 14 | 15 | public string InfoText { get; set; } 16 | 17 | public string Type { get; set; } = null!; 18 | 19 | public bool Optional { get; set; } 20 | 21 | public string Configurations { get; set; } 22 | 23 | public int DisplayOrder { get; set; } 24 | 25 | public bool Disabled { get; set; } 26 | 27 | public AvailableValues AvailableValues { get; set; } 28 | 29 | public override object[] GetKeys() 30 | { 31 | return new object[] { BookRentalId, Name }; 32 | } 33 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/DynamicFormTestConsts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace EasyAbp.DynamicForm; 4 | 5 | public static class DynamicFormTestConsts 6 | { 7 | public static Guid User1Id { get; } = Guid.NewGuid(); 8 | 9 | public static string TestFormDefinitionName => "InternalForm"; 10 | 11 | public static string TestFormDefinitionDisplayName => "Internal Form"; 12 | 13 | public static Guid FormTemplate1Id { get; } = Guid.NewGuid(); 14 | 15 | public static string FormTemplate1Name => "Leave Application"; 16 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/EasyAbp.DynamicForm.TestBase.abppkg: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/EasyAbp.DynamicForm.TestBase.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | EasyAbp.DynamicForm 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/FormItemTestHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EasyAbp.DynamicForm.Forms; 3 | 4 | namespace EasyAbp.DynamicForm; 5 | 6 | public static class FormItemTestHelper 7 | { 8 | public static List CreateStandardFormItems() 9 | { 10 | return new List 11 | { 12 | new("Name", "John"), 13 | new("DisabledTextBox", ""), // this item is NOT optional, but disabled 14 | new("Dept", "Dept 2"), 15 | new("Gender", "Male"), 16 | new("Requirements", "Use annual leave,Urgent"), 17 | new("Images", "[\"https://my-fake-site1.com/1.png\", \"https://my-fake-site1.com/2.png\"]"), 18 | new("Score", "100.1"), 19 | new("VIP", "false"), 20 | new("Color", "#FFAABBCC"), 21 | new("Birthday", "2024-08-21"), 22 | }; 23 | } 24 | } -------------------------------------------------------------------------------- /test/EasyAbp.DynamicForm.TestBase/Security/FakeCurrentPrincipalAccessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Security.Claims; 3 | using Volo.Abp.DependencyInjection; 4 | using Volo.Abp.Security.Claims; 5 | 6 | namespace EasyAbp.DynamicForm.Security; 7 | 8 | [Dependency(ReplaceServices = true)] 9 | public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor 10 | { 11 | protected override ClaimsPrincipal GetClaimsPrincipal() 12 | { 13 | return GetPrincipal(); 14 | } 15 | 16 | private ClaimsPrincipal _principal; 17 | 18 | private ClaimsPrincipal GetPrincipal() 19 | { 20 | if (_principal == null) 21 | { 22 | lock (this) 23 | { 24 | if (_principal == null) 25 | { 26 | _principal = new ClaimsPrincipal( 27 | new ClaimsIdentity( 28 | new List 29 | { 30 | new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), 31 | new Claim(AbpClaimTypes.UserName,"admin"), 32 | new Claim(AbpClaimTypes.Email,"admin@abp.io") 33 | } 34 | ) 35 | ); 36 | } 37 | } 38 | } 39 | 40 | return _principal; 41 | } 42 | } 43 | --------------------------------------------------------------------------------