├── src ├── Serenity.Extensions │ ├── wwwroot │ │ └── index.css │ ├── .npmrc │ ├── sergen.json │ ├── Areas │ │ └── Serenity.Extensions │ │ │ ├── _ViewStart.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ ├── ModulePage │ │ │ └── ModulePage.cshtml │ │ │ └── Membership │ │ │ └── PasswordActions │ │ │ └── ResetPasswordEmail.cshtml │ ├── Modules │ │ ├── ServerTypes │ │ │ ├── Reporting.ts │ │ │ ├── RemoteDataKeys.ts │ │ │ ├── Extensions │ │ │ │ ├── TranslateTextInput.ts │ │ │ │ ├── TranslateTextOutput.ts │ │ │ │ ├── ExcelImportRequest.ts │ │ │ │ ├── ForgotPasswordRequest.ts │ │ │ │ ├── ResetPasswordResponse.ts │ │ │ │ ├── SendResetPasswordResponse.ts │ │ │ │ ├── TranslationUpdateResponse.ts │ │ │ │ ├── UserPreferenceRetrieveResponse.ts │ │ │ │ ├── GetNextNumberRequest.ts │ │ │ │ ├── GetNextNumberResponse.ts │ │ │ │ ├── TranslationListRequest.ts │ │ │ │ ├── UserPreferenceRetrieveRequest.ts │ │ │ │ ├── ExcelImportResponse.ts │ │ │ │ ├── TranslationItem.ts │ │ │ │ ├── ResetPasswordRequest.ts │ │ │ │ ├── TranslationUpdateRequest.ts │ │ │ │ ├── ChangePasswordRequest.ts │ │ │ │ ├── PasswordStrengthRules.ts │ │ │ │ ├── UserPreferenceUpdateRequest.ts │ │ │ │ ├── TranslateTextResponse.ts │ │ │ │ ├── TranslationListResponse.ts │ │ │ │ ├── TranslateTextRequest.ts │ │ │ │ ├── ForgotPasswordForm.ts │ │ │ │ ├── UserPreferenceRow.ts │ │ │ │ ├── ResetPasswordForm.ts │ │ │ │ └── ChangePasswordForm.ts │ │ │ └── Reporting │ │ │ │ └── ReportRetrieveResult.ts │ │ ├── EmailSender │ │ │ ├── IEmailQueue.cs │ │ │ ├── IEmailSender.cs │ │ │ ├── EmailSenderExtensions.cs │ │ │ └── SmtpSettings.cs │ │ ├── MigrationUtils │ │ │ ├── TargetDBAttribute.cs │ │ │ ├── DefaultDBAttribute.cs │ │ │ ├── MigrationKeyAttribute.cs │ │ │ └── MigrationAttributeBase.cs │ │ ├── Reporting │ │ │ ├── Tree │ │ │ │ ├── IReportTreeFactory.cs │ │ │ │ ├── ReportRetrieveResult.cs │ │ │ │ └── DefaultReportTreeFactory.cs │ │ │ └── DataReport │ │ │ │ └── DataReportExcelRenderer.cs │ │ ├── Translation │ │ │ ├── TranslationUpdateResponse.cs │ │ │ ├── ITranslateTextHandler.cs │ │ │ ├── TranslationListRequest.cs │ │ │ ├── TranslationListResponse.cs │ │ │ ├── TranslationUpdateRequest.cs │ │ │ ├── BaseTranslationOptions.cs │ │ │ ├── TranslationItem.cs │ │ │ ├── TranslateTextResponse.cs │ │ │ └── TranslateTextRequest.cs │ │ ├── GetNextNumber │ │ │ ├── GetNextNumberRequest.cs │ │ │ └── GetNextNumberResponse.cs │ │ ├── Membership │ │ │ ├── PasswordActions │ │ │ │ ├── ResetPasswordResponse.cs │ │ │ │ ├── SendResetPasswordResponse.cs │ │ │ │ ├── ResetPasswordEmailModel.cs │ │ │ │ ├── ForgotPasswordRequest.cs │ │ │ │ ├── ChangePasswordFormTexts.cs │ │ │ │ ├── ResetPasswordFormTexts.cs │ │ │ │ ├── ResetPasswordRequest.cs │ │ │ │ ├── ChangePasswordRequest.cs │ │ │ │ ├── ForgotPasswordFormTexts.cs │ │ │ │ └── SetPasswordPageTexts.cs │ │ │ ├── AccountPanelTitle.tsx │ │ │ ├── PasswordStrength │ │ │ │ ├── PasswordStrengthRules.cs │ │ │ │ └── PasswordStrengthValidationTexts.cs │ │ │ └── MembershipSettings.cs │ │ ├── ModulePage │ │ │ ├── ModulePageResult.cs │ │ │ └── ModulePageModel.cs │ │ ├── BulkActions │ │ │ ├── BasicProgressDialogTexts.cs │ │ │ └── BulkServiceActionTexts.cs │ │ ├── ExportImport │ │ │ └── ExcelImportRequest.cs │ │ ├── Widgets │ │ │ ├── DialogUtilsTexts.cs │ │ │ └── SelectableEntityGrid.ts │ │ ├── UserPreference │ │ │ ├── UserPreferenceModels.cs │ │ │ ├── UserPreferenceEndpoint.cs │ │ │ └── UserPreferenceStorage.ts │ │ ├── Elevation │ │ │ └── IElevationHandler.cs │ │ ├── Formatters │ │ │ └── SingleLineTextFormatter.ts │ │ ├── ClamAV │ │ │ └── ClamAVSettings.cs │ │ └── index.ts │ ├── jest.config.js │ ├── Imports │ │ ├── ClientTypes │ │ │ ├── Extensions.ResetPasswordOptions.generated.cs │ │ │ ├── Extensions.SingleLineTextFormatterAttribute.cs │ │ │ ├── Extensions.EnumSelectFormatterAttribute.cs │ │ │ └── Extensions.StaticTextBlockAttribute.cs │ │ └── MVC │ │ │ └── MVC.cs │ ├── tsconfig.json │ ├── test │ │ └── tsconfig.json │ ├── package.json │ ├── Serenity.Extensions.csproj │ ├── tsconfig.base.json │ ├── tsbuild.js │ └── texts │ │ └── ExtensionsTexts.cs ├── Serenity.Demo.Northwind │ ├── .npmrc │ ├── sergen.json │ ├── Areas │ │ └── Serenity.Demo.Northwind │ │ │ ├── _ViewStart.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ ├── Product │ │ │ └── ProductIndex.cshtml │ │ │ └── Order │ │ │ └── OrderIndex.cshtml │ ├── Modules │ │ ├── Customer │ │ │ ├── CustomerDialog.css │ │ │ ├── CustomerPage.ts │ │ │ ├── CustomerLookup.cs │ │ │ ├── CustomerOrderDialog.ts │ │ │ ├── CustomerPage.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── CustomerDeleteHandler.cs │ │ │ │ ├── CustomerListHandler.cs │ │ │ │ ├── CustomerSaveHandler.cs │ │ │ │ ├── CustomerRetrieveHandler.cs │ │ │ │ └── CustomerGetNextNumberHandler.cs │ │ │ ├── CustomerGrid.ts │ │ │ ├── CustomerEditor.ts │ │ │ ├── CustomerCountryLookup.cs │ │ │ └── CustomerCityLookup.cs │ │ ├── OrderDetail │ │ │ ├── OrderDetailDialog.css │ │ │ ├── OrderDetailForm.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── OrderDetailDeleteHandler.cs │ │ │ │ ├── OrderDetailListHandler.cs │ │ │ │ ├── OrderDetailSaveHandler.cs │ │ │ │ └── OrderDetailRetrieveHandler.cs │ │ │ ├── OrderDetailColumns.cs │ │ │ └── OrderDetailEndpoint.cs │ │ ├── Order │ │ │ ├── OrderGrid.css │ │ │ ├── OrderDialog.css │ │ │ ├── OrderListRequest.cs │ │ │ ├── OrderShippingState.cs │ │ │ ├── OrderPage.cs │ │ │ ├── OrderPage.ts │ │ │ ├── RequestHandlers │ │ │ │ ├── OrderDeleteHandler.cs │ │ │ │ ├── OrderSaveHandler.cs │ │ │ │ └── OrderRetrieveHandler.cs │ │ │ ├── FreightFormatter.ts │ │ │ ├── OrderShipCountryLookup.cs │ │ │ ├── OrderRowAnnotations.cs │ │ │ └── OrderShipCityLookup.cs │ │ ├── Employee │ │ │ └── Gender.cs │ │ ├── Product │ │ │ ├── ProductDialog.css │ │ │ ├── ProductPage.ts │ │ │ ├── ProductGrid.css │ │ │ ├── ProductPage.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── ProductDeleteHandler.cs │ │ │ │ ├── ProductListHandler.cs │ │ │ │ ├── ProductSaveHandler.cs │ │ │ │ └── ProductRetrieveHandler.cs │ │ │ ├── ProductDialog.ts │ │ │ └── ProductForm.cs │ │ ├── Region │ │ │ ├── RegionPage.ts │ │ │ ├── RegionForm.cs │ │ │ ├── RegionPage.cs │ │ │ ├── RegionColumns.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── RegionDeleteHandler.cs │ │ │ │ ├── RegionListHandler.cs │ │ │ │ ├── RegionSaveHandler.cs │ │ │ │ └── RegionRetrieveHandler.cs │ │ │ ├── RegionDialog.ts │ │ │ ├── RegionGrid.ts │ │ │ └── RegionRow.cs │ │ ├── Shipper │ │ │ ├── ShipperPage.ts │ │ │ ├── ShipperForm.cs │ │ │ ├── ShipperPage.cs │ │ │ ├── ShipperColumns.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── ShipperDeleteHandler.cs │ │ │ │ ├── ShipperListHandler.cs │ │ │ │ ├── ShipperSaveHandler.cs │ │ │ │ └── ShipperRetrieveHandler.cs │ │ │ ├── ShipperDialog.ts │ │ │ ├── ShipperGrid.ts │ │ │ └── ShipperFormatter.tsx │ │ ├── Category │ │ │ ├── CategoryPage.ts │ │ │ ├── CategoryForm.cs │ │ │ ├── CategoryPage.cs │ │ │ ├── CategoryColumns.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── CategoryDeleteHandler.cs │ │ │ │ ├── CategoryListHandler.cs │ │ │ │ ├── CategorySaveHandler.cs │ │ │ │ └── CategoryRetrieveHandler.cs │ │ │ ├── CategoryDialog.ts │ │ │ └── CategoryGrid.ts │ │ ├── Supplier │ │ │ ├── SupplierPage.ts │ │ │ ├── SupplierPage.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── SupplierDeleteHandler.cs │ │ │ │ ├── SupplierListHandler.cs │ │ │ │ ├── SupplierSaveHandler.cs │ │ │ │ └── SupplierRetrieveHandler.cs │ │ │ ├── SupplierDialog.ts │ │ │ ├── SupplierGrid.ts │ │ │ ├── SupplierForm.cs │ │ │ ├── SupplierCountryLookup.cs │ │ │ └── SupplierColumns.cs │ │ ├── Territory │ │ │ ├── TerritoryPage.ts │ │ │ ├── TerritoryPage.cs │ │ │ ├── TerritoryForm.cs │ │ │ ├── RequestHandlers │ │ │ │ ├── TerritoryDeleteHandler.cs │ │ │ │ ├── TerritoryListHandler.cs │ │ │ │ ├── TerritorySaveHandler.cs │ │ │ │ └── TerritoryRetrieveHandler.cs │ │ │ ├── TerritoryDialog.ts │ │ │ ├── TerritoryColumns.cs │ │ │ └── TerritoryGrid.ts │ │ ├── ServerTypes │ │ │ └── Demo │ │ │ │ ├── Northwind.OrderListRequest.ts │ │ │ │ ├── Northwind.Gender.ts │ │ │ │ ├── Northwind.OrderShippingState.ts │ │ │ │ ├── Northwind.PermissionKeys.ts │ │ │ │ ├── Northwind.RegionColumns.ts │ │ │ │ ├── Northwind.ShipperColumns.ts │ │ │ │ ├── Northwind.CategoryColumns.ts │ │ │ │ ├── Northwind.TerritoryColumns.ts │ │ │ │ ├── Northwind.SalesByCategoryColumns.ts │ │ │ │ ├── Northwind.OrderDetailColumns.ts │ │ │ │ ├── Northwind.CategoryForm.ts │ │ │ │ ├── Northwind.SalesByCategoryRow.ts │ │ │ │ ├── Northwind.SupplierColumns.ts │ │ │ │ ├── Northwind.ProductLangRow.ts │ │ │ │ ├── Northwind.CustomerDemographicRow.ts │ │ │ │ ├── Northwind.CustomerRepresentativesRow.ts │ │ │ │ ├── Northwind.CustomerGrossSalesRow.ts │ │ │ │ ├── Northwind.CategoryLangRow.ts │ │ │ │ ├── Northwind.RegionForm.ts │ │ │ │ ├── Northwind.CustomerCustomerDemoRow.ts │ │ │ │ ├── Northwind.EmployeeTerritoryRow.ts │ │ │ │ ├── Northwind.NoteRow.ts │ │ │ │ ├── Northwind.ShipperForm.ts │ │ │ │ ├── Northwind.CustomerDetailsRow.ts │ │ │ │ ├── Northwind.ProductColumns.ts │ │ │ │ ├── Northwind.SalesByCategoryService.ts │ │ │ │ ├── Northwind.TerritoryForm.ts │ │ │ │ ├── Northwind.OrderDetailRow.ts │ │ │ │ ├── Northwind.OrderDetailForm.ts │ │ │ │ ├── Northwind.RegionRow.ts │ │ │ │ └── Northwind.CustomerColumns.ts │ │ ├── Note │ │ │ └── RequestHandlers │ │ │ │ ├── NoteDeleteHandler.cs │ │ │ │ ├── NoteListHandler.cs │ │ │ │ ├── NoteSaveHandler.cs │ │ │ │ └── NoteRetrieveHandler.cs │ │ ├── ProductLang │ │ │ └── RequestHandlers │ │ │ │ ├── ProductLangDeleteHandler.cs │ │ │ │ ├── ProductLangListHandler.cs │ │ │ │ ├── ProductLangSaveHandler.cs │ │ │ │ └── ProductLangRetrieveHandler.cs │ │ ├── SalesByCategory │ │ │ ├── SalesByCategoryColumns.cs │ │ │ ├── RequestHandlers │ │ │ │ └── SalesByCategoryListHandler.cs │ │ │ └── SalesByCategoryEndpoint.cs │ │ ├── CategoryLang │ │ │ └── RequestHandlers │ │ │ │ ├── CategoryLangDeleteHandler.cs │ │ │ │ ├── CategoryLangListHandler.cs │ │ │ │ ├── CategoryLangSaveHandler.cs │ │ │ │ └── CategoryLangRetrieveHandler.cs │ │ ├── Shared │ │ │ └── NorthwindPermissionKeys.cs │ │ └── Reports │ │ │ ├── GoogleSearchReport.cs │ │ │ └── ReportsPage.cs │ ├── jest.config.js │ ├── Migrations │ │ ├── NorthwindDBAttribute.cs │ │ ├── NorthwindDB_20161118_1954_DragDropSample.cs │ │ ├── NorthwindDB_20160121_1412_CustomerRepresentatives.cs │ │ ├── NorthwindDB_20151226_1845_Notes.cs │ │ ├── NorthwindDB_20161013_0025_CustomerDetails.cs │ │ ├── NorthwindDB_20160216_1549_DataLocalization.cs │ │ ├── NorthwindDB_20161126_1417_ForwardDates.cs │ │ └── NorthwindDB_20151014_0307_OrderDetailID.cs │ ├── tsconfig.json │ ├── test │ │ ├── tsconfig.json │ │ └── note │ │ │ └── notedialog.spec.tsx │ ├── Imports │ │ ├── ClientTypes │ │ │ ├── Demo.Northwind.NotesEditorAttribute.cs │ │ │ ├── Demo.Northwind.CustomerEditorAttribute.cs │ │ │ ├── Demo.Northwind.FreightFormatterAttribute.cs │ │ │ ├── Demo.Northwind.ShipperFormatterAttribute.cs │ │ │ ├── Demo.Northwind.OrderDetailsEditorAttribute.cs │ │ │ ├── Demo.Northwind.EmployeeListFormatterAttribute.cs │ │ │ ├── Demo.Northwind.PhoneEditorAttribute.cs │ │ │ └── Demo.Northwind.EmployeeFormatterAttribute.cs │ │ └── MVC │ │ │ └── MVC.cs │ ├── tsbuild.js │ ├── texts │ │ └── NorthwindTexts.cs │ ├── Serenity.Demo.Northwind.csproj │ └── package.json ├── Serenity.Demo.BasicSamples │ ├── .npmrc │ ├── Modules │ │ ├── ServerTypes │ │ │ ├── Texts.ts │ │ │ ├── Demo │ │ │ │ ├── BasicSamples.OrdersByShipperRequest.ts │ │ │ │ ├── BasicSamples.OrdersByShipperResponse.ts │ │ │ │ ├── BasicSamples.InlineImageInGridColumns.ts │ │ │ │ ├── BasicSamples.HardcodedValuesForm.ts │ │ │ │ └── BasicSamples.BasicSamplesService.ts │ │ │ └── Demo.ts │ │ ├── BasicSamplesNavigation.cs │ │ ├── Dialogs │ │ │ ├── CloneableEntityDialog │ │ │ │ └── CloneableEntityDialogPage.css │ │ │ ├── ChartInDialog │ │ │ │ └── ChartInDialogPage.css │ │ │ └── EntityDialogAsPanel │ │ │ │ └── EntityDialogAsPanelPage.css │ │ ├── Editors │ │ │ ├── LookupFilterByMultipleValues │ │ │ │ ├── LookupFilterByMultipleValuesPage.css │ │ │ │ └── LookupFilterByMultipleForm.cs │ │ │ ├── SelectWithHardcodedValues │ │ │ │ └── HardcodedValuesForm.cs │ │ │ ├── ChangingLookupText │ │ │ │ └── ChangingLookupTextForm.cs │ │ │ ├── FilteredLookupInDetail │ │ │ │ └── FilteredLookupInDetailPage.css │ │ │ ├── BasicSamplesNavigation.Editors.cs │ │ │ └── StaticTextBlock │ │ │ │ └── StaticTextBlockForm.cs │ │ ├── Grids │ │ │ ├── WrappedHeaders │ │ │ │ ├── WrappedHeadersPage.css │ │ │ │ └── WrappedHeadersPage.ts │ │ │ ├── InlineImageInGrid │ │ │ │ └── InlineImageInGridColumns.cs │ │ │ └── EnablingRowSelection │ │ │ │ └── EnablingRowSelectionPage.ts │ │ ├── BasicSamplesPage.cs │ │ └── BasicSamplesModels.cs │ ├── sergen.json │ ├── jest.config.js │ ├── tsbuild.js │ ├── Areas │ │ └── Serenity.Demo.BasicSamples │ │ │ ├── _ViewStart.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ ├── Dialogs │ │ │ ├── DialogBoxes │ │ │ │ └── Index.cshtml │ │ │ ├── ReadOnlyDialog │ │ │ │ └── Index.cshtml │ │ │ ├── ChartInDialog │ │ │ │ └── Index.cshtml │ │ │ └── OtherFormInTab │ │ │ │ └── Index.cshtml │ │ │ └── Grids │ │ │ ├── InlineActionButtons │ │ │ └── Index.cshtml │ │ │ ├── InlineImageInGrid │ │ │ └── Index.cshtml │ │ │ ├── InitialValuesForQuickFilters │ │ │ └── Index.cshtml │ │ │ └── RemovingAddButton │ │ │ └── Index.cshtml │ ├── tsconfig.json │ ├── test │ │ └── tsconfig.json │ ├── Imports │ │ └── ClientTypes │ │ │ ├── Demo.BasicSamples.HardcodedValuesEditorAttribute.cs │ │ │ ├── Demo.BasicSamples.ChangingLookupTextEditorAttribute.cs │ │ │ ├── Demo.BasicSamples.FilteredLookupDetailEditorAttribute.cs │ │ │ ├── Demo.BasicSamples.ProduceSeafoodCategoryEditorAttribute.cs │ │ │ ├── Demo.BasicSamples.FilteredLookupDetailEditor.HardcodedValuesEditorAttribute.cs │ │ │ └── Demo.BasicSamples.InlineImageFormatterAttribute.cs │ ├── Serenity.Demo.BasicSamples.csproj │ ├── package.json │ └── wwwroot │ │ └── index.css ├── .config │ ├── dotnet-tools.json │ └── sergen.base.json ├── Directory.Build.props ├── .editorconfig └── Directory.Build.targets ├── pnpm-workspace.yaml ├── .gitattributes ├── README.md ├── .gitignore ├── package.json └── .github └── ISSUE_TEMPLATE ├── feature-request.md └── bug-report.md /src/Serenity.Extensions/wwwroot/index.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/.npmrc: -------------------------------------------------------------------------------- 1 | install-links=false -------------------------------------------------------------------------------- /src/Serenity.Extensions/.npmrc: -------------------------------------------------------------------------------- 1 | install-links=false -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/.npmrc: -------------------------------------------------------------------------------- 1 | install-links=false -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'src/Serenity.*' 3 | - 'tests/Serenity.*' -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Texts.ts: -------------------------------------------------------------------------------- 1 | export const Texts = {} as const; -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/sergen.json: -------------------------------------------------------------------------------- 1 | { 2 | "Extends": "../.config/sergen.base.json" 3 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/sergen.json: -------------------------------------------------------------------------------- 1 | { 2 | "Extends": "../.config/sergen.base.json" 3 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/sergen.json: -------------------------------------------------------------------------------- 1 | { 2 | "Extends": "../.config/sergen.base.json" 3 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Areas/Serenity.Extensions/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Reporting.ts: -------------------------------------------------------------------------------- 1 | export * from "./Reporting/ReportRetrieveResult" 2 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.cmd -text 3 | *.sln -text 4 | *.d.ts -text 5 | **/wwwroot/**/* -text 6 | **/dist/**/* -text 7 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerDialog.css: -------------------------------------------------------------------------------- 1 | .s-Demo-Northwind-CustomerDialog .s-NotesEditor { 2 | flex: 1 1 auto; 3 | } 4 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/OrderDetailDialog.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-Northwind-OrderDetailDialog .caption { 3 | width: 80px; 4 | } 5 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/jest.config.js: -------------------------------------------------------------------------------- 1 | import jestDefaults from "test-utils/jest-defaults.js"; 2 | 3 | export default { 4 | ...jestDefaults() 5 | }; -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/jest.config.js: -------------------------------------------------------------------------------- 1 | import jestDefaults from "test-utils/jest-defaults.js"; 2 | 3 | export default { 4 | ...jestDefaults() 5 | }; -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/jest.config.js: -------------------------------------------------------------------------------- 1 | import jestDefaults from "test-utils/jest-defaults.js"; 2 | 3 | export default { 4 | ...jestDefaults() 5 | }; -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderGrid.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-Northwind-OrderGrid .s-CustomerEditor { 3 | min-width: 250px; 4 | width: 250px; 5 | } 6 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/BasicSamplesNavigation.cs: -------------------------------------------------------------------------------- 1 | using Serenity.Navigation; 2 | 3 | [assembly: NavigationMenu(7900, "Basic Samples", icon: "fa-magic")] 4 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Employee/Gender.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Serenity.Demo.Northwind; 3 | 4 | public enum Gender 5 | { 6 | Male = 1, 7 | Female = 2 8 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/RemoteDataKeys.ts: -------------------------------------------------------------------------------- 1 | export namespace RemoteDataKeys { 2 | export const PasswordStrengthRules = "PasswordStrengthRules"; 3 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/tsbuild.js: -------------------------------------------------------------------------------- 1 | import { build } from "@serenity-is/tsbuild"; 2 | 3 | // wwwroot/esm/**/*.js: ESM entry points for own pages 4 | await build({ 5 | }); -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | @Html.Stylesheet("~/Serenity.Demo.BasicSamples/index.css") -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderDialog.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-Northwind-OrderDialog .caption, 3 | .s-Demo-Northwind-CustomerOrderDialog .caption { 4 | width: 130px; 5 | } 6 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderListRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public class OrderListRequest : ListRequest 4 | { 5 | public int? ProductID { get; set; } 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/EmailSender/IEmailQueue.cs: -------------------------------------------------------------------------------- 1 | using MimeKit; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public interface IEmailQueue 6 | { 7 | void Enqueue(MimeMessage message); 8 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductDialog.css: -------------------------------------------------------------------------------- 1 | .s-Demo-Northwind-ProductDialog > .size { 2 | width: 650px; 3 | } 4 | 5 | .s-Demo-Northwind-ProductDialog .caption { 6 | width: 180px; 7 | } 8 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { RegionGrid } from "./RegionGrid"; 3 | 4 | export default () => gridPageInit(RegionGrid); -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { ProductGrid } from "./ProductGrid"; 3 | 4 | export default () => gridPageInit(ProductGrid); -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { ShipperGrid } from "./ShipperGrid"; 3 | 4 | export default () => gridPageInit(ShipperGrid); -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/MigrationUtils/TargetDBAttribute.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public class TargetDBAttribute(string db) : TagsAttribute(db + "DB") 6 | { 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Reporting/Tree/IReportTreeFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Reporting; 2 | 3 | public interface IReportTreeFactory 4 | { 5 | public ReportTree BuildReportTree(string category); 6 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { CategoryGrid } from "./CategoryGrid"; 3 | 4 | export default () => gridPageInit(CategoryGrid); -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { CustomerGrid } from "./CustomerGrid"; 3 | 4 | export default () => gridPageInit(CustomerGrid); -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { SupplierGrid } from "./SupplierGrid"; 3 | 4 | export default () => gridPageInit(SupplierGrid); -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslateTextInput.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TranslateTextInput { 3 | TextKey?: string; 4 | TargetLanguageID?: string; 5 | SourceText?: string; 6 | } 7 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo/BasicSamples.OrdersByShipperRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface OrdersByShipperRequest extends ServiceRequest { 4 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit } from "@serenity-is/corelib"; 2 | import { TerritoryGrid } from "./TerritoryGrid"; 3 | 4 | export default () => gridPageInit(TerritoryGrid); -------------------------------------------------------------------------------- /src/Serenity.Extensions/Areas/Serenity.Extensions/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Serenity 2 | @using Serenity.Web 3 | @using Microsoft.AspNetCore.Html 4 | @using System.Text; 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/EmailSender/IEmailSender.cs: -------------------------------------------------------------------------------- 1 | using MimeKit; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public interface IEmailSender 6 | { 7 | void Send(MimeMessage message, bool skipQueue = false); 8 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslateTextOutput.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TranslateTextOutput { 3 | TextKey?: string; 4 | TargetLanguageID?: string; 5 | TranslatedText?: string; 6 | } 7 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslationUpdateResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslationUpdateResponse : ServiceResponse 4 | { 5 | public string SavedPath { get; set; } 6 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.OrderListRequest.ts: -------------------------------------------------------------------------------- 1 | import { ListRequest } from "@serenity-is/corelib"; 2 | 3 | export interface OrderListRequest extends ListRequest { 4 | ProductID?: number; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ExcelImportRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface ExcelImportRequest extends ServiceRequest { 4 | FileName?: string; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/ITranslateTextHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public interface ITranslateTextHandler 4 | { 5 | TranslateTextResponse Translate(TranslateTextRequest request); 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ForgotPasswordRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface ForgotPasswordRequest extends ServiceRequest { 4 | Email?: string; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ResetPasswordResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface ResetPasswordResponse extends ServiceResponse { 4 | RedirectHome?: boolean; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/SendResetPasswordResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface SendResetPasswordResponse extends ServiceResponse { 4 | DemoLink?: string; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslationUpdateResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface TranslationUpdateResponse extends ServiceResponse { 4 | SavedPath?: string; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenity-is/extensions/tsconfig.base.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "outDir": "./out" 6 | }, 7 | "include": [ 8 | "Modules" 9 | ] 10 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/GetNextNumber/GetNextNumberRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class GetNextNumberRequest : ServiceRequest 4 | { 5 | public string Prefix { get; set; } 6 | public int Length { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/GetNextNumber/GetNextNumberResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class GetNextNumberResponse : ServiceResponse 4 | { 5 | public long Number { get; set; } 6 | public string Serial { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ResetPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [ScriptInclude] 4 | public class ResetPasswordResponse : ServiceResponse 5 | { 6 | public bool RedirectHome { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/MigrationUtils/DefaultDBAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class DefaultDBAttribute : TargetDBAttribute 4 | { 5 | public DefaultDBAttribute() 6 | : base("Default") 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/UserPreferenceRetrieveResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface UserPreferenceRetrieveResponse extends ServiceResponse { 4 | Value?: string; 5 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ModulePage/ModulePageResult.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Web; 4 | 5 | public class ModulePageResult : ViewResult 6 | { 7 | public new ModulePageModel Model => (ModulePageModel)base.Model; 8 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/GetNextNumberRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface GetNextNumberRequest extends ServiceRequest { 4 | Prefix?: string; 5 | Length?: number; 6 | } -------------------------------------------------------------------------------- /src/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "sergen": { 6 | "version": "8.7.1", 7 | "commands": [ 8 | "sergen" 9 | ], 10 | "rollForward": false 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/SendResetPasswordResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [ScriptInclude] 4 | public class SendResetPasswordResponse : ServiceResponse 5 | { 6 | public string DemoLink { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/GetNextNumberResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface GetNextNumberResponse extends ServiceResponse { 4 | Number?: number; 5 | Serial?: string; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Serenity 2 | @using Serenity.Demo.Northwind; 3 | @using Serenity.Web 4 | @using Microsoft.AspNetCore.Html 5 | @using System.Text; 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ResetPasswordEmailModel.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Serenity.Extensions; 3 | 4 | public class ResetPasswordEmailModel 5 | { 6 | public string DisplayName { get; set; } 7 | public string ResetLink { get; set; } 8 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Serenity 2 | @using Serenity.Web 3 | @using Microsoft.AspNetCore.Html 4 | @using System.Text 5 | @using Serenity.Demo.BasicSamples 6 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.Gender.ts: -------------------------------------------------------------------------------- 1 | import { Decorators } from "@serenity-is/corelib"; 2 | 3 | export enum Gender { 4 | Male = 1, 5 | Female = 2 6 | } 7 | Decorators.registerEnumType(Gender, 'Serenity.Demo.Northwind.Gender'); 8 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslationListRequest.ts: -------------------------------------------------------------------------------- 1 | import { ListRequest } from "@serenity-is/corelib"; 2 | 3 | export interface TranslationListRequest extends ListRequest { 4 | SourceLanguageID?: string; 5 | TargetLanguageID?: string; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslationListRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslationListRequest : ListRequest 4 | { 5 | public string SourceLanguageID { get; set; } 6 | public string TargetLanguageID { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Imports/ClientTypes/Extensions.ResetPasswordOptions.generated.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public partial class ResetPasswordOptions 4 | { 5 | public double minPasswordLength { get; set; } 6 | 7 | public string token { get; set; } 8 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDBAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Migrations; 2 | 3 | public class NorthwindDBAttribute : TargetDBAttribute 4 | { 5 | public NorthwindDBAttribute() 6 | : base("Northwind") 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/UserPreferenceRetrieveRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface UserPreferenceRetrieveRequest extends ServiceRequest { 4 | PreferenceType?: string; 5 | Name?: string; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslationListResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslationListResponse : ListResponse 4 | { 5 | public Dictionary> KeysByAssembly { get; private set; } = []; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ExcelImportResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface ExcelImportResponse extends ServiceResponse { 4 | Inserted?: number; 5 | Updated?: number; 6 | ErrorList?: string[]; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslationItem.ts: -------------------------------------------------------------------------------- 1 | export interface TranslationItem { 2 | Key?: string; 3 | SourceText?: string; 4 | TargetText?: string; 5 | CustomText?: string; 6 | HasTranslation?: boolean; 7 | UserTranslated?: boolean; 8 | } -------------------------------------------------------------------------------- /src/.config/sergen.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "Extends": "defaults@6.6.0", 3 | "IncludeGlobalUsings": [ 4 | "Serenity", 5 | "Serenity.ComponentModel", 6 | "Serenity.Extensions", 7 | "System", 8 | "System.Collections.Generic", 9 | "System.ComponentModel" 10 | ] 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ResetPasswordRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface ResetPasswordRequest extends ServiceRequest { 4 | Token?: string; 5 | NewPassword?: string; 6 | ConfirmPassword?: string; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "emitDeclarationOnly": true, 5 | "outDir": "./out" 6 | }, 7 | "exclude": [ 8 | "Modules/index.ts" 9 | ], 10 | "include": [ 11 | "Modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslationUpdateRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface TranslationUpdateRequest extends ServiceRequest { 4 | TargetLanguageID?: string; 5 | Translations?: { [key: string]: string }; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslationUpdateRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslationUpdateRequest : ServiceRequest 4 | { 5 | public string TargetLanguageID { get; set; } 6 | public Dictionary Translations { get; set; } 7 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Dialogs/CloneableEntityDialog/CloneableEntityDialogPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-CloneableEntityDialog > .size { 3 | width: 850px; 4 | height: 500px; 5 | } 6 | 7 | .s-Demo-BasicSamples-CloneableEntityDialog .caption { 8 | width: 150px; 9 | } 10 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/AccountPanelTitle.tsx: -------------------------------------------------------------------------------- 1 | import { localText } from "@serenity-is/corelib"; 2 | 3 | export const AccountPanelTitle = () => 4 |

5 | {localText("Forms.SiteTitle")} 6 |

-------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ChangePasswordRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface ChangePasswordRequest extends ServiceRequest { 4 | OldPassword?: string; 5 | NewPassword?: string; 6 | ConfirmPassword?: string; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/PasswordStrengthRules.ts: -------------------------------------------------------------------------------- 1 | export interface PasswordStrengthRules { 2 | MinPasswordLength?: number; 3 | RequireDigit?: boolean; 4 | RequireLowercase?: boolean; 5 | RequireNonAlphanumeric?: boolean; 6 | RequireUppercase?: boolean; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/UserPreferenceUpdateRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | 3 | export interface UserPreferenceUpdateRequest extends ServiceRequest { 4 | PreferenceType?: string; 5 | Name?: string; 6 | Value?: string; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductGrid.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-Northwind-ProductGrid .slick-cell input[type=text] { 3 | text-align: right; 4 | width: 100%; 5 | } 6 | 7 | .s-Demo-Northwind-ProductGrid .slick-cell .dirty { 8 | background-color: var(--s-input-dirty-bg, #ffe0e0); 9 | } 10 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Reporting/Tree/ReportRetrieveResult.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Reporting; 2 | 3 | /// 4 | /// Extending Serenity ReportRetrieveResponse class to add extra information 5 | /// 6 | [ScriptInclude] 7 | public class ReportRetrieveResult : ReportRetrieveResponse 8 | { 9 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderShippingState.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | [EnumKey("Northwind.OrderShippingState")] 4 | public enum OrderShippingState 5 | { 6 | [Description("Not Shipped")] 7 | NotShipped = 0, 8 | [Description("Shipped")] 9 | Shipped = 1 10 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@serenity-is/extensions/tsconfig.base.json", 3 | "compilerOptions": { 4 | "emitDeclarationOnly": true, 5 | "outDir": "./out" 6 | }, 7 | "exclude": [ 8 | "Modules/index.ts" 9 | ], 10 | "include": [ 11 | "Modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslateTextResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | import { TranslateTextOutput } from "./TranslateTextOutput"; 3 | 4 | export interface TranslateTextResponse extends ServiceResponse { 5 | Translations?: TranslateTextOutput[]; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Region")] 4 | [BasedOnRow(typeof(RegionRow), CheckNames = true)] 5 | public class RegionForm 6 | { 7 | public int? RegionID { get; set; } 8 | public string RegionDescription { get; set; } 9 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/LookupFilterByMultipleValues/LookupFilterByMultipleValuesPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-LookupFilterByMultipleDialog > .size { 3 | width: 850px; 4 | height: 650px; 5 | } 6 | 7 | .s-Demo-BasicSamples-LookupFilterByMultipleDialog .caption { 8 | width: 150px; 9 | } 10 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo/BasicSamples.OrdersByShipperResponse.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse } from "@serenity-is/corelib"; 2 | 3 | export interface OrdersByShipperResponse extends ServiceResponse { 4 | Values?: { [key: string]: any }[]; 5 | ShipperKeys?: string[]; 6 | ShipperLabels?: string[]; 7 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Category")] 4 | [BasedOnRow(typeof(CategoryRow), CheckNames = true)] 5 | public class CategoryForm 6 | { 7 | public string CategoryName { get; set; } 8 | public string Description { get; set; } 9 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslationListResponse.ts: -------------------------------------------------------------------------------- 1 | import { ListResponse } from "@serenity-is/corelib"; 2 | import { TranslationItem } from "./TranslationItem"; 3 | 4 | export interface TranslationListResponse extends ListResponse { 5 | KeysByAssembly?: { [key: string]: string[] }; 6 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out/test", 5 | "typeRoots": [ 6 | "../../../../Serenity/node_modules/@types", 7 | ], 8 | "types": [ 9 | "jest" 10 | ] 11 | }, 12 | "include": [ 13 | "." 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out/test", 5 | "typeRoots": [ 6 | "../../../../Serenity/node_modules/@types", 7 | ], 8 | "types": [ 9 | "jest" 10 | ] 11 | }, 12 | "include": [ 13 | "." 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/SelectWithHardcodedValues/HardcodedValuesForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.Forms; 2 | 3 | [FormScript("BasicSamples.HarcodedValues")] 4 | public class HardcodedValuesForm 5 | { 6 | [DisplayName("Some Value")] 7 | [HardcodedValuesEditor] 8 | public String SomeValue { get; set; } 9 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out/test", 5 | "typeRoots": [ 6 | "../../../../Serenity/node_modules/@types", 7 | ], 8 | "types": [ 9 | "jest" 10 | ] 11 | }, 12 | "include": [ 13 | "." 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/TranslateTextRequest.ts: -------------------------------------------------------------------------------- 1 | import { ServiceRequest } from "@serenity-is/corelib"; 2 | import { TranslateTextInput } from "./TranslateTextInput"; 3 | 4 | export interface TranslateTextRequest extends ServiceRequest { 5 | SourceLanguageID?: string; 6 | Inputs?: TranslateTextInput[]; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Grids/WrappedHeaders/WrappedHeadersPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-WrappedHeadersGrid .slick-header-columns { 3 | white-space: normal; 4 | height: 4em; 5 | } 6 | 7 | .s-Demo-BasicSamples-WrappedHeadersGrid .slick-header-column.ui-state-default { 8 | height: 100%; 9 | line-height: 1.3em; 10 | } 11 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.OrderShippingState.ts: -------------------------------------------------------------------------------- 1 | import { Decorators } from "@serenity-is/corelib"; 2 | 3 | export enum OrderShippingState { 4 | NotShipped = 0, 5 | Shipped = 1 6 | } 7 | Decorators.registerEnumType(OrderShippingState, 'Serenity.Demo.Northwind.OrderShippingState', 'Northwind.OrderShippingState'); 8 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Shipper")] 4 | [BasedOnRow(typeof(ShipperRow), CheckNames = true)] 5 | public class ShipperForm 6 | { 7 | public string CompanyName { get; set; } 8 | [PhoneEditor] 9 | public string Phone { get; set; } 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | This repository which used to contain common features shared between Serene and StartSharp is now integrated into Serenity repository at: 4 | 5 | [https://github.com/serenity-is/Serenity/tree/master/common-features] 6 | 7 | The files in this repository should be out of date, but you may explore it to see commit history if you like. 8 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/test/note/notedialog.spec.tsx: -------------------------------------------------------------------------------- 1 | import { NoteDialog } from '../../Modules/Note/NoteDialog'; 2 | 3 | describe("NoteDialog", () => { 4 | it("text property can be set and get", () => { 5 | const dialog = new NoteDialog({}); 6 | dialog.text = "test"; 7 | expect(dialog.text).toBe("test"); 8 | }); 9 | 10 | }); -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/MigrationUtils/MigrationKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public class MigrationKeyAttribute(long version, TransactionBehavior transactionBehavior = TransactionBehavior.Default, string description = null) : MigrationAttributeBase(version, transactionBehavior, description) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.NotesEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class NotesEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.NotesEditor"; 6 | 7 | public NotesEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(OrderRow))] 6 | public class OrderPage : Controller 7 | { 8 | [Route("Northwind/Order")] 9 | public ActionResult Index() 10 | { 11 | return View(MVC.Views.Order.OrderIndex); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.CustomerEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class CustomerEditorAttribute : LookupEditorBaseAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.CustomerEditor"; 6 | 7 | public CustomerEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ForgotPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [FormScript(LocalTextPrefix = "Forms.Membership.ForgotPassword.")] 4 | public class ForgotPasswordRequest : ServiceRequest 5 | { 6 | [Required(true), EmailAddressEditor, DisplayName("Email Address"), Placeholder("email")] 7 | public string Email { get; set; } 8 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/BasicSamplesPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.BasicSamples; 4 | 5 | [PageAuthorize, Route("BasicSamples/[action]")] 6 | public partial class BasicSamplesPage : Controller 7 | { 8 | } 9 | 10 | [Obsolete("Use BasicSamplesPage")] 11 | public abstract class BasicSamplesController : BasicSamplesPage 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.FreightFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class FreightFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.FreightFormatter"; 6 | 7 | public FreightFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.ShipperFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class ShipperFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.ShipperFormatter"; 6 | 7 | public ShipperFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(ProductRow))] 6 | public class ProductPage : Controller 7 | { 8 | [Route("Northwind/Product")] 9 | public ActionResult Index() 10 | { 11 | return View(MVC.Views.Product.ProductIndex); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(RegionRow))] 6 | public class RegionPage : Controller 7 | { 8 | [Route("Northwind/Region")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.RegionPage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.OrderDetailsEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class OrderDetailsEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.OrderDetailsEditor"; 6 | 7 | public OrderDetailsEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(ShipperRow))] 6 | public class ShipperPage : Controller 7 | { 8 | [Route("Northwind/Shipper")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.ShipperPage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Imports/ClientTypes/Extensions.SingleLineTextFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public partial class SingleLineTextFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Extensions.SingleLineTextFormatter"; 6 | 7 | public SingleLineTextFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/BaseTranslationOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [DefaultSectionKey(SectionKey)] 4 | public class BaseTranslationOptions 5 | { 6 | public const string SectionKey = "Translation"; 7 | public bool Enabled { get; set; } 8 | public int ParallelRequests { get; set; } = 1; 9 | public int BatchSize { get; set; } = 1; 10 | } 11 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(CategoryRow))] 6 | public class CategoryPage : Controller 7 | { 8 | [Route("Northwind/Category")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.CategoryPage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(SupplierRow))] 6 | public class SupplierPage : Controller 7 | { 8 | [Route("Northwind/Supplier")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.SupplierPage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ModulePage/ModulePageModel.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Web; 2 | 3 | public class ModulePageModel 4 | { 5 | public string HtmlMarkup { get; set; } 6 | public object Options { get; set; } 7 | public string Layout { get; set; } 8 | public string Module { get; set; } 9 | public string PageId { get; set; } 10 | public LocalText PageTitle { get; set; } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.EmployeeListFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class EmployeeListFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.EmployeeListFormatter"; 6 | 7 | public EmployeeListFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.PermissionKeys.ts: -------------------------------------------------------------------------------- 1 | export namespace PermissionKeys { 2 | export const General = "Northwind:General"; 3 | 4 | export namespace Customer { 5 | export const Delete = "Northwind:Customer:Delete"; 6 | export const Modify = "Northwind:Customer:Modify"; 7 | export const View = "Northwind:Customer:View"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(TerritoryRow))] 6 | public class TerritoryPage : Controller 7 | { 8 | [Route("Northwind/Territory")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.TerritoryPage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/BulkActions/BasicProgressDialogTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Site.BasicProgressDialog.")] 4 | public static class BasicProgressDialogTexts 5 | { 6 | public static readonly LocalText CancelTitle = "Operation cancelled. Waiting for in progress calls to complete..."; 7 | public static readonly LocalText PleaseWait = "Please wait..."; 8 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Reporting/ReportRetrieveResult.ts: -------------------------------------------------------------------------------- 1 | import { ServiceResponse, PropertyItem } from "@serenity-is/corelib"; 2 | 3 | export interface ReportRetrieveResult extends ServiceResponse { 4 | ReportKey?: string; 5 | Title?: string; 6 | Properties?: PropertyItem[]; 7 | InitialSettings?: any; 8 | IsDataOnlyReport?: boolean; 9 | IsExternalReport?: boolean; 10 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.HardcodedValuesEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public partial class HardcodedValuesEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.HardcodedValuesEditor"; 6 | 7 | public HardcodedValuesEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ExportImport/ExcelImportRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class ExcelImportRequest : ServiceRequest 4 | { 5 | public string FileName { get; set; } 6 | } 7 | 8 | public class ExcelImportResponse : ServiceResponse 9 | { 10 | public int Inserted { get; set; } 11 | public int Updated { get; set; } 12 | public List ErrorList { get; set; } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Dialogs/ChartInDialog/ChartInDialogPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-ChartInDialog svg { 3 | width: 100%; 4 | height: 90%; 5 | } 6 | 7 | .s-Demo-BasicSamples-ChartInDialog .ui-dialog-content { 8 | overflow: hidden; 9 | } 10 | 11 | .s-Demo-BasicSamples-ChartInDialog > .size { 12 | min-width: 700px; 13 | width: 700px; 14 | min-height: 400px; 15 | height: 400px; 16 | } 17 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/Product/ProductIndex.cshtml: -------------------------------------------------------------------------------- 1 | @inject ITextLocalizer Localizer 2 | @{ 3 | ViewData["Title"] = Localizer.Get(ProductRow.Fields.PageTitle()); 4 | } 5 | 6 | @section Head { 7 | @Html.Script("dynamic://Lookup.Northwind.Category") 8 | @Html.Script("dynamic://Lookup.Northwind.Supplier") 9 | } 10 |
11 | 12 | @Html.ModulePageInit(ESM.ProductPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderPage.ts: -------------------------------------------------------------------------------- 1 | import { gridPageInit, parseQueryString } from "@serenity-is/corelib"; 2 | import { OrderGrid } from "./OrderGrid"; 3 | 4 | export default () => { 5 | const orderGrid = gridPageInit(OrderGrid); 6 | const q = parseQueryString() as any; 7 | if (q.shippingState?.length) { 8 | orderGrid.set_shippingState(parseInt(q.shippingState, 10)); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.ChangingLookupTextEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public partial class ChangingLookupTextEditorAttribute : LookupEditorBaseAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.ChangingLookupTextEditor"; 6 | 7 | public ChangingLookupTextEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/OrderDetailForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.OrderDetail")] 4 | [BasedOnRow(typeof(OrderDetailRow), CheckNames = true)] 5 | public class OrderDetailForm 6 | { 7 | public int ProductID { get; set; } 8 | public decimal UnitPrice { get; set; } 9 | public int Quantity { get; set; } 10 | public double Discount { get; set; } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.Region")] 4 | [BasedOnRow(typeof(RegionRow), CheckNames = true)] 5 | public class RegionColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), AlignRight] 8 | public int RegionID { get; set; } 9 | [EditLink, Width(300)] 10 | public string RegionDescription { get; set; } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Territory")] 4 | [BasedOnRow(typeof(TerritoryRow), CheckNames = true)] 5 | public class TerritoryForm 6 | { 7 | public string TerritoryID { get; set; } 8 | public string TerritoryDescription { get; set; } 9 | [LookupEditor(typeof(RegionRow))] 10 | public int RegionID { get; set; } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.FilteredLookupDetailEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public partial class FilteredLookupDetailEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.FilteredLookupDetailEditor"; 6 | 7 | public FilteredLookupDetailEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslationItem.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [ScriptInclude] 4 | public class TranslationItem 5 | { 6 | public string Key { get; set; } 7 | public string SourceText { get; set; } 8 | public string TargetText { get; set; } 9 | public string CustomText { get; set; } 10 | public bool HasTranslation { get; set; } 11 | public bool UserTranslated { get; set; } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Grids/WrappedHeaders/WrappedHeadersPage.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, gridPageInit } from "@serenity-is/corelib"; 2 | import { OrderGrid } from "@serenity-is/demo.northwind"; 3 | import "./WrappedHeadersPage.css"; 4 | 5 | export default () => gridPageInit(WrappedHeadersGrid) 6 | 7 | @Decorators.registerClass('Serenity.Demo.BasicSamples.WrappedHeadersGrid') 8 | export class WrappedHeadersGrid extends OrderGrid { 9 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordStrength/PasswordStrengthRules.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [ScriptInclude] 4 | public class PasswordStrengthRules 5 | { 6 | public int MinPasswordLength { get; set; } 7 | public bool RequireDigit { get; set; } 8 | public bool RequireLowercase { get; set; } 9 | public bool RequireNonAlphanumeric { get; set; } 10 | public bool RequireUppercase { get; set; } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.ProduceSeafoodCategoryEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public partial class ProduceSeafoodCategoryEditorAttribute : LookupEditorBaseAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.ProduceSeafoodCategoryEditor"; 6 | 7 | public ProduceSeafoodCategoryEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslateTextResponse.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslateTextResponse : ServiceResponse 4 | { 5 | public List Translations { get; set; } 6 | } 7 | 8 | public class TranslateTextOutput 9 | { 10 | public string TextKey { get; set; } 11 | public string TargetLanguageID { get; set; } 12 | public string TranslatedText { get; set; } 13 | } 14 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8.7.1 6 | net8.0 7 | 8 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ChangePasswordFormTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Forms.Membership.ChangePassword.")] 4 | public static class ChangePasswordFormTexts 5 | { 6 | public static readonly LocalText FormTitle = "Change Password"; 7 | public static readonly LocalText SubmitButton = "Change Password"; 8 | public static readonly LocalText Success = "Your password is changed."; 9 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Widgets/DialogUtilsTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Site.Dialogs.")] 4 | public static class DialogUtilsTexts 5 | { 6 | public static readonly LocalText PendingChangesConfirmation = "You have pending changes. Save them?"; 7 | public static readonly LocalText PendingChangesUnloadWarning = "Warning! You might lose your pending changes if you continue. Please save them before navigating away."; 8 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class CustomerLookup : RowLookupScript 5 | { 6 | public CustomerLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = CustomerRow.Fields.CustomerID.PropertyName; 10 | TextField = CustomerRow.Fields.CompanyName.PropertyName; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Serenity.Demo.BasicSamples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerOrderDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EditorUtils } from "@serenity-is/corelib"; 2 | import { OrderDialog } from "../Order/OrderDialog"; 3 | 4 | @Decorators.registerClass('Serenity.Demo.Northwind.CustomerOrderDialog') 5 | export class CustomerOrderDialog extends OrderDialog { 6 | 7 | updateInterface() { 8 | super.updateInterface(); 9 | 10 | EditorUtils.setReadOnly(this.form.CustomerID, true); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/tsbuild.js: -------------------------------------------------------------------------------- 1 | import { build } from "@serenity-is/tsbuild"; 2 | 3 | // wwwroot/esm/**/*.js: ESM entry points for own pages 4 | await build({ 5 | }); 6 | 7 | // dist/index.js: ESM bundle for NPM references 8 | await build({ 9 | clean: false, 10 | entryPoints: ['./Modules/index.ts'], 11 | external: [ 12 | '@serenity-is/*' 13 | ], 14 | outbase: './Modules/', 15 | outdir: 'dist/', 16 | plugins: [], 17 | splitting: false 18 | }); -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Translation/TranslateTextRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class TranslateTextRequest : ServiceRequest 4 | { 5 | public string SourceLanguageID { get; set; } 6 | public List Inputs { get; set; } 7 | } 8 | 9 | public class TranslateTextInput 10 | { 11 | public string TextKey { get; set; } 12 | public string TargetLanguageID { get; set; } 13 | public string SourceText { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .swc/ 2 | artifacts/ 3 | bin/ 4 | dynamic-data/ 5 | obj/ 6 | out/ 7 | *.orig 8 | *.bak 9 | .vs/ 10 | /build/.nupkg/ 11 | node_modules/ 12 | /src/*/coverage 13 | /src/*/dist/index.css 14 | /src/*/dist/index.css.map 15 | /src/*/dist/index.js 16 | /src/*/dist/index.min.js 17 | /src/*/dist/index.js.map 18 | /src/*/wwwroot/index.js 19 | /src/*/wwwroot/index.min.js 20 | /src/*/wwwroot/index.js.map 21 | /src/*/wwwroot/esm/ 22 | *.csproj.user 23 | .restore-stamp 24 | package-lock.json 25 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Dialogs/EntityDialogAsPanel/EntityDialogAsPanelPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-EntityDialogAsPanel { 3 | background-color: var(--s-card-bg, #fff); 4 | border: 1px solid var(--s-card-border, #999); 5 | padding: 1rem; 6 | border-radius: 6px; 7 | } 8 | 9 | .s-Demo-BasicSamples-EntityDialogAsPanel .caption { 10 | width: 120px; 11 | } 12 | 13 | .s-Demo-BasicSamples-EntityDialogAsPanel .s-PropertyGrid .categories { 14 | height: auto; 15 | } 16 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.Shipper")] 4 | [BasedOnRow(typeof(ShipperRow), CheckNames = true)] 5 | public class ShipperColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), AlignRight] 8 | public int ShipperID { get; set; } 9 | [EditLink, Width(300)] 10 | public string CompanyName { get; set; } 11 | [Width(150)] 12 | public string Phone { get; set; } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.FilteredLookupDetailEditor.HardcodedValuesEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.FilteredLookupDetailEditor; 2 | 3 | public partial class HardcodedValuesEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.FilteredLookupDetailEditor.HardcodedValuesEditor"; 6 | 7 | public HardcodedValuesEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.Category")] 4 | [BasedOnRow(typeof(CategoryRow), CheckNames = true)] 5 | public class CategoryColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), AlignRight] 8 | public int CategoryID { get; set; } 9 | [EditLink, Width(250)] 10 | public string CategoryName { get; set; } 11 | [Width(450)] 12 | public string Description { get; set; } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace Serenity.Demo.Northwind; 4 | 5 | [PageAuthorize(typeof(CustomerRow))] 6 | public class CustomerPage : Controller 7 | { 8 | [Route("Northwind/Customer")] 9 | public ActionResult Index() 10 | { 11 | return this.GridPage(ESM.CustomerPage); 12 | } 13 | } 14 | 15 | [Obsolete("Use CustomerPage")] 16 | public abstract class CustomerController : CustomerPage 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@serenity-is/workspace-common-features", 3 | "private": true, 4 | "devDependencies": { 5 | "@serenity-is/corelib": "../Serenity/packages/corelib", 6 | "@serenity-is/sleekgrid": "../Serenity/packages/sleekgrid", 7 | "@serenity-is/tsbuild": "8.7.4", 8 | "jsx-dom": "8.1.5", 9 | "test-utils": "../Serenity/packages/test-utils" 10 | }, 11 | "scripts": { 12 | "all": "pnpm i && pnpm -r build && pnpm -r tsc && pnpm -r dts && pnpm -r jest" 13 | }, 14 | "type": "module" 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.PhoneEditorAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class PhoneEditorAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.PhoneEditor"; 6 | 7 | public PhoneEditorAttribute() 8 | : base(Key) 9 | { 10 | } 11 | 12 | public bool Multiple 13 | { 14 | get { return GetOption("multiple"); } 15 | set { SetOption("multiple", value); } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/BasicSamplesModels.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public class OrdersByShipperRequest : ServiceRequest 4 | { 5 | } 6 | 7 | public class OrdersByShipperResponse : ServiceResponse 8 | { 9 | public List> Values { get; set; } 10 | public List ShipperKeys { get; set; } 11 | public List ShipperLabels { get; set; } 12 | } 13 | 14 | public class OrdersByShipperItem 15 | { 16 | public string label; 17 | public int value; 18 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/ChangingLookupText/ChangingLookupTextForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.Forms; 2 | 3 | [FormScript("BasicSamples.ChangingLookupText")] 4 | [BasedOnRow(typeof(Northwind.OrderDetailRow), CheckNames = true)] 5 | public class ChangingLookupTextForm 6 | { 7 | [ChangingLookupTextEditor(Async = true)] 8 | public Int32 ProductID { get; set; } 9 | public Decimal UnitPrice { get; set; } 10 | public Int32 Quantity { get; set; } 11 | public Double Discount { get; set; } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Note/RequestHandlers/NoteDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.NoteRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface INoteDeleteHandler : IDeleteHandler { } 8 | 9 | public class NoteDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), INoteDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/RequestHandlers/OrderDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderDeleteHandler : IDeleteHandler { } 8 | 9 | public class OrderDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IOrderDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RequestHandlers/RegionDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.RegionRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IRegionDeleteHandler : IDeleteHandler { } 8 | 9 | public class RegionDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IRegionDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/texts/NorthwindTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | [NestedLocalTexts] 4 | public static partial class NorthwindTexts 5 | { 6 | public static class Validation 7 | { 8 | public static readonly LocalText NorthwindPhone = "Phone numbers should be entered in format '(503) 555-9831'."; 9 | public static readonly LocalText NorthwindPhoneMultiple = "Phone numbers should be entered in format '(503) 555-9831. " + 10 | "Multiple numbers can be separated with comma."; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Note/RequestHandlers/NoteListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.NoteRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface INoteListHandler : IListHandler { } 8 | 9 | public class NoteListHandler(IRequestContext context) : 10 | ListRequestHandler(context), INoteListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Note/RequestHandlers/NoteSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.NoteRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface INoteSaveHandler : ISaveHandler { } 8 | 9 | public class NoteSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), INoteSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/RequestHandlers/ProductDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductDeleteHandler : IDeleteHandler { } 8 | 9 | public class ProductDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IProductDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/RequestHandlers/ShipperDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.ShipperRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IShipperDeleteHandler : IDeleteHandler { } 8 | 9 | public class ShipperDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IShipperDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/RequestHandlers/CategoryDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryDeleteHandler : IDeleteHandler { } 8 | 9 | public class CategoryDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), ICategoryDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/RequestHandlers/CustomerDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.CustomerRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICustomerDeleteHandler : IDeleteHandler { } 8 | 9 | public class CustomerDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), ICustomerDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/RequestHandlers/OrderSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderSaveHandler : ISaveHandler { } 8 | 9 | public class OrderSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IOrderSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/RequestHandlers/SupplierDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.SupplierRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ISupplierDeleteHandler : IDeleteHandler { } 8 | 9 | public class SupplierDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), ISupplierDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RequestHandlers/RegionListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.RegionRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IRegionListHandler : IListHandler { } 8 | 9 | public class RegionListHandler(IRequestContext context) : 10 | ListRequestHandler(context), IRegionListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RequestHandlers/RegionSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.RegionRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IRegionSaveHandler : ISaveHandler { } 8 | 9 | public class RegionSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IRegionSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/RequestHandlers/TerritoryDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.TerritoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ITerritoryDeleteHandler : IDeleteHandler { } 8 | 9 | public class TerritoryDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), ITerritoryDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/ClientTypes/Demo.Northwind.EmployeeFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | public partial class EmployeeFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Demo.Northwind.EmployeeFormatter"; 6 | 7 | public EmployeeFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | 12 | public string GenderProperty 13 | { 14 | get { return GetOption("genderProperty"); } 15 | set { SetOption("genderProperty", value); } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/RequestHandlers/ProductListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductListHandler : IListHandler { } 8 | 9 | public class ProductListHandler(IRequestContext context) : 10 | ListRequestHandler(context), IProductListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/RequestHandlers/ProductSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductSaveHandler : ISaveHandler { } 8 | 9 | public class ProductSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IProductSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.RegionColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { RegionRow } from "./Northwind.RegionRow"; 4 | 5 | export interface RegionColumns { 6 | RegionID: Column; 7 | RegionDescription: Column; 8 | } 9 | 10 | export class RegionColumns extends ColumnsBase { 11 | static readonly columnsKey = 'Northwind.Region'; 12 | static readonly Fields = fieldsProxy(); 13 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/RequestHandlers/ShipperListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.ShipperRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IShipperListHandler : IListHandler { } 8 | 9 | public class ShipperListHandler(IRequestContext context) : 10 | ListRequestHandler(context), IShipperListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/RequestHandlers/ShipperSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ShipperRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IShipperSaveHandler : ISaveHandler { } 8 | 9 | public class ShipperSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IShipperSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 2 | import { ShipperForm, ShipperRow, ShipperService } from "../ServerTypes/Demo"; 3 | 4 | @Decorators.registerClass() 5 | export class ShipperDialog

extends EntityDialog { 6 | protected getFormKey() { return ShipperForm.formKey; } 7 | protected getRowDefinition() { return ShipperRow; } 8 | protected getService() { return ShipperService.baseUrl; } 9 | 10 | protected form = new ShipperForm(this.idPrefix); 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/FreightFormatter.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, Formatter, faIcon, htmlEncode } from "@serenity-is/corelib"; 2 | import { FormatterContext } from "@serenity-is/sleekgrid"; 3 | 4 | @Decorators.registerFormatter('Serenity.Demo.Northwind.FreightFormatter') 5 | export class FreightFormatter implements Formatter { 6 | format(ctx: FormatterContext) { 7 | if (ctx.value == null) 8 | return ""; 9 | 10 | return `${ctx.escape()} `; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/RequestHandlers/OrderDetailDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderDetailRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderDetailDeleteHandler : IDeleteHandler { } 8 | 9 | public class OrderDetailDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IOrderDetailDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ProductLang/RequestHandlers/ProductLangDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductLangDeleteHandler : IDeleteHandler { } 8 | 9 | public class ProductLangDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), IProductLangDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/SalesByCategory/SalesByCategoryColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Columns; 2 | 3 | [ColumnsScript("Northwind.SalesByCategory")] 4 | [BasedOnRow(typeof(SalesByCategoryRow), CheckNames = true)] 5 | public class SalesByCategoryColumns 6 | { 7 | [Width(150), SortOrder(1)] 8 | public string CategoryName { get; set; } 9 | [Width(250)] 10 | public string ProductName { get; set; } 11 | [Width(150), AlignRight, SortOrder(2, descending: true), DisplayFormat("#,##0.00")] 12 | public decimal ProductSales { get; set; } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ResetPasswordFormTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Forms.Membership.ResetPassword.")] 4 | public static class ResetPasswordFormTexts 5 | { 6 | public static readonly LocalText EmailSubject = "Reset Your Password"; 7 | public static readonly LocalText FormTitle = "Reset Password"; 8 | public static readonly LocalText SubmitButton = "Reset Password"; 9 | public static readonly LocalText Success = "Your password is changed. Please login with your new password."; 10 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Imports/MVC/MVC.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Serenity.Demo.Northwind.MVC; 3 | 4 | public static class Views 5 | { 6 | public static class Order 7 | { 8 | public const string OrderDetailReport = "~/Areas/Serenity.Demo.Northwind/Order/OrderDetailReport.cshtml"; 9 | public const string OrderIndex = "~/Areas/Serenity.Demo.Northwind/Order/OrderIndex.cshtml"; 10 | } 11 | 12 | public static class Product 13 | { 14 | public const string ProductIndex = "~/Areas/Serenity.Demo.Northwind/Product/ProductIndex.cshtml"; 15 | } 16 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/RequestHandlers/CategoryListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryListHandler : IListHandler { } 8 | 9 | public class CategoryListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ICategoryListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/RequestHandlers/CategorySaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategorySaveHandler : ISaveHandler { } 8 | 9 | public class CategorySaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), ICategorySaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/CategoryLang/RequestHandlers/CategoryLangDeleteHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.DeleteRequest; 2 | using MyResponse = Serenity.Services.DeleteResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryLangDeleteHandler : IDeleteHandler { } 8 | 9 | public class CategoryLangDeleteHandler(IRequestContext context) : 10 | DeleteRequestHandler(context), ICategoryLangDeleteHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/RequestHandlers/CustomerListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.CustomerRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICustomerListHandler : IListHandler { } 8 | 9 | public class CustomerListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ICustomerListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/RequestHandlers/CustomerSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CustomerRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICustomerSaveHandler : ISaveHandler { } 8 | 9 | public class CustomerSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), ICustomerSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Note/RequestHandlers/NoteRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.NoteRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface INoteRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class NoteRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), INoteRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/RequestHandlers/SupplierListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.SupplierRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ISupplierListHandler : IListHandler { } 8 | 9 | public class SupplierListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ISupplierListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/RequestHandlers/SupplierSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.SupplierRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ISupplierSaveHandler : ISaveHandler { } 8 | 9 | public class SupplierSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), ISupplierSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20161118_1954_DragDropSample.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20161118_1954)] 6 | public class NorthwindDB_20161118_1954_DragDropSample : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | Create.Table("DragDropSample") 11 | .WithColumn("Id").AsInt32().IdentityKey(this) 12 | .WithColumn("ParentId").AsInt32().Nullable() 13 | .WithColumn("Title").AsString(100).NotNullable(); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/RequestHandlers/TerritoryListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.TerritoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ITerritoryListHandler : IListHandler { } 8 | 9 | public class TerritoryListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ITerritoryListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/RequestHandlers/TerritorySaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.TerritoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ITerritorySaveHandler : ISaveHandler { } 8 | 9 | public class TerritorySaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), ITerritorySaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/MembershipSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [DefaultSectionKey(SectionKey)] 4 | public class MembershipSettings 5 | { 6 | public const string SectionKey = "Membership"; 7 | 8 | public int MinPasswordLength { get; set; } = 6; 9 | public bool RequireDigit { get; set; } = true; 10 | public bool RequireLowercase { get; set; } = true; 11 | public bool RequireNonAlphanumeric { get; set; } = true; 12 | public bool RequireUppercase { get; set; } = true; 13 | public int SaltSize { get; set; } = 5; 14 | } 15 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/RequestHandlers/OrderRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class OrderRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IOrderRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Serenity.Demo.Northwind.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RequestHandlers/RegionRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.RegionRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IRegionRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class RegionRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IRegionRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/RequestHandlers/OrderDetailListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderDetailRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderDetailListHandler : IListHandler { } 8 | 9 | public class OrderDetailListHandler(IRequestContext context) : 10 | ListRequestHandler(context), IOrderDetailListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/RequestHandlers/OrderDetailSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderDetailRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderDetailSaveHandler : ISaveHandler { } 8 | 9 | public class OrderDetailSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IOrderDetailSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ProductLang/RequestHandlers/ProductLangListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductLangListHandler : IListHandler { } 8 | 9 | public class ProductLangListHandler(IRequestContext context) : 10 | ListRequestHandler(context), IProductLangListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ProductLang/RequestHandlers/ProductLangSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductLangSaveHandler : ISaveHandler { } 8 | 9 | public class ProductLangSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), IProductLangSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 2 | import { RegionForm, RegionRow, RegionService } from "../ServerTypes/Demo"; 3 | 4 | @Decorators.registerClass('Serenity.Demo.Northwind.RegionDialog') 5 | export class RegionDialog

extends EntityDialog { 6 | protected getFormKey() { return RegionForm.formKey; } 7 | protected getRowDefinition() { return RegionRow; } 8 | protected getService() { return RegionService.baseUrl; } 9 | 10 | protected form = new RegionForm(this.idPrefix); 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/CategoryLang/RequestHandlers/CategoryLangListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryLangListHandler : IListHandler { } 8 | 9 | public class CategoryLangListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ICategoryLangListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/CategoryLang/RequestHandlers/CategoryLangSaveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.SaveRequest; 2 | using MyResponse = Serenity.Services.SaveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryLangSaveHandler : ISaveHandler { } 8 | 9 | public class CategoryLangSaveHandler(IRequestContext context) : 10 | SaveRequestHandler(context), ICategoryLangSaveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/RequestHandlers/ProductRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class ProductRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IProductRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/RequestHandlers/ShipperRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ShipperRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IShipperRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class ShipperRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IShipperRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ResetPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [FormScript(LocalTextPrefix = "Forms.Membership.ResetPassword.")] 4 | public class ResetPasswordRequest : ServiceRequest 5 | { 6 | [Ignore] 7 | public string Token { get; set; } 8 | [PasswordEditor, Required(true), DisplayName("New Password"), Placeholder("password")] 9 | public string NewPassword { get; set; } 10 | [PasswordEditor, Required(true), DisplayName("Confirm Password"), Placeholder("confirm password")] 11 | public string ConfirmPassword { get; set; } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@serenity-is/demo.basicsamples", 3 | "dependencies": { 4 | "@serenity-is/demo.northwind": "workspace:*", 5 | "@serenity-is/extensions": "workspace:*", 6 | "chart.js": "4.4.4" 7 | }, 8 | "main": "wwwroot/index.js", 9 | "private": true, 10 | "scripts": { 11 | "build": "node ./tsbuild.js", 12 | "build:watch": "node ./tsbuild.js --watch", 13 | "jest": "node ../../../Serenity/node_modules/jest/bin/jest.js", 14 | "test": "node ./tsbuild.js && pnpm jest --coverage", 15 | "tsc": "tsc" 16 | }, 17 | "type": "module" 18 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/RequestHandlers/CategoryRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class CategoryRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), ICategoryRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/RequestHandlers/CustomerRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CustomerRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICustomerRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class CustomerRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), ICustomerRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/OrderDetailColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.OrderDetail")] 4 | [BasedOnRow(typeof(OrderDetailRow), CheckNames = true)] 5 | public class OrderDetailColumns 6 | { 7 | [EditLink, Width(200)] 8 | public string ProductName { get; set; } 9 | [Width(100)] 10 | public decimal UnitPrice { get; set; } 11 | [Width(100)] 12 | public short Quantity { get; set; } 13 | [Width(100)] 14 | public double Discount { get; set; } 15 | [Width(100)] 16 | public decimal LineTotal { get; set; } 17 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.ShipperColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { ShipperRow } from "./Northwind.ShipperRow"; 4 | 5 | export interface ShipperColumns { 6 | ShipperID: Column; 7 | CompanyName: Column; 8 | Phone: Column; 9 | } 10 | 11 | export class ShipperColumns extends ColumnsBase { 12 | static readonly columnsKey = 'Northwind.Shipper'; 13 | static readonly Fields = fieldsProxy(); 14 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/RequestHandlers/SupplierRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.SupplierRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ISupplierRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class SupplierRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), ISupplierRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/UserPreference/UserPreferenceModels.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public class UserPreferenceUpdateRequest : ServiceRequest 4 | { 5 | public string PreferenceType { get; set; } 6 | public string Name { get; set; } 7 | public string Value { get; set; } 8 | } 9 | 10 | public class UserPreferenceRetrieveRequest : ServiceRequest 11 | { 12 | public string PreferenceType { get; set; } 13 | public string Name { get; set; } 14 | } 15 | 16 | public class UserPreferenceRetrieveResponse : ServiceResponse 17 | { 18 | public string Value { get; set; } 19 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@serenity-is/extensions", 3 | "scripts": { 4 | "build": "node ./tsbuild.js", 5 | "build:watch": "node ./tsbuild.js --watch", 6 | "dts": "pnpm dts-bundle-generator Modules/index.ts -o dist/index.d.ts --no-banner --disable-symlinks-following --inline-declare-global", 7 | "jest": "node ../../../Serenity/node_modules/jest/bin/jest.js", 8 | "test": "node ./tsbuild.js && pnpm jest --coverage", 9 | "tsc": "tsc" 10 | }, 11 | "main": "dist/index.js", 12 | "private": true, 13 | "type": "module", 14 | "types": "dist/index.d.ts" 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/RequestHandlers/TerritoryRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.TerritoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ITerritoryRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class TerritoryRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), ITerritoryRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ChangePasswordRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [FormScript(LocalTextPrefix = "Forms.Membership.ChangePassword.")] 4 | public class ChangePasswordRequest : ServiceRequest 5 | { 6 | [PasswordEditor, Required(true), DisplayName("Current Password")] 7 | public string OldPassword { get; set; } 8 | [PasswordEditor, Required(true), DisplayName("New Password")] 9 | public string NewPassword { get; set; } 10 | [PasswordEditor, Required(true), DisplayName("Confirm Password")] 11 | public string ConfirmPassword { get; set; } 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/wwwroot/index.css: -------------------------------------------------------------------------------- 1 | .alert.s-sample-info { 2 | font-size: 13px; 3 | --bs-alert-padding-y: 0.5rem; 4 | } 5 | 6 | .alert.s-sample-info.alert-dismissible .btn-close { 7 | padding: 0.5rem 0.75rem; 8 | } 9 | 10 | .alert.s-sample-info p { 11 | margin-bottom: 5px; 12 | } 13 | 14 | .alert.s-sample-info .s-sample-sources { 15 | text-align: right; 16 | margin-bottom: 0; 17 | } 18 | 19 | .alert.s-sample-info .s-sample-premium-source { 20 | display: block; 21 | font-size: 0.75rem; 22 | } 23 | 24 | :root.pro .alert-dismissible button.close.btn-close { 25 | color: transparent; 26 | } 27 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryDialog.ts: -------------------------------------------------------------------------------- 1 | import { CategoryForm, CategoryRow, CategoryService } from "../ServerTypes/Demo"; 2 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 3 | 4 | @Decorators.registerClass('Serenity.Demo.Northwind.CategoryDialog') 5 | export class CategoryDialog

extends EntityDialog { 6 | protected getFormKey() { return CategoryForm.formKey; } 7 | protected getRowDefinition() { return CategoryRow; } 8 | protected getService() { return CategoryService.baseUrl; } 9 | 10 | protected form = new CategoryForm(this.idPrefix); 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/SalesByCategory/RequestHandlers/SalesByCategoryListHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.ListRequest; 2 | using MyResponse = Serenity.Services.ListResponse; 3 | using MyRow = Serenity.Demo.Northwind.SalesByCategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ISalesByCategoryListHandler : IListHandler { } 8 | 9 | public class SalesByCategoryListHandler(IRequestContext context) : 10 | ListRequestHandler(context), ISalesByCategoryListHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 2 | import { SupplierForm, SupplierRow, SupplierService } from "../ServerTypes/Demo"; 3 | 4 | @Decorators.registerClass('Serenity.Demo.Northwind.SupplierDialog') 5 | export class SupplierDialog

extends EntityDialog { 6 | protected getFormKey() { return SupplierForm.formKey; } 7 | protected getRowDefinition() { return SupplierRow; } 8 | protected getService() { return SupplierService.baseUrl; } 9 | 10 | protected form = new SupplierForm(this.idPrefix); 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Elevation/IElevationHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Abstractions; 2 | 3 | ///

4 | /// Interface for account elevation. 5 | /// 6 | public interface IElevationHandler 7 | { 8 | /// 9 | /// Appends ElevationToken to cookies. 10 | /// 11 | void AppendElevationTokenToCookies(); 12 | /// 13 | /// Checks to see if ElevationToken in cookies is valid. 14 | /// 15 | void ValidateElevationToken(); 16 | /// 17 | /// Deletes ElevationToken. 18 | /// 19 | void DeleteToken(); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20160121_1412_CustomerRepresentatives.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20160121_1412)] 6 | public class NorthwindDB_20160121_1412_CustomerRepresentatives : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | Create.Table("CustomerRepresentatives") 11 | .WithColumn("RepresentativeID").AsInt32().IdentityKey(this) 12 | .WithColumn("CustomerID").AsInt32().NotNullable() 13 | .WithColumn("EmployeeID").AsInt32().NotNullable(); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/RequestHandlers/OrderDetailRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.OrderDetailRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IOrderDetailRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class OrderDetailRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IOrderDetailRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ProductLang/RequestHandlers/ProductLangRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.ProductLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface IProductLangRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class ProductLangRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), IProductLangRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CategoryColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { CategoryRow } from "./Northwind.CategoryRow"; 4 | 5 | export interface CategoryColumns { 6 | CategoryID: Column; 7 | CategoryName: Column; 8 | Description: Column; 9 | } 10 | 11 | export class CategoryColumns extends ColumnsBase { 12 | static readonly columnsKey = 'Northwind.Category'; 13 | static readonly Fields = fieldsProxy(); 14 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/ForgotPasswordFormTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Forms.Membership.ForgotPassword.")] 4 | public static class ForgotPasswordFormTexts 5 | { 6 | public static readonly LocalText FormInfo = "Please enter the email you used to signup."; 7 | public static readonly LocalText FormTitle = "Forgot My Password"; 8 | public static readonly LocalText SubmitButton = "Reset My Password"; 9 | public static readonly LocalText SuccessMessage = "If this user exists, we have sent you an email with password reset instructions."; 10 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { ShipperColumns, ShipperRow, ShipperService } from "../ServerTypes/Demo"; 3 | import { ShipperDialog } from "./ShipperDialog"; 4 | 5 | @Decorators.registerClass() 6 | export class ShipperGrid

extends EntityGrid { 7 | protected getColumnsKey() { return ShipperColumns.columnsKey; } 8 | protected getDialogType() { return ShipperDialog; } 9 | protected getRowDefinition() { return ShipperRow; } 10 | protected getService() { return ShipperService.baseUrl; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 2 | import { TerritoryForm, TerritoryRow, TerritoryService } from "../ServerTypes/Demo"; 3 | 4 | @Decorators.registerClass('Serenity.Demo.Northwind.TerritoryDialog') 5 | export class TerritoryDialog

extends EntityDialog { 6 | protected getFormKey() { return TerritoryForm.formKey; } 7 | protected getRowDefinition() { return TerritoryRow; } 8 | protected getService() { return TerritoryService.baseUrl; } 9 | 10 | protected form = new TerritoryForm(this.idPrefix); 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/CategoryLang/RequestHandlers/CategoryLangRetrieveHandler.cs: -------------------------------------------------------------------------------- 1 | using MyRequest = Serenity.Services.RetrieveRequest; 2 | using MyResponse = Serenity.Services.RetrieveResponse; 3 | using MyRow = Serenity.Demo.Northwind.CategoryLangRow; 4 | 5 | namespace Serenity.Demo.Northwind; 6 | 7 | public interface ICategoryLangRetrieveHandler : IRetrieveHandler { } 8 | 9 | public class CategoryLangRetrieveHandler(IRequestContext context) : 10 | RetrieveRequestHandler(context), ICategoryLangRetrieveHandler 11 | { 12 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductDialog.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityDialog } from "@serenity-is/corelib"; 2 | import { ProductForm, ProductRow, ProductService } from "../ServerTypes/Demo"; 3 | import "./ProductDialog.css"; 4 | 5 | @Decorators.registerClass() 6 | @Decorators.maximizable() 7 | export class ProductDialog

extends EntityDialog { 8 | protected getFormKey() { return ProductForm.formKey; } 9 | protected getRowDefinition() { return ProductRow; } 10 | protected getService() { return ProductService.baseUrl; } 11 | 12 | protected form = new ProductForm(this.idPrefix); 13 | } 14 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/FilteredLookupInDetail/FilteredLookupInDetailPage.css: -------------------------------------------------------------------------------- 1 | 2 | .s-Demo-BasicSamples-FilteredLookupInDetailDialog > .size { 3 | width: 850px; 4 | height: 550px; 5 | } 6 | 7 | .s-Demo-BasicSamples-FilteredLookupInDetailDialog .caption { 8 | width: 150px; 9 | } 10 | 11 | .s-Demo-BasicSamples-FilteredLookupInDetailDialog .s-PropertyGrid .categories { 12 | overflow-y: auto; 13 | } 14 | 15 | .s-Demo-BasicSamples-FilteredLookupOrderDetailDialog > .size { 16 | min-width: 450px; 17 | width: 450px; 18 | } 19 | 20 | .s-Demo-BasicSamples-FilteredLookupOrderDetailDialog .caption { 21 | width: 80px; 22 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.Territory")] 4 | [BasedOnRow(typeof(TerritoryRow), CheckNames = true)] 5 | public class TerritoryColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), Width(100)] 8 | public int TerritoryID { get; set; } 9 | [EditLink, Width(200)] 10 | public string TerritoryDescription { get; set; } 11 | [EditLink(ItemType = "Demo.Northwind.Region", IdField = "RegionID"), Width(150)] 12 | [AsyncLookupEditor(typeof(RegionRow)), QuickFilter] 13 | public string RegionDescription { get; set; } 14 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { RegionColumns, RegionRow, RegionService } from "../ServerTypes/Demo"; 3 | import { RegionDialog } from "./RegionDialog"; 4 | 5 | @Decorators.registerClass('Serenity.Demo.Northwind.RegionGrid') 6 | export class RegionGrid

extends EntityGrid { 7 | protected getColumnsKey() { return RegionColumns.columnsKey; } 8 | protected getDialogType() { return RegionDialog; } 9 | protected getRowDefinition() { return RegionRow; } 10 | protected getService() { return RegionService.baseUrl; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.TerritoryColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { TerritoryRow } from "./Northwind.TerritoryRow"; 4 | 5 | export interface TerritoryColumns { 6 | TerritoryID: Column; 7 | TerritoryDescription: Column; 8 | RegionDescription: Column; 9 | } 10 | 11 | export class TerritoryColumns extends ColumnsBase { 12 | static readonly columnsKey = 'Northwind.Territory'; 13 | static readonly Fields = fieldsProxy(); 14 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo.ts: -------------------------------------------------------------------------------- 1 | export * from "./Demo/BasicSamples.BasicSamplesService" 2 | export * from "./Demo/BasicSamples.ChangingLookupTextForm" 3 | export * from "./Demo/BasicSamples.FilteredLookupInDetailForm" 4 | export * from "./Demo/BasicSamples.HardcodedValuesForm" 5 | export * from "./Demo/BasicSamples.InlineImageInGridColumns" 6 | export * from "./Demo/BasicSamples.LookupFilterByMultipleForm" 7 | export * from "./Demo/BasicSamples.OrdersByShipperRequest" 8 | export * from "./Demo/BasicSamples.OrdersByShipperResponse" 9 | export * from "./Demo/BasicSamples.PopulateLinkedDataForm" 10 | export * from "./Demo/BasicSamples.StaticTextBlockForm" -------------------------------------------------------------------------------- /src/Serenity.Extensions/Serenity.Extensions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Category/CategoryGrid.ts: -------------------------------------------------------------------------------- 1 | import { CategoryColumns, CategoryRow, CategoryService } from "../ServerTypes/Demo"; 2 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 3 | import { CategoryDialog } from "./CategoryDialog"; 4 | 5 | @Decorators.registerClass('Serenity.Demo.Northwind.CategoryGrid') 6 | export class CategoryGrid

extends EntityGrid { 7 | protected getColumnsKey() { return CategoryColumns.columnsKey; } 8 | protected getDialogType() { return CategoryDialog; } 9 | protected getRowDefinition() { return CategoryRow; } 10 | protected getService() { return CategoryService.baseUrl; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { SupplierColumns, SupplierRow, SupplierService } from "../ServerTypes/Demo"; 3 | import { SupplierDialog } from "./SupplierDialog"; 4 | 5 | @Decorators.registerClass('Serenity.Demo.Northwind.SupplierGrid') 6 | export class SupplierGrid

extends EntityGrid { 7 | protected getColumnsKey() { return SupplierColumns.columnsKey; } 8 | protected getDialogType() { return SupplierDialog; } 9 | protected getRowDefinition() { return SupplierRow; } 10 | protected getService() { return SupplierService.baseUrl; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/SalesByCategory/SalesByCategoryEndpoint.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Data; 3 | using MyRow = Serenity.Demo.Northwind.SalesByCategoryRow; 4 | 5 | namespace Serenity.Demo.Northwind.Endpoints; 6 | 7 | [Route("Services/Serenity.Demo.Northwind/SalesByCategory/[action]")] 8 | [ConnectionKey(typeof(MyRow)), ServiceAuthorize(typeof(MyRow))] 9 | public class SalesByCategoryEndpoint : ServiceEndpoint 10 | { 11 | public ListResponse List(IDbConnection connection, ListRequest request, 12 | [FromServices] ISalesByCategoryListHandler handler) 13 | { 14 | return handler.List(connection, request); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Territory/TerritoryGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { TerritoryColumns, TerritoryRow, TerritoryService } from "../ServerTypes/Demo"; 3 | import { TerritoryDialog } from "./TerritoryDialog"; 4 | 5 | @Decorators.registerClass('Serenity.Demo.Northwind.TerritoryGrid') 6 | export class TerritoryGrid

extends EntityGrid { 7 | protected getColumnsKey() { return TerritoryColumns.columnsKey; } 8 | protected getDialogType() { return TerritoryDialog; } 9 | protected getRowDefinition() { return TerritoryRow; } 10 | protected getService() { return TerritoryService.baseUrl; } 11 | } 12 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.SalesByCategoryColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { SalesByCategoryRow } from "./Northwind.SalesByCategoryRow"; 4 | 5 | export interface SalesByCategoryColumns { 6 | CategoryName: Column; 7 | ProductName: Column; 8 | ProductSales: Column; 9 | } 10 | 11 | export class SalesByCategoryColumns extends ColumnsBase { 12 | static readonly columnsKey = 'Northwind.SalesByCategory'; 13 | static readonly Fields = fieldsProxy(); 14 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/EmailSender/EmailSenderExtensions.cs: -------------------------------------------------------------------------------- 1 | using MimeKit; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public static class EmailSenderExtensions 6 | { 7 | public static void Send(this IEmailSender emailSender, string subject, string body, string mailTo) 8 | { 9 | var message = new MimeMessage(); 10 | ArgumentNullException.ThrowIfNull(mailTo); 11 | message.To.Add(MailboxAddress.Parse(mailTo)); 12 | message.Subject = subject; 13 | var bodyBuilder = new BodyBuilder 14 | { 15 | HtmlBody = body 16 | }; 17 | message.Body = bodyBuilder.ToMessageBody(); 18 | emailSender.Send(message); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Formatters/SingleLineTextFormatter.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, Formatter, htmlEncode, toSingleLine } from "@serenity-is/corelib"; 2 | import { FormatterContext } from "@serenity-is/sleekgrid"; 3 | 4 | @Decorators.registerFormatter('Serenity.Extensions.SingleLineTextFormatter') 5 | export class SingleLineTextFormatter implements Formatter { 6 | format(ctx: FormatterContext) { 7 | return SingleLineTextFormatter.formatValue(ctx.value); 8 | } 9 | 10 | public static formatValue(value: string) { 11 | var div = document.createElement("div"); 12 | div.innerHTML = value ?? ''; 13 | return htmlEncode(toSingleLine(div.textContent)); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { CustomerColumns, CustomerRow, CustomerService } from "../ServerTypes/Demo"; 3 | import { CustomerDialog } from "./CustomerDialog"; 4 | 5 | @Decorators.registerClass('Serenity.Demo.Norhtwind.CustomerGrid') 6 | @Decorators.filterable() 7 | export class CustomerGrid extends EntityGrid { 8 | protected getColumnsKey() { return CustomerColumns.columnsKey; } 9 | protected getDialogType() { return CustomerDialog; } 10 | protected getRowDefinition() { return CustomerRow; } 11 | protected getService() { return CustomerService.baseUrl; } 12 | } 13 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/RequestHandlers/CustomerGetNextNumberHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using MyRow = Serenity.Demo.Northwind.CustomerRow; 3 | 4 | namespace Serenity.Demo.Northwind; 5 | 6 | public interface ICustomerGetNextNumberHandler : IRequestHandler 7 | { 8 | GetNextNumberResponse GetNextNumber(IDbConnection connection, GetNextNumberRequest request); 9 | } 10 | 11 | public class CustomerGetNextNumberHandler : ICustomerGetNextNumberHandler 12 | { 13 | public GetNextNumberResponse GetNextNumber(IDbConnection connection, GetNextNumberRequest request) 14 | { 15 | return GetNextNumberHelper.GetNextNumber(connection, request, MyRow.Fields.CustomerID); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Reporting/Tree/DefaultReportTreeFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Reporting; 2 | 3 | public class DefaultReportTreeFactory(IReportRegistry reportRegistry, ITextLocalizer localizer) : IReportTreeFactory 4 | { 5 | private readonly IReportRegistry reportRegistry = reportRegistry ?? throw new ArgumentNullException(nameof(reportRegistry)); 6 | private readonly ITextLocalizer localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); 7 | 8 | public ReportTree BuildReportTree(string category) 9 | { 10 | var reports = reportRegistry.GetAvailableReportsInCategory(category); 11 | return ReportTree.FromList(reports, localizer, category); 12 | } 13 | } -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | 9 | [*.{css,csproj,esproj,json,props,targets}] 10 | indent_size = 2 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [*.cs] 16 | # IDE0130:Namespace does not match folder structure 17 | dotnet_diagnostic.IDE0130.severity = none 18 | 19 | [*Endpoint.cs] 20 | # CA1822: Mark members as static 21 | dotnet_diagnostic.CA1822.severity = none 22 | 23 | [*Texts*.cs] 24 | # CS1591: Missing XML comment for publicly visible type or member 25 | dotnet_diagnostic.CS1591.severity = none 26 | # CA2211: Non-constant fields should not be visible 27 | dotnet_diagnostic.CA2211.severity = none 28 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shipper/ShipperFormatter.tsx: -------------------------------------------------------------------------------- 1 | import { Decorators, Formatter, faIcon } from "@serenity-is/corelib"; 2 | import { FormatterContext, FormatterResult } from "@serenity-is/sleekgrid"; 3 | 4 | @Decorators.registerFormatter('Serenity.Demo.Northwind.ShipperFormatter') 5 | export class ShipperFormatter implements Formatter { 6 | format(ctx: FormatterContext): FormatterResult { 7 | 8 | if (!ctx.value) { 9 | return <>{ctx.value}; 10 | } 11 | 12 | return (<> {ctx.value}); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Supplier")] 4 | [BasedOnRow(typeof(SupplierRow), CheckNames = true)] 5 | public class SupplierForm 6 | { 7 | public string CompanyName { get; set; } 8 | public string ContactName { get; set; } 9 | public string ContactTitle { get; set; } 10 | public string Address { get; set; } 11 | public string Region { get; set; } 12 | public string PostalCode { get; set; } 13 | public string Country { get; set; } 14 | public string City { get; set; } 15 | public string Phone { get; set; } 16 | public string Fax { get; set; } 17 | public string HomePage { get; set; } 18 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Reporting/DataReport/DataReportExcelRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace Serenity.Reporting; 4 | 5 | public class DataReportExcelRenderer : IDataReportExcelRenderer 6 | { 7 | public byte[] Render(IDataOnlyReport report) 8 | { 9 | ArgumentNullException.ThrowIfNull(report); 10 | 11 | var columns = report.GetColumnList(); 12 | 13 | var data = new List(); 14 | var input = report.GetData(); 15 | var list = (input as IEnumerable) ?? new List { input }; 16 | foreach (var item in list) 17 | data.Add(item); 18 | 19 | return ExcelReportGenerator.GeneratePackageBytes(columns, data); 20 | } 21 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: "[Feature Request]" 5 | labels: under-review 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Imports/ClientTypes/Demo.BasicSamples.InlineImageFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples; 2 | 3 | public partial class InlineImageFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Demo.BasicSamples.InlineImageFormatter"; 6 | 7 | public InlineImageFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | 12 | public string FileProperty 13 | { 14 | get { return GetOption("fileProperty"); } 15 | set { SetOption("fileProperty", value); } 16 | } 17 | 18 | public bool Thumb 19 | { 20 | get { return GetOption("thumb"); } 21 | set { SetOption("thumb", value); } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Grids/InlineImageInGrid/InlineImageInGridColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.Columns; 2 | 3 | [ColumnsScript("BasicSamples.InlineImageInGrid")] 4 | [BasedOnRow(typeof(Northwind.ProductRow), CheckNames = true)] 5 | public class InlineImageInGridColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), AlignRight] 8 | public String ProductID { get; set; } 9 | [EditLink, Width(250)] 10 | public String ProductName { get; set; } 11 | [InlineImageFormatter, Width(450)] 12 | public String ProductImage { get; set; } 13 | [NotMapped, InlineImageFormatter(FileProperty = "ProductImage", Thumb = true), Width(450)] 14 | public String ProductThumbnail { get; set; } 15 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.OrderDetailColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { OrderDetailRow } from "./Northwind.OrderDetailRow"; 4 | 5 | export interface OrderDetailColumns { 6 | ProductName: Column; 7 | UnitPrice: Column; 8 | Quantity: Column; 9 | Discount: Column; 10 | LineTotal: Column; 11 | } 12 | 13 | export class OrderDetailColumns extends ColumnsBase { 14 | static readonly columnsKey = 'Northwind.OrderDetail'; 15 | static readonly Fields = fieldsProxy(); 16 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Imports/MVC/MVC.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Serenity.Extensions.MVC; 3 | 4 | public static class Views 5 | { 6 | public static class Membership 7 | { 8 | public static class PasswordActions 9 | { 10 | public const string ResetPasswordEmail = "~/Areas/Serenity.Extensions/Membership/PasswordActions/ResetPasswordEmail.cshtml"; 11 | } 12 | } 13 | 14 | public static class ModulePage 15 | { 16 | public const string ModulePage_ = "~/Areas/Serenity.Extensions/ModulePage/ModulePage.cshtml"; 17 | } 18 | 19 | public static class Reporting 20 | { 21 | public const string ReportPage = "~/Areas/Serenity.Extensions/Reporting/ReportPage.cshtml"; 22 | } 23 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/EmailSender/SmtpSettings.cs: -------------------------------------------------------------------------------- 1 | using MailKit.Security; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | [DefaultSectionKey(SectionKey)] 6 | public class SmtpSettings 7 | { 8 | public const string SectionKey = "SmtpSettings"; 9 | 10 | public string Host { get; set; } 11 | public int Port { get; set; } 12 | public SecureSocketOptions SecureSocket { get; set; } 13 | public string Username { get; set; } 14 | public string Password { get; set; } 15 | public string From { get; set; } 16 | public string PickupPath { get; set; } 17 | public bool AutoUseQueue { get; set; } 18 | 19 | public SmtpSettings() 20 | { 21 | SecureSocket = SecureSocketOptions.Auto; 22 | } 23 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "forceConsistentCasingInFileNames": true, 7 | "inlineSources": true, 8 | "isolatedModules": true, 9 | "jsx": "react-jsx", 10 | "jsxImportSource": "jsx-dom/min", 11 | "lib": [ 12 | "ES2017", 13 | "DOM" 14 | ], 15 | "module": "ESNext", 16 | "moduleResolution": "Bundler", 17 | "newLine": "lf", 18 | "preserveConstEnums": true, 19 | "preserveSymlinks": true, 20 | "skipLibCheck": true, 21 | "sourceMap": true, 22 | "target": "ES2017", 23 | "types": [ 24 | ], 25 | "useDefineForClassFields": false 26 | } 27 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Shared/NorthwindPermissionKeys.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | [NestedPermissionKeys] 4 | [DisplayName("Northwind")] 5 | public class PermissionKeys 6 | { 7 | [DisplayName("Customers")] 8 | public class Customer 9 | { 10 | [ImplicitPermission(General), ImplicitPermission(View)] 11 | public const string Delete = "Northwind:Customer:Delete"; 12 | [Description("Create/Update"), ImplicitPermission(General), ImplicitPermission(View)] 13 | public const string Modify = "Northwind:Customer:Modify"; 14 | public const string View = "Northwind:Customer:View"; 15 | } 16 | 17 | [Description("[General]")] 18 | public const string General = "Northwind:General"; 19 | } 20 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@serenity-is/demo.northwind", 3 | "dependencies": { 4 | "@serenity-is/extensions": "workspace:*", 5 | "@types/dompurify": "3.0.5", 6 | "dompurify": "3.1.6" 7 | }, 8 | "main": "dist/index.js", 9 | "private": true, 10 | "scripts": { 11 | "build": "node ./tsbuild.js", 12 | "build:watch": "node ./tsbuild.js --watch", 13 | "dts": "pnpm dts-bundle-generator Modules/index.ts -o dist/index.d.ts --no-banner --disable-symlinks-following --inline-declare-global", 14 | "jest": "node ../../../Serenity/node_modules/jest/bin/jest.js", 15 | "test": "node ./tsbuild.js && pnpm jest --coverage", 16 | "tsc": "tsc" 17 | }, 18 | "type": "module", 19 | "types": "dist/index.d.ts" 20 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/MigrationUtils/MigrationAttributeBase.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Extensions; 4 | 5 | public abstract class MigrationAttributeBase : MigrationAttribute 6 | { 7 | public MigrationAttributeBase(long version, TransactionBehavior transactionBehavior = TransactionBehavior.Default, string description = null) 8 | : base((version >= 20010101_0000 && version <= 99990101_0000) ? version * 100 : version, transactionBehavior, description) 9 | { 10 | if (Version < 20010101_000000 || Version > 99990101_000000) 11 | throw new Exception("Migration versions must be in yyyyMMdd_HHmm or " + 12 | "yyyyMMdd_HHmm_ss format! Version " + version + " is incorrect."); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerEditor.ts: -------------------------------------------------------------------------------- 1 | import { CustomerRow } from "../ServerTypes/Demo"; 2 | import { Decorators, EditorProps, LookupEditorBase, LookupEditorOptions } from "@serenity-is/corelib"; 3 | 4 | @Decorators.registerEditor('Serenity.Demo.Northwind.CustomerEditor') 5 | export class CustomerEditor

extends LookupEditorBase { 6 | 7 | constructor(props: EditorProps

) { 8 | super({ async: true, ...props }); 9 | } 10 | 11 | protected getLookupKey() { 12 | return 'Northwind.Customer'; 13 | } 14 | 15 | protected getItemText(item, lookup) { 16 | return super.getItemText(item, lookup) + ' [' + item.CustomerID + ']'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Areas/Serenity.Demo.Northwind/Order/OrderIndex.cshtml: -------------------------------------------------------------------------------- 1 | @inject ITextLocalizer Localizer 2 | @{ 3 | 4 | ViewData["Title"] = Localizer.Get(OrderRow.Fields.PageTitle()); 5 | } 6 | 7 | @section Head { 8 | @Html.Script("dynamic://Lookup.Northwind.Customer") 9 | @Html.Script("dynamic://Lookup.Northwind.CustomerCountry") 10 | @Html.Script("dynamic://Lookup.Northwind.CustomerCity") 11 | @Html.Script("dynamic://Lookup.Northwind.Employee") 12 | @Html.Script("dynamic://Lookup.Northwind.OrderShipCountry") 13 | @Html.Script("dynamic://Lookup.Northwind.OrderShipCity") 14 | @Html.Script("dynamic://Lookup.Northwind.Product") 15 | @Html.Script("dynamic://Lookup.Northwind.Shipper") 16 | } 17 | 18 |

19 | 20 | @Html.ModulePageInit(ESM.OrderPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Reports/GoogleSearchReport.cs: -------------------------------------------------------------------------------- 1 | using Serenity.Reporting; 2 | 3 | namespace Serenity.Demo.Northwind.Reports; 4 | 5 | /// 6 | /// This is an external report sample that opens a Google search page on execute. 7 | /// You could open any other page, internal or external, e.g. an SSRS report web page 8 | /// 9 | [Report] 10 | [Category("Northwind/Orders"), DisplayName("Google Search - External Report Sample")] 11 | public class GoogleSearchReport : IReport, IExternalReport 12 | { 13 | [DisplayName("Search Query"), Required(true)] 14 | public string Query { get; set; } 15 | 16 | public object GetData() 17 | { 18 | return "https://www.google.com.tr/search?q=" + Uri.EscapeDataString(Query); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20151226_1845_Notes.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20151226_1845)] 6 | public class NorthwindDB_20151226_1845_Notes : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | Create.Table("Notes") 11 | .WithColumn("NoteID").AsInt64().IdentityKey(this) 12 | .WithColumn("EntityType").AsString(100).NotNullable() 13 | .WithColumn("EntityID").AsInt64().NotNullable() 14 | .WithColumn("Text").AsString(int.MaxValue).NotNullable() 15 | .WithColumn("InsertUserId").AsInt32().NotNullable() 16 | .WithColumn("InsertDate").AsDateTime().NotNullable(); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Areas/Serenity.Extensions/ModulePage/ModulePage.cshtml: -------------------------------------------------------------------------------- 1 | @model ModulePageModel 2 | @inject ITextLocalizer Localizer 3 | @inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment HostEnvironment 4 | @{ 5 | if (Model.PageTitle != null) 6 | ViewData["Title"] = Model.PageTitle.ToString(Localizer); 7 | if (Model.PageId != null) 8 | ViewData["PageId"] = Model.PageId; 9 | if (Model.Layout != null) 10 | Layout = Model.Layout; 11 | } 12 | @Html.AutoIncludeModuleCss(Model.Module) 13 | @Html.Raw(Model.HtmlMarkup) 14 | 15 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ForgotPasswordForm.ts: -------------------------------------------------------------------------------- 1 | import { EmailAddressEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface ForgotPasswordForm { 4 | Email: EmailAddressEditor; 5 | } 6 | 7 | export class ForgotPasswordForm extends PrefixedContext { 8 | static readonly formKey = 'Serenity.Extensions.ForgotPasswordRequest'; 9 | private static init: boolean; 10 | 11 | constructor(prefix: string) { 12 | super(prefix); 13 | 14 | if (!ForgotPasswordForm.init) { 15 | ForgotPasswordForm.init = true; 16 | 17 | var w0 = EmailAddressEditor; 18 | 19 | initFormType(ForgotPasswordForm, [ 20 | 'Email', w0 21 | ]); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Product/ProductForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [FormScript("Northwind.Product")] 4 | [BasedOnRow(typeof(ProductRow), CheckNames = true)] 5 | public class ProductForm 6 | { 7 | [Category("General")] 8 | public string ProductName { get; set; } 9 | public string ProductImage { get; set; } 10 | public bool Discontinued { get; set; } 11 | public int SupplierID { get; set; } 12 | public int CategoryID { get; set; } 13 | [Category("Pricing")] 14 | public string QuantityPerUnit { get; set; } 15 | public decimal UnitPrice { get; set; } 16 | [Category("Status")] 17 | public short UnitsInStock { get; set; } 18 | public short UnitsOnOrder { get; set; } 19 | public short ReorderLevel { get; set; } 20 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Areas/Serenity.Extensions/Membership/PasswordActions/ResetPasswordEmail.cshtml: -------------------------------------------------------------------------------- 1 | @model Serenity.Extensions.ResetPasswordEmailModel 2 | @inject Serenity.ITextLocalizer Localizer 3 | 4 | 5 | 6 | Reset your @Localizer.Get("Navigation.SiteTitle") password 7 | 8 | 9 |

@Model.DisplayName,

10 | 11 |

We received a request to change your password on @Localizer.Get("Navigation.SiteTitle").

12 | 13 |

Click the link below to set a new password:

14 | 15 |

@Model.ResetLink

16 | 17 |

If you don't want to change your password, you can ignore this email.

18 | 19 | Thanks, 20 | The "@Localizer.Get("Navigation.SiteTitle")" Team 21 | 22 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/UserPreferenceRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface UserPreferenceRow { 4 | UserPreferenceId?: number; 5 | UserId?: number; 6 | PreferenceType?: string; 7 | Name?: string; 8 | Value?: string; 9 | } 10 | 11 | export abstract class UserPreferenceRow { 12 | static readonly idProperty = 'UserPreferenceId'; 13 | static readonly nameProperty = 'Name'; 14 | static readonly localTextPrefix = 'Common.UserPreference'; 15 | static readonly deletePermission = ''; 16 | static readonly insertPermission = ''; 17 | static readonly readPermission = ''; 18 | static readonly updatePermission = ''; 19 | 20 | static readonly Fields = fieldsProxy(); 21 | } 22 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CategoryForm.ts: -------------------------------------------------------------------------------- 1 | import { StringEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface CategoryForm { 4 | CategoryName: StringEditor; 5 | Description: StringEditor; 6 | } 7 | 8 | export class CategoryForm extends PrefixedContext { 9 | static readonly formKey = 'Northwind.Category'; 10 | private static init: boolean; 11 | 12 | constructor(prefix: string) { 13 | super(prefix); 14 | 15 | if (!CategoryForm.init) { 16 | CategoryForm.init = true; 17 | 18 | var w0 = StringEditor; 19 | 20 | initFormType(CategoryForm, [ 21 | 'CategoryName', w0, 22 | 'Description', w0 23 | ]); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.SalesByCategoryRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface SalesByCategoryRow { 4 | CategoryId?: number; 5 | CategoryName?: string; 6 | ProductName?: string; 7 | ProductSales?: number; 8 | } 9 | 10 | export abstract class SalesByCategoryRow { 11 | static readonly nameProperty = 'CategoryName'; 12 | static readonly localTextPrefix = 'Northwind.SalesByCategory'; 13 | static readonly deletePermission = 'Northwind:General'; 14 | static readonly insertPermission = 'Northwind:General'; 15 | static readonly readPermission = 'Northwind:General'; 16 | static readonly updatePermission = 'Northwind:General'; 17 | 18 | static readonly Fields = fieldsProxy(); 19 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.SupplierColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { SupplierRow } from "./Northwind.SupplierRow"; 4 | 5 | export interface SupplierColumns { 6 | SupplierID: Column; 7 | CompanyName: Column; 8 | ContactName: Column; 9 | ContactTitle: Column; 10 | Phone: Column; 11 | Region: Column; 12 | Country: Column; 13 | City: Column; 14 | } 15 | 16 | export class SupplierColumns extends ColumnsBase { 17 | static readonly columnsKey = 'Northwind.Supplier'; 18 | static readonly Fields = fieldsProxy(); 19 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ClamAV/ClamAVSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | /// 4 | /// Settings for ClamAV 5 | /// 6 | [DefaultSectionKey(SectionKey)] 7 | public class ClamAVSettings 8 | { 9 | /// 10 | /// Default section key for ClamAV 11 | /// 12 | public const string SectionKey = "ClamAV"; 13 | 14 | /// 15 | /// If ClamAV scanning is enabled 16 | /// 17 | public bool Enabled { get; set; } = true; 18 | 19 | /// 20 | /// Host to connect to, default is localhost 21 | /// 22 | public string Host { get; set; } = "localhost"; 23 | 24 | /// 25 | /// Port to connect to, default is 3310 26 | /// 27 | public int Port { get; set; } = 3310; 28 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerCountryLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class CustomerCountryLookup : RowLookupScript 5 | { 6 | public CustomerCountryLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = TextField = "Country"; 10 | } 11 | 12 | protected override void PrepareQuery(SqlQuery query) 13 | { 14 | var fld = CustomerRow.Fields; 15 | query.Distinct(true) 16 | .Select(fld.Country) 17 | .Where( 18 | new Criteria(fld.Country) != "" & 19 | new Criteria(fld.Country).IsNotNull()); 20 | } 21 | 22 | protected override void ApplyOrder(SqlQuery query) 23 | { 24 | } 25 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.ProductLangRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface ProductLangRow { 4 | Id?: number; 5 | ProductId?: number; 6 | LanguageId?: number; 7 | ProductName?: string; 8 | } 9 | 10 | export abstract class ProductLangRow { 11 | static readonly idProperty = 'Id'; 12 | static readonly nameProperty = 'ProductName'; 13 | static readonly localTextPrefix = 'Northwind.ProductLang'; 14 | static readonly deletePermission = 'Northwind:General'; 15 | static readonly insertPermission = 'Northwind:General'; 16 | static readonly readPermission = 'Northwind:General'; 17 | static readonly updatePermission = 'Northwind:General'; 18 | 19 | static readonly Fields = fieldsProxy(); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Grids/EnablingRowSelection/EnablingRowSelectionPage.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, gridPageInit } from "@serenity-is/corelib"; 2 | import { SupplierColumns, SupplierDialog, SupplierRow, SupplierService } from "@serenity-is/demo.northwind"; 3 | import { SelectableEntityGrid } from "@serenity-is/extensions"; 4 | 5 | export default () => gridPageInit(RowSelectionGrid); 6 | 7 | @Decorators.registerClass('Serenity.Demo.BasicSamples.RowSelectionGrid') 8 | export class RowSelectionGrid

extends SelectableEntityGrid { 9 | protected getColumnsKey() { return SupplierColumns.columnsKey; } 10 | protected getDialogType() { return SupplierDialog; } 11 | protected getRowDefinition() { return SupplierRow; } 12 | protected getService() { return SupplierService.baseUrl; } 13 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierCountryLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class SupplierCountryLookup : RowLookupScript 5 | { 6 | public SupplierCountryLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = TextField = "Country"; 10 | } 11 | 12 | protected override void PrepareQuery(SqlQuery query) 13 | { 14 | var fld = SupplierRow.Fields; 15 | query.Distinct(true) 16 | .Select(fld.Country) 17 | .Where( 18 | new Criteria(fld.Country) != "" & 19 | new Criteria(fld.Country).IsNotNull()); 20 | } 21 | 22 | protected override void ApplyOrder(SqlQuery query) 23 | { 24 | } 25 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordActions/SetPasswordPageTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Forms.Membership.SetPassword.")] 4 | public static class SetPasswordFormTexts 5 | { 6 | public static readonly LocalText ElevatedActionsMessage = "You need to set a password for your account to make elevated actions."; 7 | public static readonly LocalText EmailSentMessage = "We have sent you an email with password reset instructions."; 8 | public static readonly LocalText EmailToSetPasswordMessage = "Looks like you don't have a password set in your account. Click button to get an email for setting your password."; 9 | public static readonly LocalText PageTitle = "Set Password"; 10 | public static readonly LocalText SendEmailButton = "Send email to reset password"; 11 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerDemographicRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CustomerDemographicRow { 4 | ID?: number; 5 | CustomerTypeID?: string; 6 | CustomerDesc?: string; 7 | } 8 | 9 | export abstract class CustomerDemographicRow { 10 | static readonly idProperty = 'ID'; 11 | static readonly nameProperty = 'CustomerTypeID'; 12 | static readonly localTextPrefix = 'Northwind.CustomerDemographic'; 13 | static readonly deletePermission = 'Northwind:General'; 14 | static readonly insertPermission = 'Northwind:General'; 15 | static readonly readPermission = 'Northwind:General'; 16 | static readonly updatePermission = 'Northwind:General'; 17 | 18 | static readonly Fields = fieldsProxy(); 19 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerRepresentativesRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CustomerRepresentativesRow { 4 | RepresentativeId?: number; 5 | CustomerId?: number; 6 | EmployeeId?: number; 7 | } 8 | 9 | export abstract class CustomerRepresentativesRow { 10 | static readonly idProperty = 'RepresentativeId'; 11 | static readonly localTextPrefix = 'Northwind.CustomerRepresentatives'; 12 | static readonly deletePermission = 'Northwind:Customer:View'; 13 | static readonly insertPermission = 'Northwind:Customer:View'; 14 | static readonly readPermission = 'Northwind:Customer:View'; 15 | static readonly updatePermission = 'Northwind:Customer:View'; 16 | 17 | static readonly Fields = fieldsProxy(); 18 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerGrossSalesRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CustomerGrossSalesRow { 4 | CustomerId?: string; 5 | ContactName?: string; 6 | ProductId?: number; 7 | ProductName?: string; 8 | GrossAmount?: number; 9 | } 10 | 11 | export abstract class CustomerGrossSalesRow { 12 | static readonly nameProperty = 'ContactName'; 13 | static readonly localTextPrefix = 'Northwind.CustomerGrossSales'; 14 | static readonly deletePermission = 'Northwind:General'; 15 | static readonly insertPermission = 'Northwind:General'; 16 | static readonly readPermission = 'Northwind:General'; 17 | static readonly updatePermission = 'Northwind:General'; 18 | 19 | static readonly Fields = fieldsProxy(); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20161013_0025_CustomerDetails.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20161013_0025)] 6 | public class NorthwindDB_20161013_0025_CustomerDetails : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | Create.Table("CustomerDetails") 11 | .WithColumn("ID").AsInt32().PrimaryKey().NotNullable() 12 | .WithColumn("LastContactDate").AsDateTime().Nullable() 13 | .WithColumn("LastContactedBy").AsInt32().Nullable() 14 | .ForeignKey("FK_CustomerDetails_LastContactedBy", "Employees", "EmployeeID") 15 | .WithColumn("Email").AsString(100).Nullable() 16 | .WithColumn("SendBulletin").AsBoolean().NotNullable().WithDefaultValue(true); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CategoryLangRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CategoryLangRow { 4 | Id?: number; 5 | CategoryId?: number; 6 | LanguageId?: number; 7 | CategoryName?: string; 8 | Description?: string; 9 | } 10 | 11 | export abstract class CategoryLangRow { 12 | static readonly idProperty = 'Id'; 13 | static readonly nameProperty = 'CategoryName'; 14 | static readonly localTextPrefix = 'Northwind.CategoryLang'; 15 | static readonly deletePermission = 'Northwind:General'; 16 | static readonly insertPermission = 'Northwind:General'; 17 | static readonly readPermission = 'Northwind:General'; 18 | static readonly updatePermission = 'Northwind:General'; 19 | 20 | static readonly Fields = fieldsProxy(); 21 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.RegionForm.ts: -------------------------------------------------------------------------------- 1 | import { IntegerEditor, StringEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface RegionForm { 4 | RegionID: IntegerEditor; 5 | RegionDescription: StringEditor; 6 | } 7 | 8 | export class RegionForm extends PrefixedContext { 9 | static readonly formKey = 'Northwind.Region'; 10 | private static init: boolean; 11 | 12 | constructor(prefix: string) { 13 | super(prefix); 14 | 15 | if (!RegionForm.init) { 16 | RegionForm.init = true; 17 | 18 | var w0 = IntegerEditor; 19 | var w1 = StringEditor; 20 | 21 | initFormType(RegionForm, [ 22 | 'RegionID', w0, 23 | 'RegionDescription', w1 24 | ]); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderShipCountryLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class OrderShipCountryLookup : RowLookupScript 5 | { 6 | public OrderShipCountryLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = TextField = OrderRow.Fields.ShipCountry.PropertyName; 10 | } 11 | 12 | protected override void PrepareQuery(SqlQuery query) 13 | { 14 | var fld = OrderRow.Fields; 15 | query.Distinct(true) 16 | .Select(fld.ShipCountry) 17 | .Where( 18 | new Criteria(fld.ShipCountry) != "" & 19 | new Criteria(fld.ShipCountry).IsNotNull()); 20 | } 21 | 22 | protected override void ApplyOrder(SqlQuery query) 23 | { 24 | } 25 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Membership/PasswordStrength/PasswordStrengthValidationTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Validation.")] 4 | public static class PasswordStrengthValidationTexts 5 | { 6 | public static readonly LocalText MinRequiredPasswordLength = "Entered password doesn't have enough characters (min {0})!"; 7 | public static readonly LocalText PasswordStrengthRequireDigit = "Password must contain a digit (0-9)."; 8 | public static readonly LocalText PasswordStrengthRequireLowercase = "Password must contain a lowercase (a-z) letter."; 9 | public static readonly LocalText PasswordStrengthRequireUppercase = "Password must contain an uppercase (A-Z) letter."; 10 | public static readonly LocalText PasswordStrengthRequireNonAlphanumeric = "Password must contain a non-alphanumeric character."; 11 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ResetPasswordForm.ts: -------------------------------------------------------------------------------- 1 | import { PasswordEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface ResetPasswordForm { 4 | NewPassword: PasswordEditor; 5 | ConfirmPassword: PasswordEditor; 6 | } 7 | 8 | export class ResetPasswordForm extends PrefixedContext { 9 | static readonly formKey = 'Serenity.Extensions.ResetPasswordRequest'; 10 | private static init: boolean; 11 | 12 | constructor(prefix: string) { 13 | super(prefix); 14 | 15 | if (!ResetPasswordForm.init) { 16 | ResetPasswordForm.init = true; 17 | 18 | var w0 = PasswordEditor; 19 | 20 | initFormType(ResetPasswordForm, [ 21 | 'NewPassword', w0, 22 | 'ConfirmPassword', w0 23 | ]); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/Widgets/SelectableEntityGrid.ts: -------------------------------------------------------------------------------- 1 | import { Decorators, EntityGrid } from "@serenity-is/corelib"; 2 | import { Grid, GridOptions, RowSelectionModel } from "@serenity-is/sleekgrid"; 3 | 4 | @Decorators.registerClass("Serenity.Extensions.SelectableEntityGrid") 5 | export class SelectableEntityGrid extends EntityGrid { 6 | 7 | protected getSlickOptions(): GridOptions { 8 | var opt = super.getSlickOptions(); 9 | opt.enableTextSelectionOnCells = true; 10 | opt.selectedCellCssClass = "slick-row-selected"; 11 | opt.enableCellNavigation = true; 12 | return opt; 13 | } 14 | 15 | protected createSlickGrid(): Grid { 16 | var grid = super.createSlickGrid(); 17 | grid.setSelectionModel(new RowSelectionModel()); 18 | return grid; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Reports/ReportsPage.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Serenity.Reporting; 3 | 4 | namespace Serenity.Demo.Northwind; 5 | 6 | [PageAuthorize(PermissionKeys.General)] 7 | public class ReportsPage(IReportRegistry reportRegistry, IRequestContext context) : Controller 8 | { 9 | protected IReportRegistry ReportRegistry { get; } = reportRegistry ?? 10 | throw new ArgumentNullException(nameof(reportRegistry)); 11 | protected IRequestContext Context { get; } = context ?? 12 | throw new ArgumentNullException(nameof(context)); 13 | 14 | [Route("Northwind/Reports")] 15 | public ActionResult Index([FromServices] IReportTreeFactory reportTreeFactory) 16 | { 17 | return View(Extensions.MVC.Views.Reporting.ReportPage, 18 | reportTreeFactory.BuildReportTree("Northwind")); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerCustomerDemoRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CustomerCustomerDemoRow { 4 | ID?: number; 5 | CustomerID?: string; 6 | CustomerTypeID?: string; 7 | CustomerCompanyName?: string; 8 | } 9 | 10 | export abstract class CustomerCustomerDemoRow { 11 | static readonly idProperty = 'ID'; 12 | static readonly nameProperty = 'CustomerID'; 13 | static readonly localTextPrefix = 'Northwind.CustomerCustomerDemo'; 14 | static readonly deletePermission = 'Northwind:General'; 15 | static readonly insertPermission = 'Northwind:General'; 16 | static readonly readPermission = 'Northwind:General'; 17 | static readonly updatePermission = 'Northwind:General'; 18 | 19 | static readonly Fields = fieldsProxy(); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.EmployeeTerritoryRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface EmployeeTerritoryRow { 4 | EmployeeID?: number; 5 | TerritoryID?: string; 6 | EmployeeFullName?: string; 7 | TerritoryDescription?: string; 8 | } 9 | 10 | export abstract class EmployeeTerritoryRow { 11 | static readonly idProperty = 'EmployeeID'; 12 | static readonly nameProperty = 'TerritoryID'; 13 | static readonly localTextPrefix = 'Northwind.EmployeeTerritory'; 14 | static readonly deletePermission = 'Northwind:General'; 15 | static readonly insertPermission = 'Northwind:General'; 16 | static readonly readPermission = 'Northwind:General'; 17 | static readonly updatePermission = 'Northwind:General'; 18 | 19 | static readonly Fields = fieldsProxy(); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.NoteRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface NoteRow { 4 | NoteId?: number; 5 | EntityType?: string; 6 | EntityId?: number; 7 | Text?: string; 8 | InsertUserId?: number; 9 | InsertDate?: string; 10 | InsertUserDisplayName?: string; 11 | } 12 | 13 | export abstract class NoteRow { 14 | static readonly idProperty = 'NoteId'; 15 | static readonly nameProperty = 'EntityType'; 16 | static readonly localTextPrefix = 'Northwind.Note'; 17 | static readonly deletePermission = 'Northwind:General'; 18 | static readonly insertPermission = 'Northwind:General'; 19 | static readonly readPermission = 'Northwind:General'; 20 | static readonly updatePermission = 'Northwind:General'; 21 | 22 | static readonly Fields = fieldsProxy(); 23 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.ShipperForm.ts: -------------------------------------------------------------------------------- 1 | import { StringEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | import { PhoneEditor } from "../../Shared/PhoneEditor"; 3 | 4 | export interface ShipperForm { 5 | CompanyName: StringEditor; 6 | Phone: PhoneEditor; 7 | } 8 | 9 | export class ShipperForm extends PrefixedContext { 10 | static readonly formKey = 'Northwind.Shipper'; 11 | private static init: boolean; 12 | 13 | constructor(prefix: string) { 14 | super(prefix); 15 | 16 | if (!ShipperForm.init) { 17 | ShipperForm.init = true; 18 | 19 | var w0 = StringEditor; 20 | var w1 = PhoneEditor; 21 | 22 | initFormType(ShipperForm, [ 23 | 'CompanyName', w0, 24 | 'Phone', w1 25 | ]); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo/BasicSamples.InlineImageInGridColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { ProductRow } from "@serenity-is/demo.northwind"; 3 | import { Column } from "@serenity-is/sleekgrid"; 4 | import { InlineImageFormatter } from "../../Grids/InlineImageInGrid/InlineImageInGridPage"; 5 | 6 | export interface InlineImageInGridColumns { 7 | ProductID: Column; 8 | ProductName: Column; 9 | ProductImage: Column; 10 | ProductThumbnail: Column; 11 | } 12 | 13 | export class InlineImageInGridColumns extends ColumnsBase { 14 | static readonly columnsKey = 'BasicSamples.InlineImageInGrid'; 15 | static readonly Fields = fieldsProxy(); 16 | } 17 | 18 | queueMicrotask(() => [InlineImageFormatter]); // referenced types -------------------------------------------------------------------------------- /src/Serenity.Extensions/Imports/ClientTypes/Extensions.EnumSelectFormatterAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public partial class EnumSelectFormatterAttribute : CustomFormatterAttribute 4 | { 5 | public const string Key = "Serenity.Extensions.EnumSelectFormatter"; 6 | 7 | public EnumSelectFormatterAttribute() 8 | : base(Key) 9 | { 10 | } 11 | 12 | public bool AllowClear 13 | { 14 | get { return GetOption("allowClear"); } 15 | set { SetOption("allowClear", value); } 16 | } 17 | 18 | public string EmptyItemText 19 | { 20 | get { return GetOption("emptyItemText"); } 21 | set { SetOption("emptyItemText", value); } 22 | } 23 | 24 | public string EnumKey 25 | { 26 | get { return GetOption("enumKey"); } 27 | set { SetOption("enumKey", value); } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Dialogs/DialogBoxes/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Dialog Box Types"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 12 |

Here are some samples for message dialog functions

13 |

Click buttons below to launch dialogs.

14 | 15 |

Source Files: 16 | @Html.BasicSamplesSourceFile("Index.cshtml"), 17 | @Html.BasicSamplesSourceFile("DialogBoxesPage.tsx") 18 |

19 |
20 | 21 |
22 | 23 | @Html.ModulePageInit(ESM.DialogBoxesPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo/BasicSamples.HardcodedValuesForm.ts: -------------------------------------------------------------------------------- 1 | import { PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | import { HardcodedValuesEditor } from "../../Editors/SelectWithHardcodedValues/SelectWithHardcodedValuesPage"; 3 | 4 | export interface HardcodedValuesForm { 5 | SomeValue: HardcodedValuesEditor; 6 | } 7 | 8 | export class HardcodedValuesForm extends PrefixedContext { 9 | static readonly formKey = 'BasicSamples.HarcodedValues'; 10 | private static init: boolean; 11 | 12 | constructor(prefix: string) { 13 | super(prefix); 14 | 15 | if (!HardcodedValuesForm.init) { 16 | HardcodedValuesForm.init = true; 17 | 18 | var w0 = HardcodedValuesEditor; 19 | 20 | initFormType(HardcodedValuesForm, [ 21 | 'SomeValue', w0 22 | ]); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Supplier/SupplierColumns.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Forms; 2 | 3 | [ColumnsScript("Northwind.Supplier")] 4 | [BasedOnRow(typeof(SupplierRow), CheckNames = true)] 5 | public class SupplierColumns 6 | { 7 | [EditLink, DisplayName("Db.Shared.RecordId"), AlignRight] 8 | public int SupplierID { get; set; } 9 | [EditLink, Width(250)] 10 | public string CompanyName { get; set; } 11 | [Width(150)] 12 | public string ContactName { get; set; } 13 | [Width(150)] 14 | public string ContactTitle { get; set; } 15 | [Width(120)] 16 | public string Phone { get; set; } 17 | [Width(80)] 18 | public string Region { get; set; } 19 | [Width(130)] 20 | [AsyncLookupEditor(typeof(Lookups.SupplierCountryLookup)), QuickFilter] 21 | public string Country { get; set; } 22 | [Width(130)] 23 | public string City { get; set; } 24 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Grids/InlineActionButtons/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Inline Action Buttons"; 3 | } 4 | 5 | @section Head { 6 | } 7 | 8 | @section ContentHeader { 9 |

@ViewData["Title"]

10 | } 11 | 12 |
13 | 14 |

Some inline action buttons to perform actions like delete / view / new order on row they are in.

15 | 16 |

Source Files: 17 | @Html.BasicSamplesSourceFile("Index.cshtml"), 18 | @Html.BasicSamplesSourceFile("InlineActionButtonsPage.tsx")

19 |
20 | 21 |
22 | 23 | @Html.ModulePageInit(ESM.InlineActionButtonsPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderRowAnnotations.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Annotations; 2 | 3 | /// 4 | /// This is annotation sample for OrderRow. Annotation types 5 | /// are normally not required, and you could put these attributes 6 | /// directly on OrderRow properties, but such an annotation type 7 | /// lets you to move out UI specific dependencies from the row, 8 | /// so that you could move OrderRow itself into a separate 9 | /// class library, e.g. a DLL with just the entities, if desired. 10 | /// 11 | [AnnotationType(typeof(OrderRow))] 12 | public sealed class OrderRowAnnotations 13 | { 14 | [CustomerEditor] 15 | public string CustomerID { get; set; } 16 | 17 | [AsyncLookupEditor(typeof(EmployeeRow))] 18 | public int? EmployeeID { get; set; } 19 | 20 | [AsyncLookupEditor(typeof(ShipperRow))] 21 | public int? ShipVia { get; set; } 22 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/OrderDetail/OrderDetailEndpoint.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Data; 3 | using MyRow = Serenity.Demo.Northwind.OrderDetailRow; 4 | 5 | namespace Serenity.Demo.Northwind.Endpoints; 6 | 7 | [Route("Services/Serenity.Demo.Northwind/OrderDetail/[action]")] 8 | [ConnectionKey(typeof(MyRow)), ServiceAuthorize(typeof(MyRow))] 9 | public class OrderDetailEndpoint : ServiceEndpoint 10 | { 11 | public RetrieveResponse Retrieve(IDbConnection connection, RetrieveRequest request, 12 | [FromServices] IOrderDetailRetrieveHandler handler) 13 | { 14 | return handler.Retrieve(connection, request); 15 | } 16 | 17 | public ListResponse List(IDbConnection connection, ListRequest request, 18 | [FromServices] IOrderDetailListHandler handler) 19 | { 20 | return handler.List(connection, request); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Dialogs/ReadOnlyDialog/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Read-Only Dialog"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 11 |

This sample demonstrates how to make a readonly version of a dialog.

12 |

Grid is also made read only by removing new button.

13 | 14 |

Source Files: 15 | @Html.BasicSamplesSourceFile("Index.cshtml"), 16 | @Html.BasicSamplesSourceFile("ReadOnlyDialogPage.ts") 17 |

18 |
19 | 20 |
21 | 22 | @Html.ModulePageInit(ESM.ReadOnlyDialogPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerDetailsRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface CustomerDetailsRow { 4 | Id?: number; 5 | LastContactDate?: string; 6 | LastContactedBy?: number; 7 | Email?: string; 8 | SendBulletin?: boolean; 9 | LastContactedByFullName?: string; 10 | } 11 | 12 | export abstract class CustomerDetailsRow { 13 | static readonly idProperty = 'Id'; 14 | static readonly nameProperty = 'Email'; 15 | static readonly localTextPrefix = 'Northwind.CustomerDetails'; 16 | static readonly deletePermission = 'Northwind:General'; 17 | static readonly insertPermission = 'Northwind:General'; 18 | static readonly readPermission = 'Northwind:General'; 19 | static readonly updatePermission = 'Northwind:General'; 20 | 21 | static readonly Fields = fieldsProxy(); 22 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.ProductColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { ProductRow } from "./Northwind.ProductRow"; 4 | 5 | export interface ProductColumns { 6 | ProductID: Column; 7 | ProductName: Column; 8 | Discontinued: Column; 9 | SupplierCompanyName: Column; 10 | CategoryName: Column; 11 | QuantityPerUnit: Column; 12 | UnitPrice: Column; 13 | UnitsInStock: Column; 14 | UnitsOnOrder: Column; 15 | ReorderLevel: Column; 16 | } 17 | 18 | export class ProductColumns extends ColumnsBase { 19 | static readonly columnsKey = 'Northwind.Product'; 20 | static readonly Fields = fieldsProxy(); 21 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.SalesByCategoryService.ts: -------------------------------------------------------------------------------- 1 | import { ListRequest, ListResponse, ServiceOptions, serviceRequest } from "@serenity-is/corelib"; 2 | import { SalesByCategoryRow } from "./Northwind.SalesByCategoryRow"; 3 | 4 | export namespace SalesByCategoryService { 5 | export const baseUrl = 'Serenity.Demo.Northwind/SalesByCategory'; 6 | 7 | export declare function List(request: ListRequest, onSuccess?: (response: ListResponse) => void, opt?: ServiceOptions): PromiseLike>; 8 | 9 | export const Methods = { 10 | List: "Serenity.Demo.Northwind/SalesByCategory/List" 11 | } as const; 12 | 13 | [ 14 | 'List' 15 | ].forEach(x => { 16 | (SalesByCategoryService)[x] = function (r, s, o) { 17 | return serviceRequest(baseUrl + '/' + x, r, s, o); 18 | }; 19 | }); 20 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/LookupFilterByMultipleValues/LookupFilterByMultipleForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.Forms; 2 | 3 | [FormScript("BasicSamples.LookupFilterByMultiple")] 4 | [BasedOnRow(typeof(Northwind.ProductRow), CheckNames = true)] 5 | public class LookupFilterByMultipleForm 6 | { 7 | [Category("General")] 8 | public String ProductName { get; set; } 9 | public String ProductImage { get; set; } 10 | public Boolean Discontinued { get; set; } 11 | public Int32 SupplierID { get; set; } 12 | [ProduceSeafoodCategoryEditor] 13 | public Int32 CategoryID { get; set; } 14 | [Category("Pricing")] 15 | public String QuantityPerUnit { get; set; } 16 | public Decimal UnitPrice { get; set; } 17 | [Category("Status")] 18 | public Int16 UnitsInStock { get; set; } 19 | public Int16 UnitsOnOrder { get; set; } 20 | public Int16 ReorderLevel { get; set; } 21 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/BulkActions/BulkServiceActionTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts(Prefix = "Site.BulkServiceAction.")] 4 | public static class BulkServiceActionTexts 5 | { 6 | public static readonly LocalText AllHadErrorsFormat = "All {0} record(s) that are processed had errors!"; 7 | public static readonly LocalText AllSuccessFormat = "Finished processing on {0} record(s) with success."; 8 | public static readonly LocalText ConfirmationFormat = "Perform this operation on {0} selected record(s)?"; 9 | public static readonly LocalText ErrorCount = "{0} error(s)"; 10 | public static readonly LocalText NothingToProcess = "Please select some records to process!"; 11 | public static readonly LocalText SomeHadErrorsFormat = "Finished processing on {0} record(s) with success. {1} record(s) had errors!"; 12 | public static readonly LocalText SuccessCount = "{0} done"; 13 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/UserPreference/UserPreferenceEndpoint.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using Microsoft.AspNetCore.Mvc; 3 | using MyRepository = Serenity.Extensions.Repositories.UserPreferenceRepository; 4 | using MyRow = Serenity.Extensions.Entities.UserPreferenceRow; 5 | 6 | namespace Serenity.Extensions.Endpoints; 7 | 8 | [Route("Services/Extensions/UserPreference/[action]")] 9 | [ConnectionKey(typeof(MyRow)), ServiceAuthorize] 10 | public class UserPreferenceEndpoint : ServiceEndpoint 11 | { 12 | [HttpPost] 13 | public ServiceResponse Update(IUnitOfWork uow, UserPreferenceUpdateRequest request) 14 | { 15 | return new MyRepository(Context).Update(uow, request); 16 | } 17 | 18 | public UserPreferenceRetrieveResponse Retrieve(IDbConnection connection, UserPreferenceRetrieveRequest request) 19 | { 20 | return new MyRepository(Context).Retrieve(connection, request); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Grids/InlineImageInGrid/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Inline Image in Grid"; 3 | } 4 | 5 | @section Head { 6 | } 7 | 8 | @section ContentHeader { 9 |

@ViewData["Title"]

10 | } 11 | 12 |
13 | 14 |

Here is how to show a product image inline in grid.

15 |

If you didn't yet, please upload an image for a product for this demonstration to work.

16 | 17 |

Source Files: @Html.BasicSamplesSourceFile("Index.cshtml"), @Html.BasicSamplesSourceFile("InlineImageInGridPage.tsx")

18 |
19 | 20 |
21 | 22 | @Html.ModulePageInit(ESM.InlineImageInGridPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Order/OrderShipCityLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class OrderShipCityLookup : RowLookupScript 5 | { 6 | public OrderShipCityLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = TextField = OrderRow.Fields.ShipCity.PropertyName; 10 | } 11 | 12 | protected override void PrepareQuery(SqlQuery query) 13 | { 14 | var fld = OrderRow.Fields; 15 | query.Distinct(true) 16 | .Select(fld.ShipCountry) 17 | .Select(fld.ShipCity) 18 | .Where( 19 | fld.ShipCountry != "" & 20 | fld.ShipCountry.IsNotNull() & 21 | fld.ShipCity != "" & 22 | fld.ShipCity.IsNotNull()); 23 | } 24 | 25 | protected override void ApplyOrder(SqlQuery query) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/ServerTypes/Extensions/ChangePasswordForm.ts: -------------------------------------------------------------------------------- 1 | import { PasswordEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface ChangePasswordForm { 4 | OldPassword: PasswordEditor; 5 | NewPassword: PasswordEditor; 6 | ConfirmPassword: PasswordEditor; 7 | } 8 | 9 | export class ChangePasswordForm extends PrefixedContext { 10 | static readonly formKey = 'Serenity.Extensions.ChangePasswordRequest'; 11 | private static init: boolean; 12 | 13 | constructor(prefix: string) { 14 | super(prefix); 15 | 16 | if (!ChangePasswordForm.init) { 17 | ChangePasswordForm.init = true; 18 | 19 | var w0 = PasswordEditor; 20 | 21 | initFormType(ChangePasswordForm, [ 22 | 'OldPassword', w0, 23 | 'NewPassword', w0, 24 | 'ConfirmPassword', w0 25 | ]); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.TerritoryForm.ts: -------------------------------------------------------------------------------- 1 | import { StringEditor, LookupEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface TerritoryForm { 4 | TerritoryID: StringEditor; 5 | TerritoryDescription: StringEditor; 6 | RegionID: LookupEditor; 7 | } 8 | 9 | export class TerritoryForm extends PrefixedContext { 10 | static readonly formKey = 'Northwind.Territory'; 11 | private static init: boolean; 12 | 13 | constructor(prefix: string) { 14 | super(prefix); 15 | 16 | if (!TerritoryForm.init) { 17 | TerritoryForm.init = true; 18 | 19 | var w0 = StringEditor; 20 | var w1 = LookupEditor; 21 | 22 | initFormType(TerritoryForm, [ 23 | 'TerritoryID', w0, 24 | 'TerritoryDescription', w0, 25 | 'RegionID', w1 26 | ]); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/tsbuild.js: -------------------------------------------------------------------------------- 1 | import { build } from "@serenity-is/tsbuild"; 2 | 3 | const buildOpt = { 4 | entryPoints: ['./Modules/index.ts'], 5 | outbase: './Modules/', 6 | splitting: false, 7 | clean: false 8 | } 9 | 10 | // wwwroot/esm/**/*.js: ESM entry points for own pages 11 | await build({ 12 | }); 13 | 14 | // dist/index.js: ESM bundle for NPM references 15 | await build(Object.assign({}, buildOpt, { 16 | external: [ 17 | '@serenity-is/*' 18 | ], 19 | outdir: 'dist/', 20 | plugins: [] 21 | })); 22 | 23 | // wwwroot/index.js: Global script (e.g. ~/Serenity.Extensions/index.js include in appsettings.bundles.json) 24 | await build(Object.assign({}, buildOpt, { 25 | format: 'iife', 26 | footer: { 27 | js: 'Serenity.Extensions = Serenity.Extensions || {}; Object.assign(Serenity.Extensions, Serenity._); delete Serenity._;' 28 | }, 29 | globalName: 'Serenity._', 30 | outdir: 'wwwroot/' 31 | })); 32 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Dialogs/ChartInDialog/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Chart in a Dialog"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 11 |

This sample demonstrates showing a resizable chart in a dialog. Chart data is populated from Northwind Orders with a service call.

12 |

Click button below to launch the dialog.

13 | 14 |

Source Files: 15 | @Html.BasicSamplesSourceFile("Index.cshtml"), 16 | @Html.BasicSamplesSourceFile("ChartInDialogPage.tsx") 17 |

18 |
19 | 20 |
21 |
22 | 23 | @Html.ModulePageInit(ESM.ChartInDialogPage) 24 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/BasicSamplesNavigation.Editors.cs: -------------------------------------------------------------------------------- 1 | using Ctrl = Serenity.Demo.BasicSamples.BasicSamplesPage; 2 | using Link = Serenity.Navigation.NavigationLinkAttribute; 3 | using Menu = Serenity.Navigation.NavigationMenuAttribute; 4 | 5 | [assembly: Menu(7930, "Basic Samples/Editors")] 6 | [assembly: Link(7930, "Basic Samples/Editors/Changing Lookup Text", typeof(Ctrl), action: nameof(Ctrl.ChangingLookupText))] 7 | [assembly: Link(7930, "Basic Samples/Editors/Filtered Lookup in Detail.", typeof(Ctrl), action: nameof(Ctrl.FilteredLookupInDetailDialog))] 8 | [assembly: Link(7930, "Basic Samples/Editors/Lookup Filter by Multi Val.", typeof(Ctrl), action: nameof(Ctrl.LookupFilterByMultipleValues))] 9 | [assembly: Link(7930, "Basic Samples/Editors/Select with Hardcod.Vals.", typeof(Ctrl), action: nameof(Ctrl.SelectWithHardcodedValues))] 10 | [assembly: Link(7930, "Basic Samples/Editors/Static Text Block", typeof(Ctrl), action: nameof(Ctrl.StaticTextBlock))] 11 | -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/UserPreference/UserPreferenceStorage.ts: -------------------------------------------------------------------------------- 1 | import { SettingStorage } from "@serenity-is/corelib"; 2 | import { UserPreferenceService } from "../ServerTypes/Extensions/UserPreferenceService"; 3 | import { UserPreferenceRetrieveResponse } from "../ServerTypes/Extensions"; 4 | 5 | export class UserPreferenceStorage implements SettingStorage { 6 | async getItem(key: string): Promise { 7 | const response = await Promise.resolve(UserPreferenceService.Retrieve({ 8 | PreferenceType: "UserPreferenceStorage", 9 | Name: key 10 | }) as PromiseLike); 11 | return response.Value; 12 | } 13 | 14 | async setItem(key: string, data: string): Promise { 15 | return Promise.resolve(UserPreferenceService.Update({ 16 | PreferenceType: "UserPreferenceStorage", 17 | Name: key, 18 | Value: data 19 | }) as any); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/texts/ExtensionsTexts.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | [NestedLocalTexts] 4 | public static class ExtensionsTexts 5 | { 6 | public static class Forms 7 | { 8 | public static class Membership 9 | { 10 | public static class ChangePassword 11 | { 12 | public static LocalText FormTitle => ChangePasswordFormTexts.FormTitle; 13 | } 14 | } 15 | } 16 | 17 | public static class Site 18 | { 19 | public static class Translation 20 | { 21 | public static LocalText EntityPlural => TranslationTexts.EntityPlural; 22 | } 23 | } 24 | 25 | public static class Validation 26 | { 27 | public static readonly LocalText InvalidResetToken = "Your token to reset your password is invalid or has expired!"; 28 | public static readonly LocalText PasswordConfirmMismatch = "The passwords entered doesn't match!"; 29 | } 30 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Customer/CustomerCityLookup.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind.Lookups; 2 | 3 | [LookupScript, Module("Northwind")] 4 | public class CustomerCityLookup : RowLookupScript 5 | { 6 | public CustomerCityLookup(ISqlConnections sqlConnections) 7 | : base(sqlConnections) 8 | { 9 | IdField = TextField = CustomerRow.Fields.City.PropertyName; 10 | } 11 | 12 | protected override void PrepareQuery(SqlQuery query) 13 | { 14 | var fld = CustomerRow.Fields; 15 | query.Distinct(true) 16 | .Select(fld.Country) 17 | .Select(fld.City) 18 | .Where( 19 | new Criteria(fld.Country) != "" & 20 | new Criteria(fld.Country).IsNotNull() & 21 | new Criteria(fld.City) != "" & 22 | new Criteria(fld.City).IsNotNull()); 23 | } 24 | 25 | protected override void ApplyOrder(SqlQuery query) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.OrderDetailRow.ts: -------------------------------------------------------------------------------- 1 | import { fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface OrderDetailRow { 4 | DetailID?: number; 5 | OrderID?: number; 6 | ProductID?: number; 7 | UnitPrice?: number; 8 | Quantity?: number; 9 | Discount?: number; 10 | OrderCustomerID?: string; 11 | OrderEmployeeID?: number; 12 | OrderDate?: string; 13 | ProductName?: string; 14 | LineTotal?: number; 15 | } 16 | 17 | export abstract class OrderDetailRow { 18 | static readonly idProperty = 'DetailID'; 19 | static readonly localTextPrefix = 'Northwind.OrderDetail'; 20 | static readonly deletePermission = 'Northwind:General'; 21 | static readonly insertPermission = 'Northwind:General'; 22 | static readonly readPermission = 'Northwind:General'; 23 | static readonly updatePermission = 'Northwind:General'; 24 | 25 | static readonly Fields = fieldsProxy(); 26 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/Region/RegionRow.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.Northwind; 2 | 3 | [ConnectionKey("Northwind"), Module("Northwind"), TableName("Region")] 4 | [DisplayName("Regions"), InstanceName("Region")] 5 | [ReadPermission(PermissionKeys.General)] 6 | [ModifyPermission(PermissionKeys.General)] 7 | [LookupScript] 8 | public sealed class RegionRow : Row, IIdRow, INameRow 9 | { 10 | [DisplayName("Region Id"), PrimaryKey, NotNull, Updatable(false), QuickSearch, IdProperty] 11 | public int? RegionID { get => fields.RegionID[this]; set => fields.RegionID[this] = value; } 12 | 13 | [DisplayName("Region Description"), Size(50), NotNull, QuickSearch, NameProperty] 14 | public string RegionDescription { get => fields.RegionDescription[this]; set => fields.RegionDescription[this] = value; } 15 | 16 | public class RowFields : RowFieldsBase 17 | { 18 | public Int32Field RegionID; 19 | public StringField RegionDescription; 20 | } 21 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/ServerTypes/Demo/BasicSamples.BasicSamplesService.ts: -------------------------------------------------------------------------------- 1 | import { ServiceOptions, serviceRequest } from "@serenity-is/corelib"; 2 | import { OrdersByShipperRequest } from "./BasicSamples.OrdersByShipperRequest"; 3 | import { OrdersByShipperResponse } from "./BasicSamples.OrdersByShipperResponse"; 4 | 5 | export namespace BasicSamplesService { 6 | export const baseUrl = 'Serenity.Demo.BasicSamples'; 7 | 8 | export declare function OrdersByShipper(request: OrdersByShipperRequest, onSuccess?: (response: OrdersByShipperResponse) => void, opt?: ServiceOptions): PromiseLike; 9 | 10 | export const Methods = { 11 | OrdersByShipper: "Serenity.Demo.BasicSamples/OrdersByShipper" 12 | } as const; 13 | 14 | [ 15 | 'OrdersByShipper' 16 | ].forEach(x => { 17 | (BasicSamplesService)[x] = function (r, s, o) { 18 | return serviceRequest(baseUrl + '/' + x, r, s, o); 19 | }; 20 | }); 21 | } -------------------------------------------------------------------------------- /src/Serenity.Extensions/Imports/ClientTypes/Extensions.StaticTextBlockAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Extensions; 2 | 3 | public partial class StaticTextBlockAttribute : CustomEditorAttribute 4 | { 5 | public const string Key = "Serenity.Extensions.StaticTextBlock"; 6 | 7 | public StaticTextBlockAttribute() 8 | : base(Key) 9 | { 10 | } 11 | 12 | public bool HideLabel 13 | { 14 | get { return GetOption("hideLabel"); } 15 | set { SetOption("hideLabel", value); } 16 | } 17 | 18 | public bool IsHtml 19 | { 20 | get { return GetOption("isHtml"); } 21 | set { SetOption("isHtml", value); } 22 | } 23 | 24 | public bool IsLocalText 25 | { 26 | get { return GetOption("isLocalText"); } 27 | set { SetOption("isLocalText", value); } 28 | } 29 | 30 | public string Text 31 | { 32 | get { return GetOption("text"); } 33 | set { SetOption("text", value); } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Grids/InitialValuesForQuickFilters/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Initial Values for Quick Filters"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 11 |

12 | Sometimes you might want to set some initial values for quick filters on page load. 13 | Here we do it for "Order Date", "Shipping State" and "Ship Via Company". 14 |

15 | 16 |

Source Files: 17 | @Html.BasicSamplesSourceFile("Index.cshtml"), 18 | @Html.BasicSamplesSourceFile("InitialValuesForQuickFiltersPage.ts") 19 |

20 |
21 | 22 |
23 | 24 | @Html.ModulePageInit(ESM.InitialValuesForQuickFiltersPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Grids/RemovingAddButton/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Removing Add Button"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 11 |

12 | This is a simple one, but neverthless is asked several times. How to remove Add button from the grid? 13 |

14 |

15 | See source code of @Html.BasicSamplesSourceFile("RemovingAddButtonPage.ts") for how. 16 |

17 | 18 |

Source Files: 19 | @Html.BasicSamplesSourceFile("Index.cshtml"), 20 | @Html.BasicSamplesSourceFile("RemovingAddButtonPage.ts") 21 |

22 |
23 | 24 |
25 | 26 | @Html.ModulePageInit(ESM.RemovingAddButtonPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20160216_1549_DataLocalization.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20160216_1549)] 6 | public class NorthwindDB_20160216_1549_DataLocalization : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | Create.Table("CategoryLang") 11 | .WithColumn("ID").AsInt32().IdentityKey(this) 12 | .WithColumn("CategoryID").AsInt32().NotNullable() 13 | .WithColumn("LanguageID").AsInt32().NotNullable() 14 | .WithColumn("CategoryName").AsString(15).Nullable() 15 | .WithColumn("Description").AsString(int.MaxValue).Nullable(); 16 | 17 | Create.Table("ProductLang") 18 | .WithColumn("ID").AsInt32().IdentityKey(this) 19 | .WithColumn("ProductID").AsInt32().NotNullable() 20 | .WithColumn("LanguageID").AsInt32().NotNullable() 21 | .WithColumn("ProductName").AsString(40).Nullable(); 22 | } 23 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | title: "[BUG]: " 5 | labels: under-review 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Areas/Serenity.Demo.BasicSamples/Dialogs/OtherFormInTab/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Another Form In Tab"; 3 | } 4 | 5 | @section ContentHeader { 6 |

@ViewData["Title"]

7 | } 8 | 9 |
10 | 11 |

Sometimes you may want to display / edit details of a related entity in a tab.

12 |

Here we show customer details in a tab under order dialog.

13 |

Note that, customer details are loaded / saved separately from the order itself.

14 | 15 |

16 | Source Files: 17 | @Html.BasicSamplesSourceFile("Index.cshtml"), 18 | @Html.BasicSamplesSourceFile("OtherFormInTabPage.tsx") 19 |

20 |
21 | 22 |
23 | 24 | @Html.ModulePageInit(ESM.OtherFormInTabPage) -------------------------------------------------------------------------------- /src/Serenity.Demo.BasicSamples/Modules/Editors/StaticTextBlock/StaticTextBlockForm.cs: -------------------------------------------------------------------------------- 1 | namespace Serenity.Demo.BasicSamples.Forms; 2 | 3 | [FormScript("BasicSamples.StaticTextBlock")] 4 | public class StaticTextBlockForm 5 | { 6 | [DisplayName("Static Text")] 7 | [StaticTextBlock(Text = "Here is some static text")] 8 | public String StaticText { get; set; } 9 | 10 | [StringEditor] 11 | public String SomeInput { get; set; } 12 | 13 | [DisplayName("Static Html")] 14 | [StaticTextBlock(Text = "

Here is an HTML list:

  • Item 1
  • Item 2
  • Item 3
", IsHtml = true)] 15 | public String HtmlList { get; set; } 16 | 17 | [DisplayName("From a Local Text")] 18 | [StaticTextBlock(Text = "Site.Dialogs.PendingChangesConfirmation", IsLocalText = true, IsHtml = true)] 19 | public String FromLocalText { get; set; } 20 | 21 | [DisplayName("Display Field Value")] 22 | [StaticTextBlock(IsHtml = true)] 23 | public String DisplayFieldValue { get; set; } 24 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20161126_1417_ForwardDates.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20161126_1417)] 6 | public class NorthwindDB_20161126_1417_ForwardDates : Migration 7 | { 8 | public override void Up() 9 | { 10 | var o = OrderRow.Fields; 11 | 12 | var dateAdd = "dateadd(day, datediff(day, (select max(orderdate) from Orders), getdate()), "; 13 | 14 | IfDatabase("SqlServer", "SqlServer2000", "SqlServerCe") 15 | .Execute.Sql( 16 | new SqlUpdate(o.TableName) 17 | .SetTo(o.OrderDate, dateAdd + o.OrderDate.Name + ")") 18 | .SetTo(o.RequiredDate, dateAdd + o.RequiredDate.Name + ")") 19 | .SetTo(o.ShippedDate, dateAdd + o.ShippedDate.Name + ")") 20 | .Where(o.OrderDate <= new DateTime(1999, 7, 1)) 21 | .DebugText); 22 | } 23 | 24 | public override void Down() 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Migrations/NorthwindDB_20151014_0307_OrderDetailID.cs: -------------------------------------------------------------------------------- 1 | using FluentMigrator; 2 | 3 | namespace Serenity.Demo.Northwind.Migrations; 4 | 5 | [NorthwindDB, MigrationKey(20151014_0307)] 6 | public class NorthwindDB_20151014_0307_OrderDetailID : AutoReversingMigration 7 | { 8 | public override void Up() 9 | { 10 | IfDatabase("SqlServer", "SqlServer2000", "SqlServerCe", "Postgres") 11 | .Alter.Table("Order Details") 12 | .AddColumn("DetailID").AsInt32().Identity().NotNullable(); 13 | 14 | IfDatabase("Oracle") 15 | .Execute.Sql("ALTER TABLE \"ORDER DETAILS\" ADD DetailID NUMBER(10, 0) NULL"); 16 | 17 | MigrationUtils.AddOracleIdentity(this, "\"ORDER DETAILS\"", "DetailID"); 18 | 19 | IfDatabase("Oracle") 20 | .Execute.Sql("UPDATE \"ORDER DETAILS\" SET DetailID = Order_Details_SEQ.nextval"); 21 | 22 | IfDatabase("Oracle") 23 | .Execute.Sql("ALTER TABLE \"ORDER DETAILS\" MODIFY DetailID NUMBER(10, 0) NOT NULL"); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.OrderDetailForm.ts: -------------------------------------------------------------------------------- 1 | import { LookupEditor, DecimalEditor, IntegerEditor, PrefixedContext, initFormType } from "@serenity-is/corelib"; 2 | 3 | export interface OrderDetailForm { 4 | ProductID: LookupEditor; 5 | UnitPrice: DecimalEditor; 6 | Quantity: IntegerEditor; 7 | Discount: DecimalEditor; 8 | } 9 | 10 | export class OrderDetailForm extends PrefixedContext { 11 | static readonly formKey = 'Northwind.OrderDetail'; 12 | private static init: boolean; 13 | 14 | constructor(prefix: string) { 15 | super(prefix); 16 | 17 | if (!OrderDetailForm.init) { 18 | OrderDetailForm.init = true; 19 | 20 | var w0 = LookupEditor; 21 | var w1 = DecimalEditor; 22 | var w2 = IntegerEditor; 23 | 24 | initFormType(OrderDetailForm, [ 25 | 'ProductID', w0, 26 | 'UnitPrice', w1, 27 | 'Quantity', w2, 28 | 'Discount', w1 29 | ]); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.RegionRow.ts: -------------------------------------------------------------------------------- 1 | import { getLookup, getLookupAsync, fieldsProxy } from "@serenity-is/corelib"; 2 | 3 | export interface RegionRow { 4 | RegionID?: number; 5 | RegionDescription?: string; 6 | } 7 | 8 | export abstract class RegionRow { 9 | static readonly idProperty = 'RegionID'; 10 | static readonly nameProperty = 'RegionDescription'; 11 | static readonly localTextPrefix = 'Northwind.Region'; 12 | static readonly lookupKey = 'Northwind.Region'; 13 | 14 | /** @deprecated use getLookupAsync instead */ 15 | static getLookup() { return getLookup('Northwind.Region') } 16 | static async getLookupAsync() { return getLookupAsync('Northwind.Region') } 17 | 18 | static readonly deletePermission = 'Northwind:General'; 19 | static readonly insertPermission = 'Northwind:General'; 20 | static readonly readPermission = 'Northwind:General'; 21 | static readonly updatePermission = 'Northwind:General'; 22 | 23 | static readonly Fields = fieldsProxy(); 24 | } -------------------------------------------------------------------------------- /src/Serenity.Demo.Northwind/Modules/ServerTypes/Demo/Northwind.CustomerColumns.ts: -------------------------------------------------------------------------------- 1 | import { ColumnsBase, fieldsProxy } from "@serenity-is/corelib"; 2 | import { Column } from "@serenity-is/sleekgrid"; 3 | import { EmployeeListFormatter } from "../../Customer/EmployeeListFormatter"; 4 | import { CustomerRow } from "./Northwind.CustomerRow"; 5 | 6 | export interface CustomerColumns { 7 | CustomerID: Column; 8 | CompanyName: Column; 9 | ContactName: Column; 10 | ContactTitle: Column; 11 | Region: Column; 12 | PostalCode: Column; 13 | Country: Column; 14 | City: Column; 15 | Phone: Column; 16 | Fax: Column; 17 | Representatives: Column; 18 | } 19 | 20 | export class CustomerColumns extends ColumnsBase { 21 | static readonly columnsKey = 'Northwind.Customer'; 22 | static readonly Fields = fieldsProxy(); 23 | } 24 | 25 | queueMicrotask(() => [EmployeeListFormatter]); // referenced types -------------------------------------------------------------------------------- /src/Serenity.Extensions/Modules/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./ServerTypes/Extensions"; 2 | export * from "./ServerTypes/Reporting"; 3 | export * from "./ServerTypes/Texts"; 4 | export * from "./BulkActions/BasicProgressDialog"; 5 | export * from "./BulkActions/BulkServiceAction"; 6 | export * from "./ExportImport/ExcelExportHelper"; 7 | export * from "./ExportImport/JsPdfAutoTable"; 8 | export * from "./ExportImport/PdfExportHelper"; 9 | export * from "./Formatters/EnumSelectFormatter"; 10 | export * from "./Formatters/SingleLineTextFormatter"; 11 | export * from "./GridEditor/GridEditorBase"; 12 | export * from "./GridEditor/GridEditorDialog"; 13 | export * from "./Reporting/ReportDialog"; 14 | export * from "./Reporting/ReportHelper"; 15 | export * from "./Reporting/ReportPage"; 16 | export * from "./UserPreference/UserPreferenceStorage"; 17 | export * from "./Widgets/DialogUtils"; 18 | export * from "./Widgets/PromptDialog"; 19 | export * from "./Widgets/SelectableEntityGrid"; 20 | export * from "./Widgets/StaticTextBlock"; 21 | export * from "./Membership/PasswordStrength/PasswordStrengthValidation"; --------------------------------------------------------------------------------