diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index f24ba57949..5c464400cc 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,8 +2,12 @@ name: Pull request labeler on: schedule: - cron: '0 12 */1 * *' +permissions: + contents: read jobs: labeler: + permissions: + pull-requests: write runs-on: ubuntu-latest steps: - uses: paulfantom/periodic-labeler@master diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/hu.json index 4738183af4..2cb142bb68 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/hu.json @@ -11,6 +11,6 @@ "CommercialSupportWebSite": "Kereskedelmi támogatási webhely", "CommunityWebSite": "ABP közösségi webhely", "ManageAccount": "Saját fiók | ABP.IO", - "ManageYourAccount": "Fiók kezelése" + "ManageYourProfile": "Profilod kezelése" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index 22ef0df894..7a064a8ce7 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -397,6 +397,8 @@ "BookDiscountDeletionConfirmationMessage": "Are you sure you want to delete this book discount?", "CustomPaymentFlexSwitchDescription": "With license", "AllowFeatureUpgradeOnLicenseExpire": "Allow feature upgrade on license expire", - "Deleted{0}": "[Deleted {0}]" + "Deleted{0}": "[Deleted {0}]", + "Tags": "Tags", + "SetTagsInfo": "Tags should be comma-separated. Eg: CSharp, Entity Framework" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/hu.json index e84bc09995..e006543933 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/hu.json @@ -316,14 +316,12 @@ "TrialLicenseStatusFilter": "Állapot", "TrialLicenseStartDateFilter": "Kezdő dátum", "TrialLicenseEndDateFilter": "Befejezés dátuma", - "FirsName": "Keresztnév", + "FirstName": "Keresztnév", "LastName": "Vezetéknév", "StartDate": "Kezdő dátum", "EndDate": "Befejezés dátuma", "PurchasedDate": "Vásárlás dátuma", "OrganizationDetail": "Szervezet részletei", - "SendActivationMail": "Aktiváló e-mail küldése", - "ActivationMailSentSuccessfully": "Az aktiváló levél sikeresen elküldve!", "TrialLicenseStatus": "Próbaengedély állapota", "TrialLicenseDetail": "A próbaengedély részletei", "AcceptsMarketingCommunications": "Marketing kommunikáció", @@ -337,17 +335,70 @@ "Expired": "Lejárt", "TrialLicenseDeletionWarningMessage": "Biztosan törölni szeretné a próbalicencet? A próbaengedély, a szervezet, a támogatási fiókok törlésre kerülnek!", "LicenseCategoryFilter": "Licenc kategória", - "Volo.AbpIo.Commercial:030000": "Már felhasználta a próbaidőszakot.", - "Volo.AbpIo.Commercial:030001": "Ez a szervezetnév már létezik.", - "Volo.AbpIo.Commercial:030002": "Az aktiválás után a próbalicenc nem állítható kérésre!", - "Volo.AbpIo.Commercial:030003": "Nincs ilyen állapot!", - "Volo.AbpIo.Commercial:030004": "Váratlan hiba miatt az állapot nem módosítható!", - "Volo.AbpIo.Commercial:030005": "A kezdő és befejező dátum akkor frissíthető, ha a próbalicenc -aktivált- státuszban van!", - "Volo.AbpIo.Commercial:030006": "A befejező dátumnak mindig nagyobbnak kell lennie, mint a kezdő dátum!", - "Volo.AbpIo.Commercial:030007": "Ezt a próbalicencet már egyszer aktiválták!", - "Volo.AbpIo.Commercial:030008": "A vásárlás dátuma csak Vásárolt állapot esetén állítható be!", - "Volo.AbpIo.Commercial:030009": "Felhasználó nem található!", - "Volo.AbpIo.Commercial:030010": "A próbalicenc megvásárlásához először aktiválnia kell a próbalicencet!", - "Volo.AbpIo.Commercial:030011": "A próbalicenc megvásárlásakor nem törölhető!" + "Permission:SendWelcomeEmail": "Üdvözlő e-mail küldése", + "SendWelcomeEmail": "Üdvözlő e-mail küldése", + "SendWelcomeEmailWarningMessage": "Biztosan üdvözlő e-mailt szeretne küldeni a szervezet tagjainak?", + "SendWelcomeEmailSuccessMessage": "Az üdvözlő e-mail sikeresen elküldve!", + "Activate": "Aktiválás", + "ActivateTrialLicenseWarningMessage": "A próbalicensz aktiválásakor egy üdvözlő e-mailt küldünk a felhasználónak. Szeretné aktiválni?", + "ActivateTrialLicenseSuccessMessage": "Sikeres aktiválás. Az üdvözlő e-mailt elküldtük a szervezet tagjainak.", + "PaymentRequestId": "Fizetési kérelem azonosítója", + "AdditionalDeveloperCount": "További fejlesztők száma", + "LicensePrice": "licensz ára", + "PurchaseDate": "Vásárlás időpontja", + "IsAbpBookDownloaded": "ABP könyv letöltve", + "IsMasteringAbpBookDownloadEnabled": "Az ABP könyv letöltése engedélyezve", + "Permission:Accounting:CustomPaymentLinkGenerator": "Egyéni fizetési link", + "CustomPaymentLink": "Egyéni fizetési link", + "Menu:CustomPaymentLink": "Egyéni fizetési link", + "Amount": "Összeg", + "GenerateCustomPaymentLink": "Egyéni fizetési link létrehozása", + "GeneratedPaymentLink": "Létrehozott fizetési link", + "CopyText": "Szöveg másolása", + "Permission:CommunityEvents": "Események", + "Menu:Events": "Események", + "Events": "Események", + "EventType": "Esemény típus", + "Number": "Szám", + "RegistrationURL": "Regisztrációs URL", + "URL": "URL", + "EventDeletionConfirmationMessage": "Biztosan törli ezt az eseményt?", + "Enum:EventType:0": "Közösségi beszélgetések", + "CreateAnEvent": "Hozzon létre egy eseményt", + "Permission:CommunitySpeakers": "Előadók", + "CreateASpeaker": "Hozzon létre egy hangszórót", + "Speakers": "Előadók", + "Image": "Kép", + "GithubURL": "Github URL", + "SpeakerDeletionConfirmationMessage": "Biztosan törli ezt a hangszórót?", + "Menu:Speakers": "Előadók", + "ChooseSpeakerImage": "Válasszon egy előadó képet...", + "SpeakerImage": "Előadó képe", + "AddSpeaker": "Előadó hozzáadása", + "ShowPurchaseItemsOfOrganizations": "Tételek vásárlása", + "Enum:OrganizationPurchaseState:0": "Nem kézbesített", + "Enum:OrganizationPurchaseState:1": "Szállítva", + "PurchaseItems": "Tételek vásárlása", + "SuccessfullyUpdated": "Sikeresen frissítve", + "SuccessfullyAdded": "Sikeresen hozzáadva", + "PurchaseState": "Vásárlási állapot", + "ShowBetweenDayCount": "Megjelenítés a napok között", + "PurchaseOrder": "Rendelés", + "ShowCreateInvoiceOfOrganization": "Számla létrehozása", + "ShowCreateQuotationOfOrganization": "Árajánlat létrehozása", + "BookDiscounts": "Könyvkedvezmények", + "Permission:BookDiscount": "Könyvkedvezmény", + "Menu:BookDiscounts": "Könyvkedvezmények", + "BookType": "Könyv típusa", + "PurchasePlatform": "Vásárlási platform", + "StartTime": "Kezdési idő", + "EndTime": "Idő vége", + "CreateABookDiscount": "Hozzon létre könyvkedvezményt", + "BookDiscountDeletionConfirmationMessage": "Biztosan törli ezt a könyvkedvezményt?", + "CustomPaymentFlexSwitchDescription": "Licenszel", + "AllowFeatureUpgradeOnLicenseExpire": "A funkció frissítésének engedélyezése a licensz lejártakor", + "Deleted{0}": "[Törölve {0}]", + "Tags": "Címkék", + "SetTagsInfo": "A címkéket vesszővel kell elválasztani. Pl.: CSharp, Entity Framework" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/ro-RO.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/ro-RO.json index 44ac964263..409ab816a5 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/ro-RO.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/ro-RO.json @@ -30,7 +30,7 @@ "NugetPackageDeletionWarningMessage": "Sunteţi sigur(ă) că doriţi să ştergeţi acest pachet de tip Nuget?", "ModuleDeletionWarningMessage": "Sunteţi sigur(ă) că doriţi să ştergeţi acest modul?", "Name": "Nume", - "DisplayName": "Nume de afişare", + "DisplayName": "Nume afişat", "ShortDescription": "Descriere scurtă", "NameFilter": "Nume", "CreationTime": "Data şi ora creării", @@ -317,7 +317,7 @@ "TrialLicenseStartDateFilter": "Data de început", "TrialLicenseEndDateFilter": "Data de încheiere", "FirsName": "Nume", - "LastName": "Nume", + "LastName": "Nume de familie", "StartDate": "Data de început", "EndDate": "Data de încheiere", "PurchasedDate": "Data achiziției", @@ -350,4 +350,4 @@ "Volo.AbpIo.Commercial:030010": "Pentru a achiziționa licența de probă, mai întâi trebuie să vă activați licența de probă!", "Volo.AbpIo.Commercial:030011": "Nu puteți șterge o licență de probă atunci când este achiziționată!" } -} \ No newline at end of file +} diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json index 3a1b574d21..b0555bfe32 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json @@ -73,6 +73,7 @@ "DeveloperFocused": "Developer Focused", "ShareYourExperiences": "Share your experiences with the ABP Framework", "LatestPosts": "Latest Posts", + "LatestVideos": "Latest Videos", "Views": "Views", "LearnLatestNewsAboutABPFramework": "Get information about happenings in ABP like new releases, free sources, posts, and more.", "DeveloperTools": "Developer Tools", @@ -98,6 +99,7 @@ "Logout": "Logout", "Home": "Home", "Posts": "Posts", + "Videos": "Videos", "JoinTheABPCommunity": "Join the ABP Community", "SubmitYourPost": "Submit Your Post", "Modules": "Modules", @@ -164,6 +166,19 @@ "Books": "Books", "ABPDiscordServer": "ABP Discord Server", "ABPCommunityTalks": "ABP Community Talks", - "ABPCommunityPosts": "ABP Community Posts" + "ABPCommunityPosts": "ABP Community Posts", + "BuyAndGetMonths": "BUY 12 MONTHS, GET 14 MONTHS!", + "GetYourDeal": "Get Your Deal", + "BuyOrRenewLicense": "Buy or Renew License Now and Get 2 Extra Months!", + "BuyOrRenewLicenseToGetExtra2Months": "Buy or Renew License Now and Get 2 Extra Months! HURRY UP! ⏰ Last Day: {0}", + "HurryUp": "HURRY UP!", + "LastDay": "Last Day: {0}", + "BuyNewLicenseBetweenDatesToGetBenefit": "Buy a new license between {0} and {1} to get benefit for extra 2 months!", + "CheckAllCommunityTalks": "Check All Community Posts", + "ReadMore": "Read More", + "Post": "Post", + "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "Explore the contents created by the core ABP team and the ABP community.", + "WelcomeFallCampaign": "Welcome Fall Campaign!", + "GiveAwayForNewPurchases": "Application Development Classroom Training will be given away for the new purchases!" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/hu.json index 079132d1e8..a85a2369f0 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/hu.json @@ -14,6 +14,20 @@ "Volo.AbpIo.Domain:020002": "Nem sikerült törölni ezt az NPM-csomagot, mert a \"{Modules}\" modulok ezt a csomagot használják.", "Volo.AbpIo.Domain:020003": "Nem sikerült törölni ezt az NPM-csomagot, mert a \"{Modules}\" modulok ezt a csomagot használják, és a \"{NugetPackages}\" Nuget-csomagok ettől a csomagtól függenek.", "Volo.AbpIo.Domain:020004": "Nem sikerült törölni ezt a Nuget-csomagot, mert a \"{Modules}\" modulok ezt a csomagot használják.", + "Volo.AbpIo.Domain:030000": "Már befejezte a próbaidőszakot.", + "Volo.AbpIo.Domain:030001": "Ez a szervezetnév már létezik.", + "Volo.AbpIo.Domain:030002": "Az aktiválás után a próbalicensz nem váltható át -igényelt- állapotra!", + "Volo.AbpIo.Domain:030003": "Nincs ilyen állapot!", + "Volo.AbpIo.Domain:030004": "Az állapot váratlan hiba miatt nem változtatható meg!", + "Volo.AbpIo.Domain:030005": "A kezdő és befejező dátum akkor frissíthető, ha a próbalicensz -aktivált- státuszban van!", + "Volo.AbpIo.Domain:030006": "A befejező dátumnak nagyobbnak kell lennie, mint a kezdő dátum!", + "Volo.AbpIo.Domain:030007": "Ez a próbalicensz már aktiválva van!", + "Volo.AbpIo.Domain:030008": "A vásárlás dátuma csak -megvásárolt- státusz esetén állítható be!", + "Volo.AbpIo.Domain:030009": "Felhasználó nem található!", + "Volo.AbpIo.Domain:030010": "A próbalicensz megvásárlásához először aktiválnia kell a próbalicenszet!", + "Volo.AbpIo.Domain:030011": "A próbalicensz megvásárlásakor nem törölhető!", + "Volo.AbpIo.Domain:070000": "A szervezet neve csak latin betűket, számokat, pontokat és kötőjeleket tartalmazhat!", + "Volo.AbpIo.Domain:070001": "A cégnév csak latin betűket, számokat, pontokat, szóközt és kötőjelet tartalmazhat!", "WantToLearn?": "Tanulni akar?", "ReadyToGetStarted?": "Készen áll az indulásra?", "JoinOurCommunity": "Csatlakozz a közösségünkhöz", @@ -39,6 +53,132 @@ "TrialLicensePeriodHasExpired": "A próbalicenc időszaka {0} napja lejárt.", "TrialLicensePeriodWillExpire": "A próbalicenc időszaka {0} napon belül lejár.", "TrialLicensePeriodExpireToday": "A próbalicenc ideje ma lejár.", - "PurchaseNow": "Vásároljon most!" + "PurchaseNow": "Vásároljon most!", + "LatestReleaseLogs": "Legújabb kiadási naplók", + "RoadMap": "Útiterv", + "FAQ": "GYIK", + "SourceCode": "Forráskód", + "SeeAllPosts": "Az összes bejegyzés megtekintése", + "Contribute": "Hozzájárulás", + "LiveDemo": "Élő Demo", + "GetLicense": "Licensz beszerzése", + "OpenSource": "Nyílt forráskód", + "WebApplication": "Webalkalmazás", + "MeetTheABP": "Ismerje meg az ABP-t", + "CompleteWebDevelopment": "Teljes körű webfejlesztés", + "Platform": "Felület", + "ABPDescription": "Az ABP Framework egy komplett infrastruktúra modern webalkalmazások létrehozásához, követve a szoftverfejlesztés legjobb gyakorlatait és konvencióit.", + "StrongInfrastructure": "Erős infrastruktúra", + "CompleteArchitecture": "Teljes arhitektúra", + "DeveloperFocused": "Fejlesztőközpontú", + "ShareYourExperiences": "Ossza meg tapasztalatait az ABP keretrendszerrel", + "LatestPosts": "Legutóbbi bejegyzések", + "LatestVideos": "Legújabb videók", + "Views": "Nézetek", + "LearnLatestNewsAboutABPFramework": "Információkat kaphat az ABP eseményeiről, például új kiadásokról, ingyenes forrásokról, bejegyzésekről és egyebekről.", + "DeveloperTools": "Fejlesztői eszközök", + "StartupTemplates": "Indítási sablonok", + "ApplicationModules": "Alkalmazási modulok", + "UI": "UI", + "Themes": "Témák", + "Premium": "Prémium", + "PrivacyPolicy": "Adatvédelmi irányelvek", + "TermsAndConditions": "Felhasználási feltételek", + "WouldLikeToReceiveMarketingMaterials": "Szeretnék marketing anyagokat kapni, például termékajánlatokat és különleges ajánlatokat.", + "JoinOurMarketingNewsletter": "Csatlakozzon marketing hírlevelünkhöz", + "CommunityPrivacyPolicyConfirmation": "Elfogadom az Általános Szerződési Feltételeket és az Adatvédelmi szabályzatot.", + "WouldLikeToReceiveNotification": "Szeretném megkapni a legfrissebb híreket az abp.io webhelyekről.", + "CommercialNewsletterConfirmationMessage": "Elfogadom az Általános Szerződési Feltételeket és az Adatvédelmi szabályzatot .", + "FreeDDDEBook": "Ingyenes DDD e-könyv", + "AdditionalServices": "További szolgáltatások", + "Learn": "Tanulás", + "AccountOverview": "Fiók Áttekintés", + "MyOrganizations": "Szervezeteim", + "MySupportQuestions": "Támogatási kérdéseim", + "MyProfile": "A profilom", + "Logout": "Kijelentkezés", + "Home": "Kezdőlap", + "Posts": "Hozzászólások", + "Videos": "Videók", + "JoinTheABPCommunity": "Csatlakozz az ABP közösséghez", + "SubmitYourPost": "Küldje be bejegyzését", + "Modules": "Modulok", + "Tools": "Eszközök", + "Pricing": "Árazás", + "ChangeLogs": "Változásnaplók", + "SubscribeToNewsletter": "Feliratkozás a Hírlevélre", + "SubscribeToNewsletterDescription": "Információkat kaphat az ABP eseményeiről, például új kiadásokról, ingyenes forrásokról, bejegyzésekről és egyebekről.", + "EmailAddress": "Email cím", + "Subscribe": "Iratkozz fel", + "WelcomeToABP": "Üdvözöljük az ABP-ben", + "EULA": "EULA", + "ABPCommercialIntroductionMessage": "Előre beépített alkalmazásmodulok, fejlett indítási sablonok, gyors alkalmazásfejlesztési eszközök, professzionális felhasználói felületi témák és prémium támogatás.", + "MasteringAbpFrameworkEBook": "Az ABP Framework elsajátítása", + "MasteringTheABPFrameworkExplanation": "Ez a könyv, amelyet az ABP-keretrendszer alkotója írt, segít a keretrendszer és a modern webalkalmazás-fejlesztési technikák teljes megértésében.", + "Speakers": "Előadók", + "PreviousEvents": "Korábbi események", + "WatchTheEvent": "Nézze meg az Eseményt", + "RegisterNow": "Regisztrálj most", + "ThereIsNoEvent": "Nincs esemény.", + "Events": "Események", + "Volo.AbpIo.Domain:080000": "Már van egy \"{Name}\" nevű vásárlási tétel", + "MasteringAbpFrameworkBook": "Könyv: Az ABP-keretrendszer elsajátítása", + "ABPIO-CommonPreferenceDefinition": "Szerezze meg a legfrissebb híreket az ABP Platformról, például új bejegyzésekről, eseményekről és egyebekről.", + "BuiltOn": "Beépített", + "AbpFramework": "ABP-keretrendszer", + "Volo.AbpIo.Domain:080001": "A kezdési idő nem lehet nagyobb, mint a befejezési idő", + "Enum:BookType:0": "Az ABP Framework elsajátítása", + "Enum:PurchasePlatform:0": "Amazon", + "Enum:PurchasePlatform:1": "Csomagolt", + "Copied": "Másolva!", + "CouldNotCopy": "Nem sikerült másolni!", + "CopyNotSupportByYourBrowser": "Ez a funkció nem működik az Ön által használt böngészőben.", + "City": "Város", + "ZipCode": "Irányítószám", + "Address": "Cím", + "Homepage": "Kezdőlap", + "Year": "Év", + "Copyright": "Copyright © {1}", + "DomainDrivenDesign": "Domainvezérelt tervezés", + "CrossCuttingConcerns": "Cross Cutting Concerns", + "AbpCommunity": "ABP közösség", + "Footer_GithubStarCount": "{0} Csillag a GitHubon", + "Footer_NugetDownloadCount": "{0} Letöltések a NuGeten", + "AbpDescription": "Az ABP egy nyílt forráskódú alkalmazás keretrendszer, amely az AspNet Core alapú webalkalmazások fejlesztésére összpontosít. Ne ismételje magát, összpontosítson saját üzleti kódjára.", + "Layout_AbpFramework_MetaTitle": "ABP Framework – Nyílt forráskódú webalkalmazás-keretrendszer", + "CommunityTalks_CountdownDays": "Napok", + "CommunityTalks_CountdownHours": "óra", + "CommunityTalks_CountdownMinutes": "Perc", + "CommunityTalks_CountdownSeconds": "mp", + "SeePreviousEvents": "Lásd: Korábbi események", + "CookieConsent_Accept": "Elfogad", + "CookieConsent_Explanation_1": "Cookie-kat használunk, hogy a legjobb élményt nyújtsuk weboldalunkon.", + "CookieConsent_Explanation_2": "Ha folytatja a böngészést, elfogadja adatvédelmi szabályzatunkat és cookie-kra vonatkozó szabályzatunkat. .", + "Error_Page_400_Title": "Hiba történt a kért oldal kiszolgálása során.", + "Error_Page_400_Description_1": "Ez általában azt jelenti, hogy a kérés feldolgozása során váratlan hiba történt.", + "Error_Page_400_Description_2": "Ha a probléma továbbra is fennáll, vegye fel velünk a kapcsolatot az info@abp.io címen , és mi segítünk az úton.", + "GoToHomepage": "Menj a főoldalra", + "Error_Page_404_Title": "Az oldal nem található!", + "Error_Page_404_Description_1": "Ez nem az a weboldal, amit keres.", + "Error_Page_500_Title": "Úgy tűnik, valami elromlott!", + "Error_Page_500_Description_1": "Ezeket a hibákat automatikusan nyomon követjük, de ha a probléma továbbra is fennáll, nyugodtan megteheti
lépjen kapcsolatba velünk. Addig is próbáljon frissíteni.", + "Error_Page_500_Description_2": "Vegye fel velünk a kapcsolatot az info@abp.io címen .", + "Books": "Könyvek", + "ABPDiscordServer": "ABP Discord szerver", + "ABPCommunityTalks": "ABP közösségi beszélgetések", + "ABPCommunityPosts": "ABP közösségi bejegyzések", + "BuyAndGetMonths": "VÁSÁROLJON 12 HÓNAPOT, 14 HÓNAPOT KAP!", + "GetYourDeal": "Szerezze meg az ajánlatát", + "BuyOrRenewLicense": "Vásároljon vagy újítson meg licencet most, és 2 további hónapot kap!", + "BuyOrRenewLicenseToGetExtra2Months": "Vásároljon vagy újítson meg licencet most, és 2 további hónapot kap! SIESS! ⏰ Utolsó nap: {0}", + "HurryUp": "SIESS!", + "LastDay": "Utolsó nap: {0}", + "BuyNewLicenseBetweenDatesToGetBenefit": "Vásároljon új licencet {0} és {1} között, és további 2 hónapra juthat!", + "CheckAllCommunityTalks": "Jelölje be az Összes közösségi bejegyzést", + "ReadMore": "Olvass tovább", + "Post": "Hozzászólás", + "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "Fedezze fel a központi ABP csapat és az ABP közösség által létrehozott tartalmakat.", + "WelcomeFallCampaign": "Üdvözöljük az őszi kampányban!", + "GiveAwayForNewPurchases": "Az új vásárlásokhoz az Alkalmazásfejlesztési Tantermi Képzést ajándékba adjuk!" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/tr.json index 818b4cab5e..1eedb98c61 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/tr.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/tr.json @@ -39,6 +39,8 @@ "TrialLicensePeriodHasExpired": "Deneme lisansınızın süresi {0} gün önce sona erdi.", "TrialLicensePeriodWillExpire": "Deneme lisansınızın süresi {0} gün içinde dolacak.", "TrialLicensePeriodExpireToday": "Deneme lisans süreniz bugün sona erecek.", - "PurchaseNow": "Şimdi satın al!" + "PurchaseNow": "Şimdi satın al!", + "WelcomeFallCampaign": "Hoş Geldin Sonbahar Kampanyası!", + "GiveAwayForNewPurchases": "Yeni alımlar için Uygulama Geliştirme Sınıfı Eğitimi hediye edilecektir!" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json index 989a63bb80..52358fb0ed 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hans.json @@ -73,6 +73,7 @@ "DeveloperFocused": "以开发者为中心", "ShareYourExperiences": "分享您使用 ABP 框架的经验", "LatestPosts": "最新的帖子", + "LatestVideos": "最新的视频", "Views": "意见", "LearnLatestNewsAboutABPFramework": "获取有关 ABP 的最新相关信息,例如新版本、免费资源、帖子等。", "DeveloperTools": "开发者工具", @@ -98,6 +99,7 @@ "Logout": "登出", "Home": "主页", "Posts": "帖子", + "Videos": "视频", "JoinTheABPCommunity": "加入 ABP 社区", "SubmitYourPost": "提交您的帖子", "Modules": "模块", @@ -164,6 +166,19 @@ "Books": "书籍", "ABPDiscordServer": "ABP Discord 服务器", "ABPCommunityTalks": "ABP社区讲话", - "ABPCommunityPosts": "ABP社区文章" + "ABPCommunityPosts": "ABP社区文章", + "BuyAndGetMonths": "购买 12 个月,获得 14 个月!", + "GetYourDeal": "得到你的交易", + "BuyOrRenewLicense": "立即购买或续订许可证并额外获得 2 个月!", + "BuyOrRenewLicenseToGetExtra2Months": "立即购买或续订 ABP 商业许可证(适用于所有版本)并额外获得 2 个月!", + "HurryUp": "赶快下单!", + "LastDay": "活动截止日期: {0}", + "BuyNewLicenseBetweenDatesToGetBenefit": "在 {0} 和 {1} 之间购买一个新的许可证以获得额外 2 个月的收益!", + "CheckAllCommunityTalks": "检查所有社区帖子", + "ReadMore": "阅读更多", + "Post": "邮政", + "ExploreTheContentsCreatedByTheCoreABPTeamAndTheABPCommunity": "探索核心 ABP 团队和 ABP 社区创建的内容。", + "WelcomeFallCampaign": "欢迎秋季活动!", + "GiveAwayForNewPurchases": "新购买将赠送应用程序开发课堂培训!" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hant.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hant.json index dbf04ae25b..f55f4a7f85 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hant.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/zh-Hant.json @@ -39,6 +39,8 @@ "TrialLicensePeriodHasExpired": "您的試用許可期限已於 {0} 天前到期。", "TrialLicensePeriodWillExpire": "您的試用許可期限將在 {0} 天后到期。", "TrialLicensePeriodExpireToday": "您的試用許可期將於今天到期。", - "PurchaseNow": "現在買!" + "PurchaseNow": "現在買!", + "WelcomeFallCampaign": "欢迎秋季活动!", + "GiveAwayForNewPurchases": "新购买将赠送应用程序开发课堂培训!" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Blog/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Blog/Localization/Resources/hu.json new file mode 100644 index 0000000000..0cd40d0d5a --- /dev/null +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Blog/Localization/Resources/hu.json @@ -0,0 +1,7 @@ +{ + "culture": "hu", + "texts": { + "AbpTitle": "ABP Framework – Nyílt forráskódú webalkalmazás-keretrendszer", + "AbpDescription": "Az ABP egy nyílt forráskódú alkalmazáskeret, amely az AspNet Core alapú webalkalmazások fejlesztésére összpontosít. Ne ismételje magát, összpontosítson saját üzleti kódjára." + } +} \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ar.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ar.json index 1a9aa7cba2..c7b91a99a0 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ar.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ar.json @@ -89,7 +89,7 @@ "Blogging": "التدوين", "Identity": "هوية", "IdentityServer": "خادم الهوية", - "Saas": "ساس", + "Saas": "البرمجيات كخدمة", "LanguageManagement": "إدارة اللغة", "TextTemplateManagement": "إدارة قالب النص", "See All Modules": "انظر جميع الوحدات", @@ -382,4 +382,4 @@ "RenewLicenseEarly": "إذا قمت بتجديد رخصتي في وقت مبكر ، هل سأحصل على السنة كاملة؟", "RenewLicenseEarylExplanation": "عند تجديد الترخيص الخاص بك قبل تاريخ انتهاء الترخيص الخاص بك ، ستتم إضافة سنة واحدة إلى تاريخ انتهاء الترخيص الخاص بك. على سبيل المثال ، إذا انتهت صلاحية ترخيصك في {0} -06-06 وقمت بتجديده في {0} -01-01 ، فسيكون تاريخ انتهاء صلاحية الترخيص الجديد {1} -06-06." } -} \ No newline at end of file +} diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index caf4a9dbbe..777009989e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -548,7 +548,7 @@ "MyOrganizations_Detail_OwnerRightInfo": "You are using {0} of your {1} owners rights.", "MyOrganizations_Detail_CopyApiKey": "Copy the Key", "MyOrganizations_Detail_ApiKeyDescription": "The API Key is the token of PRO packages hosted on {1}.", - "MyOrganizations_Detail_YourPrivateNugetSource": "Your private NuGet source is {0}", + "MyOrganizations_Detail_YourPrivateNugetSource": "Your private NuGet source is {0}", "MyOrganizations_Detail_PrivateNugetSourceWarning": "This is automatically added as a feed to your NuGet.Config in your ABP solution. Do not share your private key with unauthorized users!", "MyOrganizations_Detail_DeveloperSeatInfo": "You are using {0} of your {1} developer seats.", "NeedMoreSeatsForYourTeam": "Need more seats for your team?", @@ -735,6 +735,16 @@ "ConfirmedEmailAddressRequiredToStartTrial": "You should have a confirmed email address in order to start a trial license.", "EmailVerificationMailNotSent": "Email verification mail couldn't send.", "GetConfirmationEmail": "Click here to get a confirmation email if you haven't got it before.", - "WhichLicenseTypeYouAreInterestedIn": "Which license type you are interested in?" + "WhichLicenseTypeYouAreInterestedIn": "Which license type you are interested in?", + "DontTakeOurWordForIt": "Don't take our word for it...", + "ReadAbpCommercialUsersWantYouToKnow": "Read what ABP Commercial users want you to know", + "Testimonial_ShortDescription_1": "The modularity of ABP made it possible for the team to deliver in time.", + "Testimonial_ShortDescription_2": "Build new features faster than before.", + "Testimonial_ShortDescription_3": "We start from out-of-the-box features and just focus on what we really need to write.", + "Testimonial_ShortDescription_4": "ABP Commercial was the best fit for our needs.", + "OnlineReviewersOnAbpCommercial": "Online Reviews on ABP Commercial", + "SeeWhatToldAboutAbpCommercial": "See what has been told about ABP Commercial and write your thoughts if you want.", + "BlazoriseLicense": "Do we need to buy Blazorise license?", + "BlazoriseLicenseExplanation": "We have an agreement between Volosoft and Megabit, with this agreement Blazorise license is bundled with ABP Commercial products therefore our customers do not need to purchase an extra Blazorise license." } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/hu.json index b6028bb0aa..0de24176ed 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/hu.json @@ -9,15 +9,18 @@ "QuestionCount": "Fennmaradó/összes kérdés", "Unlimited": "Korlátlan", "Owners": "Tulajdonosok", + "Owner": "Tulajdonos", "AddMember": "Tag hozzáadása lehetőségre", - "AddOwner": "Tulajdonos hozzáadása", - "AddDeveloper": "Fejlesztő hozzáadása", + "AddNewOwner": "Új tulajdonos hozzáadása", + "AddNewDeveloper": "Új fejlesztő hozzáadása", "UserName": "Felhasználónév", "Name": "Név", "EmailAddress": "Email cím", "Developers": "Fejlesztők", "LicenseType": "Jogosítvány típus", "Manage": "Kezelése", + "SetDefault": "Beállítás alapértelmezettként", + "DefaultOrganization": "Alapértelmezett", "StartDate": "Kezdő dátum", "EndDate": "Befejezés dátuma", "Modules": "Modulok", @@ -60,8 +63,6 @@ "Themes": "Témák", "JoinOurNewsletter": "Csatlakozzon hírlevelünkhöz", "Send": "Küld", - "Learn": "Tanul", - "AdditionalServices": "További szolgáltatások", "WhatIsABPFramework": "MI AZ ABP KERET?", "OpenSourceBaseFramework": "Nyílt forráskódú alapkeretrendszer", "ABPFrameworkExplanation": "

Az ABP Commercial az ABP-keretrendszeren alapul, amely egy nyílt forráskódú és közösségvezérelt webalkalmazás-keretrendszer az ASP.NET Core számára.

Az ABP-keretrendszer kiváló infrastruktúrát biztosít karbantartható, bővíthető íráshoz. és tesztelhető kód a bevált gyakorlatokkal.

Beépített és integrált népszerű eszközök, amelyeket már ismer. Alacsony tanulási görbe, könnyű alkalmazkodás, kényelmes fejlődés.

", @@ -127,6 +128,8 @@ "TellUsWhatYouNeed": "Mondja el, mire van szüksége.", "YourMessage": "Az üzeneted", "YourFullName": "A teljes neved", + "FirstNameField": "Keresztnév", + "LastNameField": "Vezetéknév", "EmailField": "Email cím", "YourEmailAddress": "Az email címed", "HowMayWeHelpYou": "Hogyan segíthetünk?", @@ -157,6 +160,8 @@ "SearchQuestionPlaceholder": "Keressen a gyakran ismételt kérdések között", "WhatIsTheABPCommercial": "Mi az az ABP Commercial?", "WhatAreDifferencesThanAbpFramework": "Mi a különbség a nyílt forráskódú ABP Framework és az ABP Commercial között?", + "AbpCommercialMetaTitle": "ABP Commercial – Teljes webfejlesztési platform: {0} | ABP Commercial", + "AbpCommercialMetaDescription": "Az ABP Commercial a nyílt forráskódú ABP keretrendszerre épülő előre beépített alkalmazásmodulok, gyorsfejlesztő eszközök, UI témák és szolgáltatások készlete.", "ABPCommercialExplanation": "Az ABP Commercial prémium modulok, eszközök, témák és szolgáltatások készlete a nyílt forráskódú ABP keretrendszerre épül fel. Az ABP Commercial-t ugyanaz a csapat fejleszti és támogatja az ABP keretrendszer mögött.", "WhatAreDifferencesThanABPFrameworkExplanation": "

Az ABP-keretrendszer egy moduláris, tematikus, mikroszolgáltatásokkal kompatibilis alkalmazásfejlesztési keretrendszer az ASP.NET Core számára. Teljes architektúrát és erős infrastruktúrát biztosít ahhoz, hogy a saját üzleti kódjára összpontosítson, ahelyett, hogy megismételné magát minden új projektnél. A szoftverfejlesztés bevált gyakorlatain és a már ismert népszerű eszközökön alapul.

Az ABP keretrendszer teljesen ingyenes, nyílt forráskódú és közösségvezérelt. Ingyenes témát és néhány előre beépített modult is biztosít (pl. személyazonosság-kezelés és bérlőkezelés).

", "VisitTheFrameworkVSCommercialDocument": "További információért keresse fel a következő linket: {1} ", @@ -178,6 +183,7 @@ "ChangingLicenseType": "Frissíthetem a licenctípusomat később?", "ChangingLicenseTypeExplanation": "Magasabb licencre frissíthet, ha az aktív licencidőszakon belül kifizeti a különbözetet. Ha magasabb licenccsomagra frissít, megkapja az új csomag előnyeit, de a licencfrissítés nem módosítja a licenc lejárati dátumát. Emellett új fejlesztői helyeket is hozzáadhat meglévő licencéhez, lásd \"Hány fejlesztő dolgozhat az ABP Commercialon?\"", "LicenseExtendUpgradeDiff": "Mi a különbség a licenc kiterjesztése és a frissítés között?", + "LicenseExtendUpgradeDiffExplanation": "Meghosszabbítás: A licensz meghosszabbításával/megújításával továbbra is prémium támogatást kap, valamint kisebb-nagyobb frissítéseket kap a modulokhoz és témákhoz. Emellett folytathatja az új projektek létrehozását. És továbbra is használhatja az ABP Suite-ot, amely felgyorsítja a fejlesztést. A licensz meghosszabbításakor 1 év hozzáadódik a licensz lejárati dátumához.
Frissítés: licenszének frissítésével magasabb licenszcsomagra lép fel, amely további előnyöket biztosít. Tekintse meg a licensz-összehasonlító táblázatot , hogy megtekinthesse a licensztervek közötti különbségeket. Másrészt, amikor frissít, a licensz lejárati dátuma nem változik! A licensz lejárati dátumának meghosszabbításához meg kell hosszabbítania a licenszet.", "LicenseRenewalCost": "Mennyibe kerül a licenc megújítása 1 év után?", "LicenseRenewalCostExplanation": "A normál csapatlicenc megújítási (meghosszabbítási) ára {0} USD, a normál üzleti licencé {1} USD, a normál vállalati licencé pedig {2} USD. Ha Ön már ügyfél, jelentkezzen be fiókjába, hogy áttekintse az elérhető megújítási árakat.", "HowDoIRenewMyLicense": "Hogyan újíthatom meg a jogosítványomat?", @@ -189,9 +195,19 @@ "IsSourceCodeIncludedExplanation4": "

Ha egy modul forráskódját belefoglalja a megoldásba, akkor maximális szabadságot biztosít a modul testreszabásához. Ekkor azonban nem lehet automatikusan frissíteni a modult, amikor új verzió jelenik meg.

A licencek egyike sem tartalmazza az ABP Suite forráskódját, amely egy külső eszköz, amely kódot generál Önnek és segít az Ön fejlesztéséhez.

A licenctípusok közötti egyéb különbségekért tekintse meg az árazási oldalt.

", "ChangingDevelopers": "Módosíthatom a szervezetem regisztrált fejlesztőit a jövőben?", "ChangingDevelopersExplanation": "Amellett, hogy új fejlesztőket ad hozzá a licenchez, további költségek nélkül módosíthatja a meglévő fejlesztőket is (eltávolíthat egy fejlesztőt, és hozzáadhat egy újat ugyanarra a helyre).", + "WhatHappensWhenLicenseEnds": "Mi történik, ha lejár a licenszidőm?", + "WhatHappensWhenLicenseEndsExplanation1": "Az ABP Kereskedelmi engedély örök érvényű licensz . A licensz lejárta után folytathatja a projekt fejlesztését. És nem köteles megújítani a jogosítványát. licenszéhez egyéves frissítés és támogatási terv tartozik. Ha továbbra is új funkciókat, teljesítménynöveléseket, hibajavításokat, támogatást szeretne kapni, és továbbra is használni szeretné az ABP Suite szolgáltatást, meg kell újítania a licenszet. Ha a licensze lejár, nem részesül a következő előnyökben:", + "WhatHappensWhenLicenseEndsExplanation2": "Az ABP Commercial használatával nem hozhat létre új megoldásokat, de a meglévő alkalmazásait örökre továbbfejlesztheti.", + "WhatHappensWhenLicenseEndsExplanation3": "Frissítéseket kaphat a MINOR verzión belüli modulokhoz és témákhoz (kivéve az RC vagy Preview verziókat). Például: ha egy modul v3.2.0-s verzióját használja, továbbra is kaphat frissítéseket a modul v3.2.x-hez (v3.2.1, v3.2.5... stb.). De nem kaphat frissítéseket a következő fő- vagy mellékverzióhoz (például v3.3.0, v3.3.3, 4.xx stb.). Például amikor a licensze lejárt, a legutóbbi kiadás a 4.4.3 volt, és később, amikor a 4.4.4-es és a 4.5.0-s verzió is megjelent, akkor hozzáférhet a v4.4.X-hez, de nem elérheti a v4.5.X.", + "WhatHappensWhenLicenseEndsExplanation4": "A licensz lejárta után nem telepíthet új modulokat és témákat az ABP Commercial platformhoz.", + "WhatHappensWhenLicenseEndsExplanation5": "Az ABP Suite nem használható.", + "WhatHappensWhenLicenseEndsExplanation6": "A prémium támogatást már nem kaphatja meg.", + "WhatHappensWhenLicenseEndsExplanation7": "Meghosszabbíthatja (megújíthatja) az engedélyét, ha továbbra is igénybe kívánja venni ezeket az előnyöket. Ha a licensz lejártát követő 1 hónapon belül meghosszabbítja a licenszet, a következő kedvezmények érvényesek: Team License {0}% kedvezmény, Business License {1}% kedvezmény, Enterprise License {2}% kedvezmény.", + "WhatHappensWhenLicenseEndsExplanation8": "Az Ön által generált ABP projekteket nem tároljuk a szervereinken. Ezért az Ön felelőssége a letöltött forráskód megőrzése. Amikor a licensze lejár, nincs mód a generált ABP projekt forráskódjának lekérésére.", "WhenShouldIRenewMyLicense": "Mikor kell megújítanom a jogosítványomat?", "WhenShouldIRenewMyLicenseExplanation": "Ha a licenc lejártát követő 1 hónapon belül megújítja a licencet, a következő kedvezmények érvényesek: Csapatlicenc {0}% kedvezmény, Üzleti licenc {1}% kedvezmény, Vállalati licenc {2}% kedvezmény . Ha megújítja a licencet 1 hónappal a licenc lejárati dátuma után, a megújítási ár megegyezik a licenc vásárlási árával, és nem jár kedvezmény a megújításra.", "TrialPlan": "Van próbaterv?", + "TrialPlanExplanation": "14 napos próbaidővel rendelkezik az ABP Commercial csapat licenszéhez. További információért látogasson el ide . Továbbá a Team licenszekre 30 napos pénz-visszafizetési garanciát biztosítunk. Az első 30 napban csak visszatérítést kérhet. A Business és Enterprise licenszek esetén 30 napon belül 60%-os visszatérítést biztosítunk. Ennek az az oka, hogy a Business és Enterprise licenszek tartalmazzák az összes modul és téma teljes forráskódját.", "DoYouAcceptBankWireTransfer": "Elfogadja a banki átutalást?", "DoYouAcceptBankWireTransferExplanation": "Igen, elfogadunk banki átutalást.
Miután banki átutalással elküldte a licencdíjat, küldje el nekünk e-mailben az accounting@abp.io címre nyugtát és a kért engedély típusát. Nemzetközi bankszámlánk információi:", "HowToUpgrade": "Hogyan lehet frissíteni a meglévő alkalmazásokat, ha új verzió érhető el?", @@ -348,7 +364,6 @@ "WeWillSendYouADownloadLink": "Az e-könyv letöltésére szolgáló linket elküldtük a(z) {0} címre.
Ellenőrizze a beérkező leveleket/levélszemét/spam dobozokat!", "InvalidFormInputs": "Kérjük, írja be az űrlapon megadott érvényes adatokat.", "DDDBookEmailBody": "Köszönöm.
Könyve letöltéséhez kattintson ide.", - "FreeDDDEBook": "Ingyenes DDD e-könyv", "StartFree": "Kezdje ingyen", "FreeTrial": "Ingyenes próbaverzió", "AcceptsMarketingCommunications": " Igen, szeretnék kapni az ABP Commercial marketingkommunikációit.", @@ -359,25 +374,375 @@ "CompanySize": "Cég Méret", "Next": "Következő", "StartTrial": "Indítsa el az ingyenes próbaverziómat", - "ContactUsIssues": "Ha bármilyen problémája van, lépjen kapcsolatba velünk", + "ContactUsQuestions": "Ha bármilyen kérdése van, forduljon hozzánk", "TrialActivatedWarning": "Kedves {0}! Egy felhasználó csak 1 ingyenes próbaidőszakra jogosult. Már felhasználta a próbaidőszakot.", + "ActivationRequirement": "Még egy lépés választja el a próbaidőszak megkezdésétől.
Az adatok ellenőrzése után aktiváljuk a licenszét. A licensz aktiválása után e-mailt küldünk a következő címre: {0} . Ne aggódjon, ez a folyamat nem tart sokáig!", "SaveAndDownload": "Mentés és letöltés", "CompanyNameValidationMessage": "A cég neve túl hosszú!", "AddressValidationMessage": "A cím túl hosszú!", "TaxNoValidationMessage": "Az ADÓ/ÁFA szám túl hosszú!", "NotesValidationMessage": "A megjegyzésmező túl hosszú!", "CheckYourBillingInfo": "Számlát csak egyszer készíthet! A számla elkészítése előtt ellenőrizze számlázási adatait.", - "Volo.AbpIo.Commercial:030000": "Már felhasználta a próbaidőszakot.", - "Volo.AbpIo.Commercial:030001": "Ez a szervezetnév már létezik.", "StartYourFreeTrial": "Indítsa el az ingyenes próbaidőszakát", "TrialLicenseModelInvalidErrorMessage": "A következő mezők egyike érvénytelen: Ország neve, vállalat mérete, iparág vagy felhasználás célja.", "Trial": "Próba", "Purchased": "Vásárolt", - "PurchaseLicense": "Vásárlási engedély", + "PurchaseNow": "Vásároljon most", "PurchaseTrialLicenseMessage": "A licence lejárati dátuma: {0}.
Ha továbbra is használni szeretné az ingyenes próbaidőszak alatt létrehozott projekteket, módosítania kell a licenckulcsokat az appsettings.secrets.json fájlokban. Itt van a licenckulcsod:", "TrialLicenseExpireMessage": "Ön a próbalicencet használja, és a próbalicence a következő napon lejár: {0}.", "TryForFree": "Próbáld ki ingyen", "TrialLicenseExpiredInfo": "A próbalicensz időszaka lejárt!", - "CommercialNewsletterConfirmationMessage": "Elfogadom az Általános Szerződési Feltételeket és az Adatvédelmi irányelveket ." + "DowngradeLicensePlan": "Leválthatok alacsonyabb licenszcsomagra a jövőben?", + "DowngradeLicensePlanExplanation": "Nem módosíthatja a meglévő licenszcsomagot. De vásárolhat egy új alacsonyabb licenszcsomagot, és folytathatja a fejlesztést az új licenszen. Miután megvásárolta az alacsonyabb licenszet, csak be kell jelentkeznie az új licenszcsomagba az ABP CLI paranccsal: ` abp login -o `.", + "LicenseTransfer": "Egy licenszet át lehet adni egyik fejlesztőről a másikra?", + "LicenseTransferExplanation": "Igen! licensz vásárlásakor Ön lesz a licensz tulajdonosa, így hozzáférhet a szervezetkezelési oldalhoz. Egy szervezetnek tulajdonosi és fejlesztői szerepei vannak. A tulajdonosok kezelhetik a fejlesztői helyeket, és fejlesztőket rendelhetnek hozzá. Minden kijelölt fejlesztő az ABP CLI paranccsal jelentkezik be a rendszerbe, és fejlesztési és támogatási jogosultságokkal rendelkezik.", + "UserOwnerDescription": "A szervezet „Tulajdonosa” a fiók adminisztrátora. licenszek vásárlásával és fejlesztők kiosztásával irányítja a szervezetet. A „Tulajdonos” nem írhat kódot az ABP Commercial projektekben, nem töltheti le az ABP mintaprojekteket, és nem tehet fel kérdéseket a támogatási webhelyen. Ha mindezeket meg akarja tenni, fel kell vennie magát fejlesztőként is.", + "UserDeveloperDescription": "A „fejlesztők” kódot írhatnak az ABP Commercial projektekben, letölthetik az ABP mintaprojekteket, és kérdéseket tehetnek fel a támogatási webhelyen. Másrészt a „Fejlesztők” nem kezelhetik ezt a szervezetet.", + "RemoveCurrentUserFromOrganizationWarningMessage": "Ön eltávolítja magát saját szervezetéből. A továbbiakban nem fogja tudni kezelni ezt a szervezetet, megerősíti?", + "RenewExistingOrganizationOrCreateNewOneMessage": "Az alábbi \"Meghosszabbítás most\" gomb(ok)ra kattintva megújíthatja szervezete(i) licenszét, és így 1 évvel meghosszabbíthatja a licensz lejárati dátumát. Ha folytatja a fizetést, új szervezete lesz. Új szervezetnél szeretné folytatni?", + "PurchaseTrialOrganizationOrCreateNewOneMessage": "Van próbaengedélyed. A próbalicensz megvásárlásához kattintson a Vásárlás most gombra. Ha folytatja a fizetést, új szervezete lesz. Új szervezetnél szeretné folytatni?", + "ExtendNow": "Hosszabbítsa meg most", + "CreateNewOrganization": "Hozzon létre egy új szervezetet", + "RenewLicenseEarly": "Ha korán megújítom a jogosítványomat, megkapom a teljes évet?", + "RenewLicenseEarylExplanation": "Ha megújítja a licenszet a licensz lejárati dátuma előtt, 1 év hozzáadódik a licensz lejárati dátumához. Például, ha licensze {0}-06-06-án lejár, és {0}-01-01-én újítja meg, az új licensz lejárati dátuma {1}-06-06.", + "OpenSourceWebApplication": "Nyílt forráskódú webes alkalmazás", + "CompleteWebDevelopment": "Komplett webfejlesztés", + "ABPFrameworkDescription": "Az ABP Framework egy komplett infrastruktúra modern webalkalmazások létrehozásához a szoftverfejlesztés bevált gyakorlatainak és konvencióinak követésével.", + "CommunityDescription": "Ossza meg tapasztalatait az ABP keretrendszerrel!", + "GetStarted": "Fogj neki", + "Views": "nézetek", + "LatestPosts": "Legutóbbi bejegyzések", + "PreBuiltApplication": "Előre beépített alkalmazás", + "DatabaseProviders": "Adatbázis-szolgáltatók", + "UIFrameworks": "UI keretrendszerek", + "UsefulLinks": "Hasznos Linkek", + "Platform": "Felület", + "CoolestCompaniesUseABPCommercial": "A legmenőbb cégek már használják az ABP Commercial-t.", + "UserInterface": "Felhasználói felület", + "APIGateway": "API átjáró", + "Microservice": "Mikroszolgáltatás", + "Database": "Adatbázis", + "Architecture": "Építészet", + "MicroserviceArchitectureExplanation": "Ez egy teljes megoldás-architektúra, amely több alkalmazásból, API-átjáróból, mikroszolgáltatásból és adatbázisokból áll, hogy a legújabb technológiákkal skálázható mikroszolgáltatási megoldást építsenek ki.", + "BusinessLogic": "Üzleti logika", + "DataAccessLayer": "Adatelérési réteg", + "Monolith": "Monolit", + "ModularArchitectureExplanation": "Ez az indítási sablon egy réteges, moduláris és DDD-alapú megoldás-architektúrát kínál tiszta és karbantartható kódbázis létrehozásához.", + "SeeDetails": "Lásd a részleteket", + "SeeDocumentation": "Nézze meg a Dokumentációt", + "Bs5Compatible": "Bootstrap 5 kompatibilis professzionális téma, tökéletes az adminisztrátori webhelyhez.", + "LeptonXTheme": "LeptonX téma", + "LeptonXDark": "LeptonX sötét", + "LeptonXLight": "LeptonX Light", + "LeptonXSemiDark": "LeptonX félsötét", + "BuiltOnBs5Library": "Bootstrap 5 könyvtárra építve", + "FullyCompatibleWithBs5": "100%-ban kompatibilis a Bootstrap 5 HTML struktúrájával és CSS osztályaival", + "ResponsiveAndMobileCompatible": "Reszponzív, mobil kompatibilis, RTL támogatás", + "ProvidesStylesForDatatables": "Stílusokat biztosít az adattáblákhoz", + "MultipleLayoutOptions": "Többféle elrendezési lehetőség", + "EasilyInstallAndUpgrade": "Könnyen telepíthető és frissíthető", + "SupportForum": "Támogatói fórum", + "TrustedBy": "Megbízható", + "OurPricing": "Áraink", + "Plans": "Tervek", + "NameSurname": "Név vezetéknév", + "Unspecified": "Meg nem határozott", + "LicenceType": "Licensz típus", + "LicenseDiscountWarning": "EZ A KEDVEZMÉNYOLDAL ALAPÉRTELMEZETT KEDVEZMÉNYKÓDOT HASZNÁL ÉS A VOLOSOFT FEJLESZTŐK SZÁMÁRA VAN. AZ ALÁBBI VÁSÁRLÁSI LINKEK NEM MŰKÖDNEK.", + "DiscountedLicenseExplanation": "Ezek a licenszárak kis startup vállalkozásokra, egyéni fejlesztőkre, hallgatókra, nonprofit szervezetekre és projektekre vonatkoznak!", + "General": "Általános", + "License": "Licensz", + "Development": "Fejlődés", + "Payment": "Fizetés", + "WatchExplainerVideo": "Találkozzunk! Nézze meg a magyarázó videót", + "LightDarkAndSemiDarkThemes": "Világos, Sötét és Félsötét", + "LeptonXThemeExplanation": "A Lepton Theme módosíthatja a témát a rendszerbeállításoknak megfelelően.", + "PRO": "PRO", + "WelcomeToABPCommercial": "Üdvözöljük az ABP Commercial oldalán!", + "YourAccountDetails": "Fiók adatai", + "OrganizationName": "Szervezet neve", + "AddDevelopers": "Adjon hozzá fejlesztőket", + "StartDevelopment": "Kezdje el a fejlesztést", + "CreateAndRunApplicationUsingStartupTemplate": "Ismerje meg, hogyan hozhat létre és futtathat új webalkalmazást az ABP Commercial indítási sablon használatával.", + "CommunityDescription2": "A Community.abp.io egy olyan hely, ahol az emberek megoszthatnak ABP-vel kapcsolatos cikkeket. Keressen cikkeket, oktatóanyagokat, kódmintákat, esettanulmányokat, és találkozzon Önnel azonos sávban élő emberekkel.", + "UseABPSuiteExplanation": "Az ABP Suite segítségével töltse le a modulok és témák forráskódját.", + "ManageModulesWithSuite": "ABP-moduljait a Suite segítségével is kezelheti.", + "LearnHowToInstallSuite": "Ismerje meg az ABP Suite telepítését és használatát.", + "SeeMore": "Többet látni", + "SeeLess": "Lásd Kevesebb", + "LayeredSolutionStructure": "Réteges megoldás szerkezete", + "LayeredSolutionStructureExplanation": "A megoldás a tartományvezérelt tervezési elvek és minták alapján rétegzett, hogy elkülönítse az üzleti logikát az infrastruktúrától és az integrációktól, és maximalizálja a kód karbantarthatóságát és újrafelhasználhatóságát. Az ABP Framework már tartalmaz absztrakciókat, alaposztályokat és útmutatókat a DDD tényleges megvalósításához az alkalmazásban.", + "MultipleUIOptions": "Több felhasználói felület opció", + "MultipleUIOptionsExplanation": "Szeretjük a felhasználói felület létrehozásának különböző módjait. Ez az indítási megoldás három különböző felhasználói felületi keretrendszert biztosít az üzleti alkalmazás számára.", + "MultipleDatabaseOptions": "Több adatbázis-beállítás", + "MultipleDatabaseOptionsExplanation": "Két adatbázis-szolgáltató lehetősége van (amellett, hogy mindkettőt egyetlen alkalmazásban használhatja). Az Entity Framework Core segítségével bármilyen relációs adatbázissal dolgozhat, és opcionálisan használja a Dappert, ha alacsony szintű lekérdezéseket kell írnia a jobb teljesítmény érdekében. A MongoDB egy másik lehetőség, ha dokumentum alapú NoSQL adatbázist kell használnia. Noha ezek a szolgáltatók jól integráltak, absztraktáltak és előre konfiguráltak, valójában bármilyen adatbázis-rendszerrel kapcsolatba léphet, amelyet a .NET-tel használhat.", + "ModularArchitectureExplanation2": "A a legfőbb szempont az ABP.IO platformon. Az alkalmazás összes funkciója jól elkülönített opcionális modulokra van felosztva. Az indítási megoldás már előre telepítve tartalmazza az alapvető ABP Commercial modulokat . Saját modulokat is létrehozhat, hogy moduláris rendszert építsen fel saját alkalmazásához.", + "MultiTenancyForSaasBusiness": "Többérlős felépítés az Ön SaaS-üzleteihez", + "MultiTenancyForSaasBusinessExplanation": "Az ABP Commercial teljes körű, többbérlős rendszert biztosít SaaS (Software-as-a-Service) rendszereinek létrehozásához. Lehetővé teszi a bérlők számára, hogy megosszák vagy rendelkezzenek saját adatbázisokkal az on-the-fly adatbázis-létrehozó és migrációs rendszerrel.", + "MicroserviceStartupSolution": "Mikroszolgáltatás indítási megoldás", + "MicroserviceArchitectureExplanation2": "Beszerezheti következő mikroszolgáltatási rendszeréhez, hogy kihasználhassa az előre elkészített alapmegoldást és tiszta élményt.", + "PreIntegratedTools": "Előre integrálva a népszerű eszközökbe", + "PreIntegratedToolsExplanation": "A megoldás már integrálva van az ipari szabványos eszközökbe és technológiákba, miközben Ön bármikor módosíthatja azokat, és integrálhatja kedvenc eszközeibe.", + "SingleSignOnAuthenticationServer": "Egyszeri bejelentkezéses hitelesítési kiszolgáló", + "SingleSignOnAuthenticationServerExplanation": "A megoldás rendelkezik egy hitelesítési kiszolgálóalkalmazással, amelyet a többi alkalmazás egyszeri bejelentkezési kiszolgálóként használ API hozzáférés-kezelési szolgáltatásokkal. Az IdentityServeren alapul.", + "WebAppsWithGateways": "2 webalkalmazás 2 API átjáróval", + "WebAppsWithGatewaysExplanation": "A megoldás két webalkalmazást tartalmaz, mindegyik rendelkezik dedikált API-átjáróval (BFF - Backend For Frontend minta).", + "BackOfficeApplication": "Back Office alkalmazás", + "BackOfficeApplicationExplanation": "A rendszer tényleges webalkalmazása, több felhasználói felületi keretbeállítással. Bármilyen üzleti alkalmazást létrehozhat.", + "LandingWebsite": "Landing webhely", + "LandingWebsiteExplanation": "Általános célú/nyilvános webhely, amely többféle célra is használható, például a cég bemutatására, termékei értékesítésére stb.", + "ABPFrameworkEBook": "Mastering ABP Framework e-book", + "MasteringAbpFrameworkEBookDescription": "Tartalmazza az ABP kereskedelmi licenszét", + "FullName": "Teljes név", + "LicenseTypeNotCorrect": "A licensz típusa nem megfelelő!", + "Trainings": "Képzések", + "ChooseTrainingPlaceholder": "Válaszd ki a képzést...", + "DoYouNeedTrainings": "Szüksége van egy ilyen képzésre?", + "DoYouNeedTraining": "Szüksége van a(z) {0} képzésére?", + "GetInTouchUs": "Vegye fel velünk a kapcsolatot", + "ForMoreInformationClickHere": "További információért kattintson ide.", + "IsGetOnboardingTraining": "Szeretnél bevezető és webalkalmazás-fejlesztő tréningen részt venni?", + "OnboardingWebApplicationDevelopmentTrainingMessage": "Képzési naptárának ütemezéséhez a szervezet létrehozása után vegye fel a kapcsolatot a következővel: {0}", + "CustomPurchaseMessage": "A következő lépéshez kattintson a(z) {0} gombra, és lépjen kapcsolatba velünk.", + "Note": "jegyzet", + "AdditionalNote": "Kiegészítő megjegyzés", + "OnboardingTrainingFaqTitle": "Van ABP bevezető képzése?", + "OnboardingTrainingFaqExplanation": "Igen, van ABP képzési szolgáltatásunk, amely segít abban, hogy ABP-projektjét gyorsan elindítsa. Megtanulja az ABP-t az ABP törzscsoport egyik tagjától, és elsajátítja az ABP-projekt megkezdéséhez szükséges készségeket. A bevezető tréningen elmagyarázzuk, hogyan állítsa be fejlesztői környezetét, telepítse a szükséges eszközöket, készítsen egy teljesen működőképes CRUD oldalt. A tréning élőben lesz, a Zoom alkalmazást használjuk, valamint nyitottak vagyunk más online találkozóplatformok használatára is. A képzés nyelve angol lesz. A foglalkozások során felteheti kérdéseit az ABP-vel kapcsolatban is. Mindkét fél számára megfelelő időpontot és dátumot tervezünk. További információért lépjen kapcsolatba velünk az info@abp.io címen .", + "AddBasket": "Kosárba helyez", + "SendTrainingRequest": "Képzési kérelem küldése", + "OnlyEnglishVersionOfThisDocumentIsTheRecentAndValid": "* A dokumentum angol nyelvű változata a legfrissebb, és minden vitában az angol verzió az irányadó.", + "Pricing_Page_Title": "Tervek és árak", + "Pricing_Page_Description": "Válassza ki azokat a szolgáltatásokat és funkciókat, amelyekre ma vállalkozásának szüksége van. Vásároljon ABP kereskedelmi licenszet, és hozzon létre korlátlan számú projektet.", + "Pricing_Page_HurryUp": "Siess!", + "Pricing_Page_BuyLicense": "Vásároljon licenszet 2021-es árakon január 16-ig!", + "Pricing_Page_ValidForExistingCustomers": "Meglévő ügyfelekre és licenszmegújításokra is érvényes.", + "Pricing_Page_Hint1": "A licensz ára bizonyos számú fejlesztői helyet tartalmaz. Ha több fejlesztője van, bármikor vásárolhat további üléseket.", + "Pricing_Page_Hint2": "További fejlesztői licenszeket vásárolhat most vagy a jövőben. A licenszek szék alapúak, így áthelyezhet egy helyet egy fejlesztőtől a másikhoz.", + "Pricing_Page_Hint3": "licenszével korlátlan számú különböző terméket fejleszthet.", + "Pricing_Page_Hint4": "Az ABP Suite egy olyan eszköz, amely segíti a fejlesztést a termelékenység javítása érdekében. Támogatja a CRUD oldalak generálását és új projektek létrehozását.", + "Pricing_Page_Hint5": "Az összes előre beépített modult használhatja alkalmazásaiban.", + "Pricing_Page_Hint6": "Az összes előre elkészített témát használhatja alkalmazásaiban.", + "Pricing_Page_Hint7": "Az indítási sablon a Visual Studiohoz, amellyel azonnal elkezdheti a projektet. Az összes alapvető modul hozzáadásra és előre konfigurálva van az Ön számára.", + "Pricing_Page_Hint8": "Az ABP-keretrendszer elsajátítása című e-könyv elmagyarázza, hogyan lehet .NET-megoldásokat megvalósítani a legjobb gyakorlatokkal. A könyvet az Amazon.com oldalon árusítják, és licensze keretein belül ingyenesen letöltheti a könyvet.", + "Pricing_Page_Hint9": "Bármely modul forráskódja letölthető. Érdemes lehet a forráskódot hozzáadni a megoldáshoz, hogy radikális változtatásokat hajtson végre, vagy biztonsági okokból egyszerűen megtarthatja magának.", + "Pricing_Page_Hint10": "A licenszek életre szólnak. Ez azt jelenti, hogy örökké folytathatja az alkalmazás fejlesztését. A legfrissebb verzióhoz való hozzáférés és a támogatás megszerzése a licensz időtartamán belül biztosított (1 év, ha nem újítja meg).", + "Pricing_Page_Hint11": "Nincs korlátozás a telepítésre! Tetszőleges számú kiszolgálóra telepítheti, beleértve a felhőszolgáltatásokat vagy a helyszíni szolgáltatásokat.", + "Pricing_Page_Hint12": "A modulokat, témákat és eszközöket frissítheti a legújabb verzióra az aktív licenszidőszakon belül. A licensz lejárta után meg kell újítania, hogy továbbra is frissítéseket kaphasson a hibajavításokról, új funkciókról és fejlesztésekről.", + "Pricing_Page_Hint13": "A prémium támogatást egy évre kaphatja meg (a licensz megújításával meghosszabbítható).", + "Pricing_Page_Hint14": "A csapat- és üzleti licenszeknek van incidens/kérdésszám korlátja. Ha további fejlesztői licenszeket vásárol, az incidensek korlátja fejlesztőnként {0}-kal (a csapatlicensz esetén) vagy {1}-kal (az üzleti licensz esetében) nő.", + "Pricing_Page_Hint15": "Csak az Enterprise licensz tartalmaz magántámogatást. Küldhet e-mailt közvetlenül az ABP csapatának, vagy kérdéseket tehet fel a support.abp.io oldalon privát jegy opcióval. A privát jegyek nem láthatók a nyilvánosság számára.", + "Pricing_Page_Hint16": "Letöltheti az összes ABP téma forráskódját. Érdemes lehet a forráskódot hozzáadni a megoldáshoz, hogy radikális változtatásokat hajtson végre, vagy biztonsági okokból egyszerűen megtarthatja magának.", + "Pricing_Page_Testimonial_1": "Az ABP Commercial lehetővé tette az SC Ventures számára, hogy 9 hónapon belül egy banki szintű többbérlős silo-adatbázis SaaS-platformot szállítson a követelések/tartozások ellátási láncának támogatására, jelentős értékű számlák több integrált horgonyból történő finanszírozásához. Az ABP modularitása lehetővé tette a csapat számára, hogy rekordidő alatt szállítsa, átadja az összes VAPT-t, és a konténeres mikroszolgáltatások veremét teljes CI/CD-n és csővezetékeken keresztül üzembe helyezze.", + "Pricing_Page_Testimonial_2": "Látjuk az ABP Commercial használatának értékét az egyedi fejlesztési projektek általános költségeinek csökkentésére. És a csapat képes egységesíteni a kódmintát a különböző projektfolyamokban. Több lehetőséget látunk a keretrendszerben arra, hogy a korábbinál gyorsabban építsünk új funkciókat. Bízunk benne, hogy folyamatosan látni fogjuk az ABP Commercial kihasználásának értékét.", + "Pricing_Page_Testimonial_3": "Szeretjük az ABP-t. Nem kell mindent a nulláról írnunk. A beépített funkciókból indulunk ki, és csak arra koncentrálunk, amit valóban meg kell írnunk. Ezenkívül az ABP jól felépített, és a kód kiváló minőségű, kevesebb hibával. Ha magunknak kellene megírnunk mindent, amire szükségünk van, akkor lehet, hogy éveket kellene töltenünk. Még egyszer, amit szeretünk, az az, hogy az új verzió, a hibajavítás vagy a fejlesztés nagyon hamar, minden második héten megjelenik. Nem várunk túl sokáig.", + "Pricing_Page_Testimonial_4": "Az ABP Commercial egy fantasztikus termék, amelyet ajánlunk. Kereskedelmi termékek, amelyeket ügyfeleink számára egyetlen konfigurálható platformon értékesíthetnek. Az ugrásszerű indítás, amelyet a keret és az eszközök biztosítanak bármely csapat számára, minden centet megér. Az ABP Commercial volt a legjobban megfelelő az igényeinknek.", + "Pricing_Page_Testimonial_5": "Az ABP Framework nem csak keretrendszer, hanem útmutató is a projektfejlesztéshez/menedzsmenthez, mert DDD, GenericRepository, DI, Microservice és Modularity képzést biztosít. Ha magát a keretrendszert nem is használja, fejlesztheti magát a docs.abp.io-val, amely jól és professzionálisan elkészített (OpenIddict, Redis, Quartz stb.) leírás. Mivel sok minden előre be van építve, jelentősen lerövidíti a projektfejlesztési időt (például bejelentkezési oldal, kivételkezelés, adatszűrés, aéapadatok, audit naplózás, lokalizáció, automatikus API vezérlő stb.). Alkalmazásunkból példaként a Helyi Event Bus-t használtam az állomány karbantartására. Így a rendelési mozgásokat eseményekkel tudom a készlethez igazítani. Csodálatos, hogy nem veszítünk időt a CreationTime-ra, a CreatorId-re. Automatikusan feltöltődnek.", + "AbpBookDownloadArea_ClaimYourEBook": "Igényelje Mastering ABP Framework e-könyvét", + "AddMemberModal_Warning_1": "Ha a hozzáadni kívánt felhasználónév nem létezik a rendszerben, kérje meg csapattagját, hogy regisztráljon a (z) {0} webhelyen, és ossza meg fiókja felhasználónevét Önnel.", + "MyOrganizations_Detail_WelcomeMessage": "Üdvözöljük szervezetében, {0}", + "MyOrganizations_Detail_OrganizationManagement": "Szervezetmenedzsment", + "OrganizationDisplayName": "Szervezet megjelenített neve", + "MyOrganizations_Detail_EditDisplayName": "Megjelenítési név szerkesztése", + "MyOrganizations_Detail_UpgradeYourLicense": "Frissítse licenszét", + "MyOrganizations_Detail_LicenseStartAndExpiryDate": "licensz kezdő dátuma – lejárati dátum", + "MyOrganizations_Detail_OwnerRightInfo": "Ön {1} tulajdonosi jogának {0}-át használja.", + "MyOrganizations_Detail_CopyApiKey": "Másolja ki a kulcsot", + "MyOrganizations_Detail_ApiKeyDescription": "Az API-kulcs a(z) {1} webhelyen tárolt PRO-csomagok tokenje.", + "MyOrganizations_Detail_YourPrivateNugetSource": "Az Ön privát NuGet-forrása {0}", + "MyOrganizations_Detail_PrivateNugetSourceWarning": "Ez automatikusan hozzáadódik feedként a NuGet.Config-hoz az ABP-megoldásban. Ne ossza meg privát kulcsát illetéktelen felhasználókkal!", + "MyOrganizations_Detail_DeveloperSeatInfo": "Ön {1} fejlesztői helyéből {0}-ot használ.", + "NeedMoreSeatsForYourTeam": "Több hozzáférésre van szüksége a csapatának?", + "MyOrganizations_Detail_PricePerYear": "{0}/év", + "MyOrganizations_Detail_PurchaseDeveloperSeats": "Vásároljon fejlesztői hozzáféréseket", + "Invoices": "Számlák", + "RequestInvoice": "Kérjen számlát", + "OrderNumber": "Rendelésszám", + "Date": "Dátum", + "Products": "Termékek", + "TotalPrice": "Teljes ár", + "ThereIsNoInvoice": "Nincs számla", + "MyOrganizations_Detail_PaymentProviderInfo": "Ha licenszét a (z) {0} átjárón keresztül vásárolta, az elküldi a PDF számlát az Ön e-mail címére, lásd: {0} számlázás.", + "MyOrganizations_Detail_PayUInfo": "Ha a PayU átjárón keresztül vásárolt, kattintson a \"Számla kérése\" gombra, és töltse ki a számlázási adatokat.", + "MyOrganizations_Detail_ConclusionInfo": "Számlakérését {0} munkanapon belül lezárjuk.", + "ExtendYourLicense": "Hosszabbítsa meg {0} licenszét", + "Continue": "Folytatni", + "PurchaseLicense": "Vásárlási engedély", + "DownloadInvoiceModal_DownloadInvoice": "Számla letöltése", + "DownloadInvoiceModal_SaveInformationOnlyOnce": "Számlázási adatait csak egyszer mentheti el.", + "InvoiceModal_EnterCompanyName": "Adja meg cégének hivatalos nevét...", + "InvoiceModal_EnterCompanyAddress": "Adja meg cége jogi címét...", + "InvoiceModal_EnterTaxNumber": "Adja meg adószámát, ha van...", + "RequestInvoiceModal_EnterNotes": "Írja be a számlával kapcsolatos extra üzenetet...", + "PrePayment_PayWithIyzico": "Iyzico-val fog fizetni", + "ContinueToCheckout": "Tovább a Pénztárhoz", + "PrePayment_IyzicoRedirectionInfo": "A vásárlás biztonságos befejezéséhez átirányítjuk az Iyzico Payment Gateway oldalra.", + "PrePayment_IyzicoAcceptVisaAndMasterCard": "Az Iyzico Visa és MasterCard kártyákat fogad el.", + "Purchase": "Vásárlás", + "AcceptTermsAndConditions": "Elolvastam, megértettem és elfogadom az adatvédelmi szabályzatot , a feltételeket és az EULA-t.", + "AcceptTermsAndConditionsWarningMessage": "Kérjük, fogadja el az adatvédelmi szabályzatot és a feltételeket", + "SelectGatewayToContinue": "Kérjük, válasszon egy átjárót a folytatáshoz!", + "GatewaySelection_SelectGateway": "Válasszon fizetési átjárót", + "GatewaySelection_RedirectionMessage": "Ezután átirányítjuk a kiválasztott fizetési átjáró webhelyére a tranzakcióhoz.", + "PaymentSucceed_PaymentSuccessMessage": "Sikeres fizetés", + "PaymentSucceed_ThanksForPurchase": "Köszönjük a vásárlást!", + "PaymentSucceed_CreateYourOrganization": "Hozd létre a szervezetedet", + "PaymentSucceed_AddMeAsDeveloper": "Én is fejlesztő vagyok, vegyen fel fejlesztőként a szervezetembe.", + "PaymentSucceed_CreateOrganization": "Szervezet létrehozása", + "PaymentSucceed_OrganizationDescription": "Egy szervezet fejlesztőkből és tulajdonosokból áll. A fejlesztők olyan felhasználók, akik kódot írnak az ABP projektben, és részesülnek a {1} webhely előnyeiből. A tulajdonosok olyan felhasználók, akik fejlesztői helyeket osztanak ki és kezelik a licenszelést.", + "PaymentSucceed_ViewOrganization": "Kattintson ide a szervezet megtekintéséhez", + "Purchase_TotalAnnualPrice": "ÖSSZESEN (éves díj)", + "Purchase_TrainingPrice": "Képzési ár", + "Purchase_OnboardingTraining": "ABP Onboarding és webalkalmazás-fejlesztés élő képzés", + "TotalDeveloperPrice": "Teljes fejlesztői ár", + "Purchase_PricePerDeveloper": "{0} {1} fejlesztőnként", + "Purchase_IncludedDeveloperInfo": "{0} {1} tartalmazza.", + "Purchase_LicenseExtraDeveloperPurchaseMessage": "A(z) {0} licensz {1} fejlesztőt tartalmaz. Hozzáadhat további fejlesztőket most vagy később.", + "StartupTemplates_Page_Title": "Az indítási sablonok", + "StartupTemplates_Page_Description": "Az ABP Commercial lehetővé teszi, hogy bármilyen bonyolultságú megoldást készítsen. Két fő előre beépített indítási megoldást kínál. Kiválaszthatja az igényeinek megfelelőt, és ráépítheti saját egyedi megoldását.", + "MicroserviceStartupSolutionForDotnet": "Microservice Startup Solution for .NET", + "MonolithSolutionForDotnet": "Monolith (moduláris) megoldás .NET-hez", + "TrainingDetailsHeaderInfo_TrainingHour": "{0} óra", + "Trainings_Content": "A képzés tartalma", + "Trial_Page_StartYourFreeTrial": "Indítsa el az ingyenes próbaverziót", + "TrialLicenseFeatures": "Élvezheti az ABP összes kereskedelmi funkcióját", + "TrialPeriodDays": "{0} napos csapatengedéllyel rendelkezik", + "TrialForumSupportIncident": "{0} fórumtámogatási incidense lesz", + "Contact_Page_Title": "Lépjen kapcsolatba az ABP fejlesztési csapatával", + "Contact_Page_Description": "Lépjen kapcsolatba az ABP Development csapatával, ha segítségre van szüksége, vagy ossza meg gondolatait és véleményét! Az ABP támogatási csapata készen áll a segítségére.", + "Demo_Page_Title": "Hozzon létre egy demót", + "Demo_Page_Description": "Hozzon létre egy ingyenes demót az ABP Commercial indítósablon segítségével létrehozott mintaalkalmazás megtekintéséhez. Ne ismételje magát a gyakori alkalmazási követelmények miatt.", + "Discounted_Page_Title": "Kedvezményes ár", + "Discounted_Page_Description": "Válassza ki azokat a szolgáltatásokat és funkciókat, amelyekre ma vállalkozásának szüksége van. Vásároljon ABP kereskedelmi licenszet, és hozzon létre korlátlan számú projektet", + "Faq_Page_Title": "Gyakran Ismételt Kérdések (GYIK)", + "Faq_Page_Description": "Van kérdésed? Keressen gyakran ismételt kérdésekre, vagy tegyen fel nekünk kérdést a kapcsolatfelvételi űrlap segítségével.", + "Faq_Page_SwiftCode": "Swift kód", + "Faq_Page_BankName": "A bank neve", + "Faq_Page_AccountName": "Felhasználónév", + "Faq_Page_AccountNumber": "Számlaszám", + "Faq_Page_Currency": "Valuta", + "Faq_Page_VatNumber": "Adószám", + "Faq_Page_OtherCurrenciesInfo": "A többi pénznemhez lásd az összes fiókot", + "ModuleDetail_Page_Title": "Modul részletei – {0}", + "ProjectCreatedSuccess_Page_Title": "A projekt létrehozva", + "ProjectCreatedSuccess_Page_Description": "ABP projektje sikeresen létrejött!", + "Suite_Page_Title": "ABP Suite – CRUD oldalak létrehozása", + "Suite_Page_Description": "Az ABP Commercial gyors alkalmazásfejlesztési eszközöket biztosít a fejlesztők termelékenységének növelése érdekében. Az ABP Suite segítségével könnyedén hozhat létre CRUD oldalakat.", + "Themes_Page_Title": "Modern és funkcionális felhasználói felület témák", + "Themes_Page_Description": "Az ABP Commercial több professzionális, modern felhasználói felület témát kínál. Hozzon létre egy ingyenes bemutatót, hogy gyorsan áttekintse, hogyan néz ki a felhasználói felület.", + "Tools_Page_Title": "Gyors alkalmazásfejlesztő eszközök", + "Tools_Page_Description": "Az ABP Commercial gyors alkalmazásfejlesztési eszközöket biztosít a fejlesztők termelékenységének növelése érdekében. Az ABP Suite segítségével könnyedén hozhat létre CRUD oldalakat.", + "DeveloperPrice": "Fejlesztői ár", + "AdditionalDeveloperPaymentInfoSection_AdditionalDevelopers": "{0} fejlesztő", + "LicenseRemainingDays": "{0} napig", + "ExtendPaymentInfoSection_Description": "A licensz meghosszabbításával/megújításával továbbra is prémium támogatást kap. Emellett kisebb-nagyobb frissítéseket is kaphat a modulokhoz és témákhoz. Folytathatja új projektek létrehozását. És továbbra is használhatja az ABP Suite -ot, amely felgyorsítja a fejlesztést.", + "LicenseRenewalPrice": "Licensz megújítási ára", + "LicensePrice": "Licensz ára", + "TrialLicensePaymentInfoSection_Description": "Licensz vásárlása: licensz megvásárlásával továbbra is prémium támogatást kap . Emellett kisebb-nagyobb frissítéseket is kaphat a modulokhoz és témákhoz. Folytathatja új projektek létrehozását. És továbbra is használhatja az ABP Suite -ot, amely felgyorsítja a fejlesztést.
Tekintse meg a licensz-összehasonlító táblázatot a licensztípusok közötti különbségek ellenőrzéséhez.", + "SelectTargetLicense": "Válassza a Target License lehetőséget", + "UpgradePaymentInfoSection_ExtendMyLicenseForOneYear": "Igen, meghosszabbítom az engedélyem lejárati dátumát 1 évvel.", + "UpgradePaymentInfoSection_WantToExtendLicense": "Szeretné meghosszabbítani licenszét további {0} évre?", + "UpgradePaymentInfoSection_UpgradingWillNotExtendLicense": "A frissítés nem hosszabbítja meg a licensz lejárati dátumát!", + "UpgradePaymentInfoSection_LicenseUpgradeDescription": "Licenszének frissítésével magasabb licensztípusra lép, amely további előnyökhöz juttatja Önt. Tekintse meg a licensz-összehasonlító táblázatot a licensztípusok közötti különbségek ellenőrzéséhez.", + "Landing_Page_CustomerStories": "Ügyféltörténetek", + "Landing_Page_OurGreatCustomers": "Nagyszerű vásárlóink", + "Landing_Page_WebApplicationFramework": "Web Application Framework", + "Landing_Page_WebDevelopmentPlatform": "Webfejlesztési platform", + "Landing_Page_CompleteWebDevelopmentPlatform": "Komplett webfejlesztési platform", + "Landing_Page_TryFreeDemo": "Próbáld ki az ingyenes demót", + "Landing_Page_StartingPointForWebApplications": "Az ASP.NET Core alapú webes alkalmazások kiindulópontja! A legjobb webfejlesztés érdekében az ABP-keretrendszeren alapul.", + "Landing_Page_AbpProvidesSoftwareInfrastructure": "Az ABP Framework szoftver infrastruktúrát biztosít kiváló webalkalmazások fejlesztéséhez a legjobb gyakorlatokkal.", + "Landing_Page_MicroserviceCompatibleArchitecture": "Mikroszolgáltatással kompatibilis architektúra", + "Landing_Page_PreBuiltApplicationModulesAndThemes": "Előre elkészített alkalmazásmodulok és témák", + "Landing_Page_MultiTenantArchitecture": "Több bérlős építészet", + "Landing_Page_MultiTenancyDescription": "SaaS alkalmazások egyszerűen! Integrált több bérlés az adatbázistól a felhasználói felületig.", + "Landing_Page_DDDIntroduction": "DDD minták és elvek alapján tervezték és fejlesztették. Réteges modellt biztosít az alkalmazáshoz.", + "Landing_Page_CrossCuttingConcernsInfo": "Teljes infrastruktúra az engedélyezéshez, érvényesítéshez, kivételkezeléshez, gyorsítótárazáshoz, auditnaplózáshoz, tranzakciókezeléshez és még sok máshoz.", + "Landing_Page_PreBuiltApplicationModules": "Előre beépített alkalmazásmodulok, amelyek a leggyakoribb webalkalmazási követelményeket tartalmazzák.", + "Landing_Page_ChatModule": "Csevegés", + "Landing_Page_DocsModule": "Dokumentumok", + "Landing_Page_FileManagementModule": "Dokumentumok", + "Landing_Page_CustomerStory_1": "Az ABP Commercial lehetővé tette az SC Ventures számára, hogy 9 hónapon belül egy banki szintű többbérlős silo-adatbázis SaaS-platformot szállítson a követelések/tartozások ellátási láncának támogatására, jelentős értékű számlák több integrált horgonyból történő finanszírozásához. Az ABP modularitása lehetővé tette a csapat számára, hogy rekordidő alatt szállítson, átadja az összes VAPT-t, és a konténeres mikroszolgáltatások veremét teljes CI/CD-n és csővezetékeken keresztül üzembe helyezze.", + "Landing_Page_CustomerStory_2": "Látjuk az ABP Commercial használatának értékét az egyedi fejlesztési projektek általános költségeinek csökkentésére. És a csapat képes egységesíteni a kódmintát a különböző projektfolyamokban. Több lehetőséget látunk a keretrendszerben arra, hogy a korábbinál gyorsabban építsünk új funkciókat. Bízunk benne, hogy folyamatosan látni fogjuk az ABP Commercial kihasználásának értékét.", + "Landing_Page_CustomerStory_3": "Szeretjük az ABP-t. Nem kell mindent a nulláról írnunk. A beépített funkciókból indulunk ki, és csak arra koncentrálunk, amit valóban meg kell írnunk. Ezenkívül az ABP jól felépített, és a kód kiváló minőségű, kevesebb hibával. Ha magunknak kellene megírnunk mindent, amire szükségünk van, akkor lehet, hogy éveket kellene töltenünk. Még egyszer, amit szeretünk, az az, hogy az új verzió, a hibajavítás vagy a fejlesztés nagyon hamar, minden második héten megjelenik. Nem várunk túl sokáig.", + "Landing_Page_CustomerStory_4": "Az ABP Commercial egy fantasztikus termék, amelyet ajánlunk. Kereskedelmi termékek, amelyeket ügyfeleink számára egyetlen konfigurálható platformon értékesíthetnek. Az ugrásszerű indítás, amelyet a keret és az eszközök biztosítanak bármely csapat számára, minden centet megér. Az ABP Commercial volt a legjobban megfelel az igényeinknek.", + "Landing_Page_AdditionalServices": "Egyedi vagy mennyiségi licensz, beépítés, élő képzés és támogatás, egyedi projektfejlesztés, meglévő projektek portolása és így tovább...", + "Landing_Page_IncludedDeveloperLicenses": "{0} fejlesztői licenszet tartalmaz", + "Landing_Page_SeeOnDemo": "Lásd a demóban", + "Landing_Page_LeptonThemes": "Lepton Themes", + "Landing_Page_AccountModuleDescription_1": "Ez a modul egy alkalmazás hitelesítési rendszerét valósítja meg;", + "Landing_Page_AccountModuleDescription_2": "Bejelentkezési oldalt biztosít a felhasználónévvel és jelszóval", + "Landing_Page_AccountModuleDescription_3": "Regisztrációs oldalt biztosít új fiók létrehozásához.", + "Landing_Page_AccountModuleDescription_4": "Elfelejtett jelszó oldalt biztosít a jelszó-visszaállítási hivatkozás e-mailben történő elküldéséhez.", + "Landing_Page_AccountModuleDescription_5": "E- mail megerősítési funkciót biztosít felhasználói felülettel.", + "Landing_Page_AccountModuleDescription_6": "Kétfaktoros hitelesítést valósít meg (SMS és e-mail).", + "Landing_Page_AccountModuleDescription_7": "Megvalósítja a felhasználói zárolást (zárolja a fiókot a beállított időtartamra, ha bizonyos számú sikertelen bejelentkezés történik érvénytelen hitelesítő adatok miatt egy bizonyos időintervallumon belül).", + "Landing_Page_AccountModuleDescription_8": "Megvalósítja az Identity Server hitelesítési kiszolgáló felhasználói felületét és funkcióit.", + "Landing_Page_AccountModuleDescription_9": "Lehetővé teszi a bérlők közötti váltást több bérlős környezetben.", + "Landing_Page_AccountModuleDescription_10": "Lehetővé teszi az alkalmazás felhasználói felületének nyelvének módosítását.", + "Landing_Page_AuditLoggingModuleDescription_1": "Ez a modul biztosítja a naplózási felületet a naplózási infrastruktúra számára. Lehetővé teszi az ellenőrzési naplóbejegyzések és entitásmódosítási naplók keresését, szűrését és megjelenítését.", + "Landing_Page_AuditLoggingModuleDescription_2": "Az ellenőrzési naplóbejegyzés kritikus adatokat tartalmaz minden ügyfélkérelemről:", + "Landing_Page_AuditLoggingModuleDescription_3": "URL, böngésző, IP-cím, ügyfélnév", + "Landing_Page_AuditLoggingModuleDescription_4": "A felhasználó", + "Landing_Page_AuditLoggingModuleDescription_5": "HTTP metódus, HTTP visszatérési állapotkód", + "Landing_Page_AuditLoggingModuleDescription_6": "Siker/kudarc, kivétel részletei, ha rendelkezésre állnak", + "Landing_Page_AuditLoggingModuleDescription_7": "Kérelem végrehajtásának időtartama", + "Landing_Page_AuditLoggingModuleDescription_8": "Az entitások létrejöttek, törölve vagy frissítve ebben a kérésben (módosított tulajdonságokkal).", + "Landing_Page_BloggingModuleDescription_1": "Ez a modul egy egyszerű blogot ad hozzá az ABP-alkalmazáshoz;", + "Landing_Page_BloggingModuleDescription_2": "Lehetővé teszi több blog létrehozását egyetlen alkalmazásban.", + "Landing_Page_BloggingModuleDescription_3": "Támogatja a Markdown formátumot.", + "Landing_Page_BloggingModuleDescription_4": "Lehetővé teszi megjegyzés írását egy bejegyzéshez.", + "Landing_Page_BloggingModuleDescription_5": "Lehetővé teszi címkék hozzárendelését a blogbejegyzésekhez.", + "Landing_Page_BloggingModuleDescription_6": "Tekintse meg a blog.abp.io webhelyet a blogolási modul élő példájaként.", + "Landing_Page_ChatModuleDescription_1": "Ez a modul valós idejű üzenetküldésre szolgál az alkalmazásban lévő felhasználók között.", + "Landing_Page_ChatModuleDescription_2": "Valós idejű üzenetküldés a chat oldalon.", + "Landing_Page_ChatModuleDescription_3": "Keressen felhasználókat az alkalmazásban új beszélgetésekhez.", + "Landing_Page_ChatModuleDescription_4": "Névjegylista a legutóbbi beszélgetésekhez.", + "Landing_Page_ChatModuleDescription_5": "Új üzenet értesítések, amikor a felhasználó egy másik oldalt néz.", + "Landing_Page_ChatModuleDescription_6": "Teljes olvasatlan üzenetek száma jelvény a menüikonon.", + "Landing_Page_ChatModuleDescription_7": "Az olvasatlan üzenetek száma az egyes beszélgetéseknél.", + "Landing_Page_ChatModuleDescription_8": "Lusta betöltött beszélgetések.", + "Landing_Page_DocsModuleDescription_1": "Ez a modul műszaki dokumentációs weboldalak létrehozására szolgál;", + "Landing_Page_DocsModuleDescription_2": "Beépített GitHub integráció : közvetlenül írhat és kezelhet dokumentumokat a GitHubon.", + "Landing_Page_DocsModuleDescription_3": "Verziókezelési támogatás közvetlenül integrálva a GitHub-kiadásokba.", + "Landing_Page_DocsModuleDescription_4": "Támogatja a több nyelvet (az alapértelmezett nyelv tartalék támogatásával).", + "Landing_Page_DocsModuleDescription_5": "Támogatja a Markdown és HTML formátumokat.", + "Landing_Page_DocsModuleDescription_6": "Navigációt és vázlatos részt biztosít.", + "Landing_Page_DocsModuleDescription_7": "Lehetővé teszi több projektdokumentáció tárolását egyetlen alkalmazásban.", + "Landing_Page_DocsModuleDescription_8": "Hivatkozások a fájlra a GitHubon, így bárki könnyedén hozzájárulhat a Szerkesztés linkre kattintva .", + "Landing_Page_DocsModuleDescription_9": "A GitHub-forrás mellett lehetővé teszi egy mappa egyszerű használatát dokumentációs forrásként.", + "Landing_Page_FileManagementModuleDescription_1": "Fájlok feltöltése, letöltése és rendezése hierarchikus mappastruktúrában.", + "Landing_Page_FileManagementModuleDescription_2": "Ez a modul fájlok feltöltésére, letöltésére és hierarchikus mappastruktúrába rendezésére szolgál. Több bérléssel is kompatibilis, és meghatározhatja bérlői teljes méretkorlátját.", + "Landing_Page_FileManagementModuleDescription_3": "Ez a modul a BLOB Storing rendszeren alapul, így különböző tárolószolgáltatókat használhat a fájltartalom tárolására.", + "Landing_Page_IdentityModuleDescription_1": "Ez a modul egy alkalmazás Felhasználó és szerepkör rendszerét valósítja meg;", + "Landing_Page_IdentityModuleDescription_2": "A Microsoft ASP.NET Core Identity könyvtárára épül.", + "Landing_Page_IdentityModuleDescription_3": "Szerepkörök és felhasználók kezelése a rendszerben. Egy felhasználónak több szerepe is lehet.", + "Landing_Page_IdentityModuleDescription_4": "Állítsa be az engedélyeket szerep- és felhasználói szinteken.", + "Landing_Page_IdentityModuleDescription_5": "Felhasználónként kétfaktoros hitelesítés és felhasználói kizárás engedélyezése/letiltása.", + "Landing_Page_IdentityModuleDescription_6": "Az alapvető felhasználói profil és jelszó kezelése.", + "Landing_Page_IdentityModuleDescription_7": "Igénytípusok kezelése a rendszerben, igények beállítása szerepkörökhöz és felhasználókhoz.", + "Landing_Page_IdentityModuleDescription_8": "Beállítási oldal a jelszó összetettségének , a felhasználói bejelentkezés, a fiók és a kizárás kezeléséhez.", + "Landing_Page_IdentityModuleDescription_9": "Támogatja az LDAP hitelesítést.", + "Landing_Page_IdentityModuleDescription_10": "E-mail és telefonszám ellenőrzést biztosít.", + "Landing_Page_IdentityModuleDescription_11": "Támogatja a közösségi bejelentkezési integrációkat (Twitter, Facebook, GitHub stb.).", + "Landing_Page_IdentityModuleDescription_12": "Szervezeti egységek kezelése a rendszerben.", + "Landing_Page_PaymentModuleDescription_1": "Integrációt biztosít a különböző fizetési átjárókhoz.", + "Landing_Page_PaymentModuleDescription_2": "Ez a modul integrációt biztosít a fizetési átjárókhoz, így könnyen kaphat fizetést ügyfeleitől.", + "Landing_Page_PaymentModuleDescription_3": "Ez a modul a következő fizetési átjárókat támogatja", + "Welcome_Page_UseSameCredentialForCommercialWebsites": "Ugyanazokat a hitelesítési adatokat használja a commercial.abp.io és a support.abp.io fájlokhoz .", + "WatchCrudPagesVideo": "Nézze meg a \"CRUD oldalak létrehozása az ABP Suite segítségével\" videót!", + "WatchGeneratingFromDatabaseVideo": "Nézze meg az \"ABP Suite: CRUD-oldalak generálása meglévő adatbázistáblákból\" videót!", + "WatchTakeCloserLookVideo": "Tekintse meg a „Nézze meg közelebbről a kódgenerálást: ABP Suite” videót!", + "ConfirmedEmailAddressRequiredToStartTrial": "A próbalicenc elindításához rendelkeznie kell egy megerősített e-mail címmel.", + "EmailVerificationMailNotSent": "Nem sikerült elküldeni az ellenőrző e-mailt.", + "GetConfirmationEmail": "Kattintson ide, ha megerősítő e-mailt szeretne kapni, ha még nem kapta meg.", + "WhichLicenseTypeYouAreInterestedIn": "Melyik licenctípus érdekli?", + "DontTakeOurWordForIt": "Ne fogadd el a szavunkat...", + "ReadAbpCommercialUsersWantYouToKnow": "Olvassa el, hogy az ABP Commercial felhasználói mit szeretnének tudni", + "Testimonial_ShortDescription_1": "Az ABP modularitása lehetővé tette, hogy a csapat időben teljesítsen.", + "Testimonial_ShortDescription_2": "Építsen új funkciókat gyorsabban, mint korábban.", + "Testimonial_ShortDescription_3": "A beépített funkciókból indulunk ki, és csak arra koncentrálunk, amit valóban meg kell írnunk.", + "Testimonial_ShortDescription_4": "Az ABP Commercial volt a legjobban megfelelő az igényeinknek.", + "OnlineReviewersOnAbpCommercial": "Online vélemények az ABP Commercial-ról", + "SeeWhatToldAboutAbpCommercial": "Tekintse meg, mit mondtak az ABP Commercialról, és írja le gondolatait, ha akarja." } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ro-RO.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ro-RO.json index 44b6f66037..be56afbb43 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ro-RO.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/ro-RO.json @@ -341,7 +341,7 @@ "SignIn": "Autentificare", "Or": "Sau", "TellUsAboutYourself": "Spuneţi-ne despre dumneavoastră", - "Surname": "Nume", + "Surname": "Nume de familie", "DoYouAgreePrivacyPolicy": "Sunt de acord cu Termenii şi condiţiile şi Politica de confidenţialitate.", "VolosoftMarketingInformationMessage": "Sunt de acord să primesc informaţii, sfaturi şi oferte despre soluţii pentru afaceri şi organizaţii şi alte produse şi servicii Volosoft.", "VolosoftSharingInformationMessage": "Sunt de acord ca Volosoft să partajeze informaţiile mele cu partenerii selectaţi astfel încât să primesc informaţii relevante despre produsele şi serviciile lor.", @@ -380,4 +380,4 @@ "TrialLicenseExpiredInfo": "Perioada de licență de probă a expirat!", "CommercialNewsletterConfirmationMessage": "Sunt de acord cu Termenii și condițiile și cu Politica de confidențialitate ." } -} \ No newline at end of file +} diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json index bd1794cd36..c8d59816ce 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hans.json @@ -548,7 +548,7 @@ "MyOrganizations_Detail_OwnerRightInfo": "您正在使用您的 {1} 所有者权利中的 {0}。", "MyOrganizations_Detail_CopyApiKey": "复制密钥", "MyOrganizations_Detail_ApiKeyDescription": "API 密钥是托管在 {1} 上的 PRO 包的令牌。 ", - "MyOrganizations_Detail_YourPrivateNugetSource": "您的私有 NuGet 源是 {0}", + "MyOrganizations_Detail_YourPrivateNugetSource": "您的私有 NuGet 源是 {0}", "MyOrganizations_Detail_PrivateNugetSourceWarning": "这将自动添加一个源到您的 ABP 解决方案中的 NuGet.Config。 不要与未经授权的用户共享您的私钥!", "MyOrganizations_Detail_DeveloperSeatInfo": "您正在使用您的 {1} 个开发者席位中的 {0} 个。", "NeedMoreSeatsForYourTeam": "您的团队需要更多席位吗?", @@ -578,7 +578,7 @@ "PrePayment_IyzicoRedirectionInfo": "您将被重定向到 Iyzico 支付网关以安全地完成您的购买。", "PrePayment_IyzicoAcceptVisaAndMasterCard": "Iyzico 接受 Visa 和 MasterCard。", "Purchase": "购买", - "AcceptTermsAndConditions": "我已阅读、理解并接受隐私政策条款和条件 EULA。", + "AcceptTermsAndConditions": "我已阅读、理解并接受隐私政策条款和条件 EULA。", "AcceptTermsAndConditionsWarningMessage": "请接受隐私政策和条款和条件", "SelectGatewayToContinue": "请选择一个网关以继续!", "GatewaySelection_SelectGateway": "选择支付网关", @@ -735,6 +735,8 @@ "ConfirmedEmailAddressRequiredToStartTrial": "你应该有一个确认的电子邮件地址,以便开始试用许可证。", "EmailVerificationMailNotSent": "电子邮件验证邮件不能发送。", "GetConfirmationEmail": "点击这里获取确认邮件 如果你还没有收到。", - "WhichLicenseTypeYouAreInterestedIn": "你感兴趣的许可证类型是什么?" + "WhichLicenseTypeYouAreInterestedIn": "你感兴趣的许可证类型是什么?", + "BlazoriseLicense": "我们是否需要购买Blazorise许可证?", + "BlazoriseLicenseExplanation": "我公司Volosoft和公司Megabit之间有合作协议,根据此协议,购买将同时包含了Blazorise许可证与ABP商业产品,因此我们的客户不需要再额外购买Blazorise许可证。" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hant.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hant.json index c258ea0800..a8b0398369 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hant.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/zh-Hant.json @@ -380,6 +380,8 @@ "TrialLicenseExpireMessage": "您正在使用試用許可證,您的試用許可證將於 {0}到期。", "TryForFree": "免費試用", "TrialLicenseExpiredInfo": "您的試用許可期限已過!", - "CommercialNewsletterConfirmationMessage": "我同意條款和條件隱私政策。" + "CommercialNewsletterConfirmationMessage": "我同意條款和條件隱私政策。", + "BlazoriseLicense": "我们是否需要购买Blazorise许可证?", + "BlazoriseLicenseExplanation": "我公司Volosoft和公司Megabit之间有合作协议,根据此协议,购买将同时包含了Blazorise许可证与ABP商业产品,因此我们的客户不需要再额外购买Blazorise许可证。" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json index 0ed3eda832..c73da26137 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json @@ -150,7 +150,6 @@ "GetStarted": "Get Started", "SourceCode": "Source Code", "LeaveComment": "Leave Comment", - "ReadMore": "Read more", "ShowMore": "Show More", "NoPublishedPostsYet": "No published posts yet.", "Name": "Name", @@ -184,6 +183,7 @@ "Post_Index_Page_MetaDescription": "ABP Community's purpose is to create a contribution environment for developers who use the ABP framework.", "Layout_Title": "{0} | ABP Community", "Layout_MetaDescription": "ABP Community is an environment where people can share posts about ABP framework and follows the projects.", - "Index_Page_CommunityIntroduction": "This is a hub for ABP Framework, .NET and software development. You can read the articles, watch the video tutorials, get informed about ABP’s development progress and ABP-related events, help other developers and share your expertise with the ABP community." + "Index_Page_CommunityIntroduction": "This is a hub for ABP Framework, .NET and software development. You can read the articles, watch the video tutorials, get informed about ABP’s development progress and ABP-related events, help other developers and share your expertise with the ABP community.", + "TagsInArticle": "Tags in article" } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/hu.json index 68d70f8615..bb401e6577 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/hu.json @@ -29,14 +29,12 @@ "ContributionGuide": "Hozzájárulási útmutató", "BugReport": "Hibajelentés", "SeeAllPosts": "Az összes bejegyzés megtekintése", - "WelcomeToABPCommunity!": "Üdvözöljük az ABP közösségben!", - "MyProfile": "A profilom", - "MyOrganizations": "Szervezeteim", + "WelcomeToABP": "Üdvözöljük az ABP-ben", "EmailNotValid": "Kérjük valós e-mail címet adjon meg!", "FeatureRequest": "Funkciókérés", "CreatePostTitleInfo": "A bejegyzés listán megjelenítendő bejegyzés címe.", "CreatePostSummaryInfo": "A bejegyzés rövid összefoglalása, amely megjelenik a bejegyzéslistán.", - "CreatePostCoverInfo": "Hatékony cikk létrehozásához adjon hozzá egy borítóképet. Tölts fel 16:9-es képarányú képeket a legjobb nézet érdekében. Maximális fájlméret: 1 MB.", + "CreatePostCoverInfo": "Hatékony bejegyzés létrehozásához adj hozzá egy borítóképet. Tölts fel 16:9-es képarányú képeket a legjobb nézet érdekében. Maximális fájlméret: 1 MB.", "ThisExtensionIsNotAllowed": "Ez a bővítmény nem engedélyezett.", "TheFileIsTooLarge": "A fájl túl nagy.", "GoToThePost": "Ugrás a cikkre", @@ -45,7 +43,7 @@ "Done": "Kész", "Open": "Nyisd ki", "Closed": "Zárva", - "LatestQuestionOnThe": "Legújabb kérdés a", + "RecentQuestionFrom": "Friss kérdés tőle", "Stackoverflow": "Stackoverflow", "Votes": "szavazatokat", "Answer": "Válasz", @@ -59,7 +57,7 @@ "QuestionItemErrorMessage": "Nem sikerült lekérni a Stackoverflow legújabb kérdés részleteit.", "Oops": "Hoppá!", "CreatePostSuccessMessage": "A cikk sikeresen beküldve. A webhely adminisztrátorának felülvizsgálata után tesszük közzé.", - "ChooseCoverImage": "Válasszon borítóképet...", + "Browse": "Tallózás", "CoverImage": "Borítókép", "ShareYourExperiencesWithTheABPFramework": "Ossza meg tapasztalatait az ABP keretrendszerrel!", "Optional": "Választható", @@ -88,6 +86,8 @@ "PostRequestFromGithubIssue": "Jelenleg nincs cikkkérés.", "LatestPosts": "Legutóbbi bejegyzések", "ArticleRequests": "Cikkigények", + "ArticleRequestsDescription": "Konkrét tartalmat szeretne látni itt? Megkérheted a közösséget, hogy hozza létre!", + "LatestContentRequests": "Legújabb tartalomkérések", "AllPostRequests": "Lásd: Összes cikkigénylés", "SubscribeToTheNewsletter": "Feliratkozás a Hírlevélre", "NewsletterEmailDefinition": "Információkat kaphat az ABP eseményeiről, például új kiadásokról, ingyenes forrásokról, cikkekről és egyebekről.", @@ -115,7 +115,6 @@ "VideoUrl": "Videó URL-je", "GithubPostUrl": "Github cikk URL-je", "ExternalPostUrl": "Külső cikk URL", - "CreatePostCoverInfo": "Hatékony bejegyzés létrehozásához adj hozzá egy borítóképet. Tölts fel 16:9-es képarányú képeket a legjobb nézet érdekében. Maximális fájlméret: 1 MB.", "ThankYouForContribution": "Köszönjük, hogy hozzájárult az ABP közösséghez.", "GithubPost": "Github cikk", "GithubPostSubmitStepOne": "1. Írjon cikket bármely nyilvános GitHub-tárhelyről Markdown formátumban. példa ", @@ -142,6 +141,49 @@ "MinimumSearchContent": "Legalább 3 karaktert kell megadnod!", "Volo.AbpIo.Domain:060001": "A forrás URL (\"{PostUrl}\") nem Github URL", "Volo.AbpIo.Domain:060002": "A cikk tartalma nem érhető el a Github(\"{PostUrl}\") forrásból.", - "Volo.AbpIo.Domain:060003": "Nem található a cikk tartalma!" + "Volo.AbpIo.Domain:060003": "Nem található a cikk tartalma!", + "SeeMore": "Nézek többet", + "JoinTheABPCommunity": "Csatlakozz az ABP közösséghez", + "ABPCommunityTalks": "ABP közösségi beszélgetések", + "LiveDemo": "Élő Demo", + "GetLicense": "Szerezzen licenszet", + "GetStarted": "Fogj neki", + "SourceCode": "Forráskód", + "LeaveComment": "Hagyj megjegyzést", + "ShowMore": "Mutass többet", + "NoPublishedPostsYet": "Még nincsenek közzétett bejegyzések.", + "Name": "Név", + "Surname": "Vezetéknév", + "WebSite": "Weboldal", + "FullURL": "Teljes URL", + "JobTitle": "Munka megnevezése", + "Prev": "Előző", + "Previous": "Előző", + "Next": "Következő", + "Share": "Részvény", + "SortBy": "Sorrend", + "NoPublishedEventsYet": "Még nincsenek közzétett események.", + "SubscribeYoutubeChannel": "Iratkozz fel a Youtube csatornára", + "Enum:EventType:0": "Beszélgetések", + "MemberNotPublishedPostYet": "Ez a tag még nem tett közzé bejegyzéseket.", + "TimeAgo": "{0} ezelőtt", + "Discord_Page_JoinCommunityMessage": "Csatlakozz az ABP Discord közösséghez", + "Discord_Page_Announce": "Örömmel jelentjük be az ABP Community Discord Servert!", + "Discord_Page_Description_1": "Az ABP közösség az első nap óta növekszik. Egy hivatalos ABP Discord szerver létrehozásával a következő lépésre akartuk vinni, hogy az ABP közösség az azonnali üzenetküldés csodáival kommunikálhasson egymással.", + "Discord_Page_Description_2": "Az ABP Community Discord Server az a hely, ahol bemutathatja alkotásait az ABP Framework segítségével, megoszthatja az Ön számára bevált tippeket, értesülhet az ABP Framework-vel kapcsolatos legfrissebb hírekről és bejelentésekről, egyszerűen cseveghet a közösség tagjaival, hogy eszmét cserélhessen, és érezze jól magát!", + "Discord_Page_Description_3": "Ez az ABP Community Discord szerver a hivatalos, ahol az ABP Core Team jelen van a szerveren, hogy felügyelje.", + "Discord_Page_JoinToServer": "Csatlakozz az ABP Discord szerverhez", + "Events_Page_MetaTitle": "ABP közösségi események", + "Events_Page_MetaDescription": "Az ABP Team által rendezett élő műsorok hétköznapi előadások, tele közösségi tartalommal, demókkal, kérdésekkel és válaszokkal, valamint az ABP-ben zajló eseményekről szóló vitákkal.", + "Events_Page_Title": "ABP közösségi beszélgetések", + "Events_Page_WritingFromUser": "Olvassa el {0} írását az ABP közösségben.", + "Post_Create_Page_MetaTitle": "Új bejegyzés", + "Post_Create_Page_MetaDescription": "Hozzon létre bejegyzést, hogy megossza tapasztalatait az ABP keretrendszerrel kapcsolatban, és hozzájáruljon az ABP közösséghez.", + "Post_Create_Page_CreateNewPost": "Új bejegyzés létrehozása", + "Post_Index_Page_MetaDescription": "Az ABP Community célja egy hozzájárulási környezet létrehozása az ABP keretrendszert használó fejlesztők számára.", + "Layout_Title": "{0} | ABP-közösség", + "Layout_MetaDescription": "Az ABP Community egy olyan környezet, ahol az emberek megoszthatnak bejegyzéseket az ABP keretrendszerről, és követhetik a projekteket.", + "Index_Page_CommunityIntroduction": "Ez az ABP Framework, a .NET és a szoftverfejlesztés központja. Elolvashatja a cikkeket, megnézheti az oktatóvideókat, tájékozódhat az ABP fejlesztési előrehaladásáról és az ABP-vel kapcsolatos eseményekről, segíthet más fejlesztőknek, és megoszthatja szakértelmét az ABP közösséggel.", + "TagsInArticle": "Címkék a cikkben" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json index 3513a37dde..8196d567a1 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/zh-Hans.json @@ -150,7 +150,6 @@ "GetStarted": "开始使用", "SourceCode": "源代码", "LeaveComment": "发表评论", - "ReadMore": "阅读更多", "ShowMore": "展示更多", "NoPublishedPostsYet": "还没有发布的帖子。", "Name": "名字", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Support/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Support/Localization/Resources/hu.json new file mode 100644 index 0000000000..292fb51cd2 --- /dev/null +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Support/Localization/Resources/hu.json @@ -0,0 +1,6 @@ +{ + "culture": "hu", + "texts": { + "FAQ": "GYIK" + } +} \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs index 552b5949e1..f64552be30 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/AbpIoWwwResource.cs @@ -1,5 +1,8 @@ -namespace AbpIoLocalization.Www +using Volo.Abp.Localization; + +namespace AbpIoLocalization.Www { + [LocalizationResourceName("AbpIoWww")] public class AbpIoWwwResource { diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index 41eda60de6..faba7ab94e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -293,7 +293,6 @@ "ExploreDocumentationAndGuides": "Explore the comprehensive documentation and guides.", "Documentations": "Documentation", "Views": "Views", - "ReadMore": "Read More", "EnterYouEmailToGetNews": "Enter your email to get the latest news about the ABP Framework", "Tiered": "Tiered", "SeparateIdentityServer": "Separate Identity Server", @@ -372,6 +371,28 @@ "MasteringAbpFramework_Book_What_You_Will_Learn_8": "Write unit, integration, and UI tests using ABP Framework.", "MasteringAbpFramework_Book_WhoIsThisBookFor": "Who's this book for", "MasteringAbpFramework_Book_WhoIsThisBookFor_Description": "This book is for web developers who want to learn software architectures and best practices for building\n maintainable web-based solutions using Microsoft technologies and ABP Framework. Basic knowledge of C#\n and ASP.NET Core is necessary to get started with this book.", - "ComputersAndTechnology": "Computers & Technology" + "ComputersAndTechnology": "Computers & Technology", + "BuildingMicroserviceSolutions": "Building Microservice Solutions", + "MicroserviceBookPracticalGuide": "This book is a reference guide for developing and managing microservice-based applications using the ABP Framework. It references the .NET Microservice Sample Reference Application: eShopOnContainers and discusses the architectural design and implementation approaches using the ABP Framework. By the end of this book, you'll learn how ABP approaches the common microservice complexities such as authorization, distributed transactions, inter-microservice communications, deployment, etc.", + "IntroducingTheSolution": "Introducing the eShopOnAbp Solution", + "RunningTheSolution": "Running the Solution", + "UnderstandingTheAuthenticationSystem": "Understanding the Authentication System", + "ExploringTheApplications": "Exploring the Applications", + "UnderstandingTheAPIGateways": "Understanding the API Gateways", + "DevelopingTheMicroservices": "Developing the Microservices", + "UnderstandingTheInfrastructure": "Understanding the Infrastructure", + "DiggingInTheUseCases": "Digging in the Use Cases", + "DeployingTheSolution": "Deploying the Solution", + "ThisBookIsInDraftStageAndIsNotCompletedYet": "This book is in draft stage and is not completed yet.", + "Authors": "Authors", + "MicroserviceEBook": "Microservice E-Book", + "SelectUITheme": "Select UI Theme", + "LeptonXLiteTheme": "LeptonX Lite Theme", + "BasicTheme": "Basic Theme", + "LeptonXLiteThemeInfo": " A modern and stylish Bootstrap UI theme. Ideal if you want to have a production ready UI theme. This is the newest theme and is the default.", + "BasicThemeInfo": "Minimalist UI theme with plain Bootstrap colors and styles. Ideal if you will build your own UI theme.", + "SeeDocumentation": "See documentation.", + "SeeFullScreen": "🖼️ See the screenshot", + "BuildingMicroserviceSolutionsShortDescription": "This book is a reference guide for developing and managing microservice-based applications using the ABP Framework." } } diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/hu.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/hu.json index cb1639fd42..2a6ebf2feb 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/hu.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/hu.json @@ -174,6 +174,7 @@ "CreateProjectWizard": "Ez a varázsló új projektet hoz létre az indítási sablonból, amely megfelelően be van állítva a projekt elindításához.", "TieredOption": "Létrehoz egy többszintű megoldást, ahol a webes és a HTTP API-rétegek fizikailag el vannak választva. Ha nincs bejelölve, réteges megoldást hoz létre, amely kevésbé bonyolult és a legtöbb forgatókönyvhöz megfelelő.", "SeparateIdentityServerOption": "A szerveroldalt két alkalmazásra választja szét: az első az identitáskiszolgálóhoz, a második pedig a szerveroldali HTTP API-hoz való.", + "ProgressiveWebApplicationOption": "Progresszív webalkalmazásként határozza meg a projektet", "UseslatestPreVersion": "A legújabb kiadás előtti verziót használja", "ReadTheDocumentation": "Olvassa el a dokumentációt", "Documentation": "Dokumentáció", @@ -214,7 +215,11 @@ "SeeDocs": "Lásd: Dokumentumok", "None": "Egyik sem", "Application": "Alkalmazás", + "ApplicationExplanation": "Teljesen rétegzett megoldást hoz létre a tartományvezérelt tervezési gyakorlatok alapján. Olyan hosszú távú projektekhez ajánlott, amelyek karbantartható és bővíthető kódbázist igényelnek.", + "ApplicationNoLayer": "Alkalmazás (egyrétegű)", + "ApplicationNoLayerExplanation": "Egyrétegű webalkalmazást hoz létre. Egyszerűbb és könnyen érthető architektúrájú alkalmazás készítéséhez ajánlott.", "Module": "Modul", + "ModuleExplanation": "Újrafelhasználható, teljesen rétegzett alkalmazásmodul-megoldást hoz létre. Ezzel a lehetőséggel modulokat hozhat létre a moduláris alkalmazásához.", "PackageName": "Csomag név", "LicenseURL": "Licenc URL", "License": "Engedély", @@ -273,6 +278,120 @@ "SubscribeToNewsletter": "Iratkozzon fel a hírlevélre, hogy tájékozódjon az ABP.IO Platform eseményeiről, például új kiadásokról, cikkekről, ajánlatokról stb.", "FirstEdition": "Első kiadás", "ThankYou": "Köszönöm!", - "CheckboxMandatory": "Ezt ellenőriznie kell a folytatáshoz!" + "CheckboxMandatory": "Ezt ellenőriznie kell a folytatáshoz!", + "UserInterface": "Felhasználói felület", + "APIGateway": "API átjáró", + "Database": "Adatbázis", + "Saas": "Saas", + "OpenSourceWebApp": "Nyílt forráskódú
webalkalmazás", + "Framework": "Keretrendszer", + "AuditLoggingExplanation": "Automatikusan nyomon követheti az összes műveletet és adatváltozást a rendszerben.", + "AbpNewCommandExplanation": "Új megoldásokat hoz létre az ABP indítási sablonjaival.", + "AbpAddModuleCommandExplanation": "Előre elkészített alkalmazásmodulokat telepít a megoldásra", + "AbpUpdateCommandExplanation": "Automatikusan frissíti az összes ABP-vel kapcsolatos NuGet és NPM csomagot a megoldásban.", + "ExploreAllCLICommands": "Fedezze fel az összes CLI-parancsot", + "ExploreDocumentationAndGuides": "Fedezze fel az átfogó dokumentációt és útmutatókat.", + "Documentations": "Dokumentáció", + "Views": "Nézetek", + "EnterYouEmailToGetNews": "Adja meg e-mail címét, hogy megkapja a legfrissebb híreket az ABP-keretrendszerrel kapcsolatban", + "Tiered": "Többszintű", + "SeparateIdentityServer": "Külön identitásszerver", + "ProgressiveWebApplication": "Progresszív webes alkalmazás", + "Preview": "Előnézet", + "CreateANewSolution": "Hozzon létre egy új megoldást", + "ABPFrameworkFeatures": "Az ABP keretrendszer jellemzői", + "Commercial": "Kereskedelmi", + "ThirdPartyTools": "Harmadik féltől származó eszközök", + "Back": "Vissza", + "Community": "Közösség", + "SeeMore": "Többet látni", + "DetailsOfTheEBook": "Az E-könyv részletei", + "JoinOurMarketingNewsletter": "Csatlakozzon marketing hírlevelünkhöz", + "FrameworkNewsletterConfirmationMessage": "Elfogadom az Általános Szerződési Feltételeket és az Adatvédelmi szabályzatot .", + "GetYourFreeEBook": "Szerezze meg ingyenes DDD e-könyvét", + "EverythingYouNeedToKnow": "Minden, amit tudnia kell.", + "PreOrderNow": "Előrendelés most", + "UITheming": "UI témák", + "UIThemingExplanation": "Hozzon létre újrafelhasználható felhasználói felület-témákat és elrendezéseket, vagy használja valamelyik előre elkészített felhasználói felület-témát.", + "DataFilteringExplanation2": "Automatikusan szűrje le az adatbázisból származó lekérdezéseket, hogy könnyen megvalósíthassa az olyan mintákat, mint a soft-delete és a multi-tenancy.", + "NeedHelp": "Kell segítség?", + "GiveYourProjectAName": "Adjon nevet a projektjének", + "SelectProjectType": "Válassza ki a Projekt típusát", + "SelectUIFramework": "Válassza a UI-keretrendszert", + "SelectDatabaseProvider": "Válassza az Adatbázis-szolgáltató lehetőséget", + "SelectDatabaseManagementSystem": "Válassza az Adatbázis-kezelő rendszer lehetőséget", + "InstallingTheABPCLI": "Az ABP CLI telepítése", + "CreateYourProjectNow": "Hozza létre projektjét most", + "OrderOn": "Rendelés itt: {0}", + "DownloadFreeDDDBook": "Ingyenes DDD könyv letöltése", + "WhatIsABPFramework": "Mi az az ABP-keretrendszer?", + "TenantDatabase": "Bérlői {0} adatbázis", + "SharedDatabase": "Megosztott adatbázis", + "ConnectionResolver": "Kapcsolatfeloldó", + "TenantBasedDataFilter": "Bérlő alapú adatszűrő", + "ApplicationCode": "Alkalmazási kód", + "TenantResolution": "Bérlői állásfoglalás", + "TenantUser": "Bérlő {0} felhasználó", + "CardTitle": "Kártya címe", + "View": "Nézet", + "Model": "Modell", + "Email": "Email", + "Password": "Jelszó", + "Address": "Cím", + "Gender": "Nem", + "Male": "Férfi", + "Female": "Nő", + "Submit": "Beküldés", + "Unspecified": "Meg nem határozott", + "StaticFileMiddleware": "Statikus fájl köztes-szoftver", + "RazorViewEngine": "Razor View Engine", + "PhysicalFiles": "Fizikai fájlok (wwwroot)", + "EmbeddedFiles": "Beágyazott fájlok (DLL)", + "DynamicFiles": "Dinamikus fájlok (memória)", + "BuildSolutionsWithAbp": "Építsen karbantartható .NET-megoldásokat az ABP használatával bevált szoftverfejlesztési gyakorlatok követésével.", + "BuyOnAmazon": "Vásároljon az Amazonon", + "BuyOnPackt": "Vásároljon Packt-en", + "Discounted": "Kedvezményes", + "MasteringAbpFramework_Book_KeyFeatures": "Főbb jellemzők", + "MasteringAbpFramework_Book_Key_Features_Description_1": "Építsen robusztus, karbantartható, moduláris és méretezhető szoftvermegoldásokat az ABP Framework segítségével.", + "MasteringAbpFramework_Book_Key_Features_Description_2": "Ismerje meg, hogyan valósíthatja meg a SOLID elveket és a tartományvezérelt tervezést webalkalmazásaiban.", + "MasteringAbpFramework_Book_Key_Features_Description_3": "Fedezze fel, hogyan gyorsítja fel az ABP Framework a fejlesztési ciklust az ismétlődő feladatok automatizálásával.", + "MasteringAbpFramework_Book_Description": "Könyv leírása", + "MasteringAbpFramework_Book_Description_Details_1": "Az ABP Framework egy komplett infrastruktúra modern webalkalmazások létrehozásához a szoftverfejlesztési bevált gyakorlatok és konvenciók követésével. Az ABP magas szintű keretrendszerével és ökoszisztémájával megvalósíthatja a Ne ismételje meg magát (DRY) elvet, és az üzleti kódjára összpontosítson.", + "MasteringAbpFramework_Book_Description_Details_2": "Az ABP Framework megalkotója által írt könyv segít a keretrendszer és a modern webalkalmazás-fejlesztési technikák teljes megértésében. Az alapvető fogalmak lépésről lépésre történő magyarázatával és gyakorlati példákkal megismerheti a modern webes megoldások követelményeit, és megértheti, hogy az ABP Framework hogyan teszi élvezetessé saját megoldásainak fejlesztését. Felfedezi a vállalati webalkalmazás-fejlesztés általános követelményeit, és felfedezheti az ABP által biztosított infrastruktúrát. A könyv során megismerkedhet a szoftverfejlesztés bevált gyakorlataival a karbantartható és moduláris webes megoldások létrehozásához.", + "MasteringAbpFramework_Book_Description_Details_3": "A könyv végére képes lesz egy komplett webes megoldás létrehozására, amely könnyen fejleszthető, karbantartható és tesztelhető.", + "MasteringAbpFramework_Book_WhatYouWillLearn": "Mit fog tanulni", + "MasteringAbpFramework_Book_What_You_Will_Learn_1": "Állítsa be a fejlesztői környezetet, és kezdje el az ABP Framework használatát.", + "MasteringAbpFramework_Book_What_You_Will_Learn_2": "Az Entity Framework Core és a MongoDB segítségével fejlesztheti adathozzáférési rétegét.", + "MasteringAbpFramework_Book_What_You_Will_Learn_3": "Ismerje meg a több területet érintő aggályokat és azt, hogy az ABP hogyan automatizálja az ismétlődő feladatokat.", + "MasteringAbpFramework_Book_What_You_Will_Learn_4": "Ismerkedjen meg a tartományvezérelt tervezés megvalósításával az ABP Framework segítségével.", + "MasteringAbpFramework_Book_What_You_Will_Learn_5": "Hozzon létre felhasználói felület oldalakat és összetevőket az ASP.NET Core MVC (Razor Pages) és a Blazor segítségével.", + "MasteringAbpFramework_Book_What_You_Will_Learn_6": "Moduláris webalkalmazások létrehozásához dolgozzon több bérléssel.", + "MasteringAbpFramework_Book_What_You_Will_Learn_7": "Ismerje meg a modularitást, és hozzon létre újrafelhasználható alkalmazásmodulokat.", + "MasteringAbpFramework_Book_What_You_Will_Learn_8": "Írjon egység-, integrációs és UI-teszteket az ABP-keretrendszer használatával.", + "MasteringAbpFramework_Book_WhoIsThisBookFor": "Kinek szól ez a könyv", + "MasteringAbpFramework_Book_WhoIsThisBookFor_Description": "Ez a könyv azoknak a webfejlesztőknek szól, akik szoftverarchitektúrákat és bevált gyakorlatokat szeretnének megtanulni karbantartható webalapú megoldások Microsoft technológiáit és ABP-keretrendszert használó felépítéséhez. A könyv használatának megkezdéséhez alapszintű C# és ASP.NET Core ismerete szükséges.", + "ComputersAndTechnology": "Számítógépek és technológia", + "BuildingMicroserviceSolutions": "Mikroszolgáltatási megoldások építése", + "MicroserviceBookPracticalGuide": "Ez a könyv egy referencia útmutató a mikroszolgáltatás alapú alkalmazások fejlesztéséhez és kezeléséhez az ABP Framework segítségével. Hivatkozik a .NET Microservice Sample Reference Application : eShopOnContainers alkalmazásra, és tárgyalja az ABP-keretrendszert használó tervezési és megvalósítási megközelítéseket. A könyv végére megtudhatja, hogyan közelíti meg az ABP az olyan általános mikroszolgáltatási bonyolultságokat, mint az engedélyezés, az elosztott tranzakciók, a mikroszolgáltatások közötti kommunikáció, a telepítés stb.", + "IntroducingTheSolution": "Az eShopOnAbp megoldás bemutatása", + "RunningTheSolution": "A megoldás futtatása", + "UnderstandingTheAuthenticationSystem": "A hitelesítési rendszer megértése", + "ExploringTheApplications": "Az alkalmazások felfedezése", + "UnderstandingTheAPIGateways": "Az API-átjárók megértése", + "DevelopingTheMicroservices": "Mikroszolgáltatások fejlesztése", + "UnderstandingTheInfrastructure": "Az infrastruktúra megértése", + "DiggingInTheUseCases": "feltérképezni a használati eseteket", + "DeployingTheSolution": "A megoldás telepítése", + "ThisBookIsInDraftStageAndIsNotCompletedYet": "Ez a könyv tervezet stádiumban van, és még nem készült el.", + "Authors": "Szerzői", + "MicroserviceEBook": "Mikroszolgáltatás e-könyv", + "SelectUITheme": "Válassza ki a felhasználói felület témáját", + "LeptonXLiteTheme": "LeptonX Lite téma", + "BasicTheme": "Alap téma", + "LeptonXLiteThemeInfo": "Modern és stílusos Bootstrap UI téma. Ideális, ha gyártásra kész felhasználói felület témát szeretne. Ez a legújabb téma, és az alapértelmezett.", + "BasicThemeInfo": "Minimalista felhasználói felület téma egyszerű Bootstrap színekkel és stílusokkal. Ideális, ha saját felhasználói felület témát készít.", + "SeeDocumentation": "Lásd a dokumentációt .", + "SeeFullScreen": "🖼️ Nézze meg a képernyőképet" } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ro-RO.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ro-RO.json index bd04ba7f49..a1ff5f58ad 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ro-RO.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/ro-RO.json @@ -253,18 +253,18 @@ "Or": "Sau", "TellUsAboutYourself": "Spuneţi-ne un pic despre dumneavoastră", "Name": "Nume", - "Surname": "Nume", + "Surname": "Nume de familie", "CompanyName": "Nume companie", "DoYouAgreePrivacyPolicy": "Sunt de acord cu Termenii & condiţiile şi Politica de confidenţialitate.", "Free": "Gratuit", "DDDEBook": "E-book DDD", "PracticalGuideForImplementingDDD": "Această carte este un ghid practic pentru implementarea Domain Driven Design în framework-ul ABP.", "IntroducingDDD": "Introducere în Domain Driven Design", - "DDDLayersAndCleanArchitecture": "Straturile DDD & Arhitectură curată", + "DDDLayersAndCleanArchitecture": "Straturile DDD şi Arhitectură curată", "LayeringOfADotnetSolution": "Stratificarea unei soluţii .NET", "ImplementingDDDBuildingBlocks": "Implementând DDD Building Blocks", "DomainVsApplicationLogic": "Domain Logic vs Application Logic", - "SamplesAndDiscussions": "Exemple & Discuţii", + "SamplesAndDiscussions": "Exemple şi Discuţii", "EmailNotValid": "Vă rugăm să introduceţi o adresa de email validă.", "WeWillSendYouADownloadLink": "Un link care conţine e-book-ul a fost trimis către {0}. Verificaţi-vă folderele de inbox, junk sau spam!", "GoHome": "Pagina principală", diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json index 01fe9f8b7b..a4a6e142a9 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/tr.json @@ -279,6 +279,7 @@ "SubscribeToNewsletter": "ABP.IO Platform'u ile ilgili yeni haberler, makaleler, teklifler ve daha fazlası gibi gelişmeler hakkında bilgi almak için bültene abone olun.", "FirstEdition": "İlk Baskı", "ThankYou": "Teşekkürler!", - "CheckboxMandatory": "Devam etmek için bunu kontrol etmeniz gerekiyor!" + "CheckboxMandatory": "Devam etmek için bunu kontrol etmeniz gerekiyor!", + "ThisBookIsInDraftStageAndIsNotCompletedYet": "Bu kitap taslak aşamasındadır ve henüz tamamlanmamıştır." } } \ No newline at end of file diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json index 9a1373f76b..7826f00ca2 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/zh-Hans.json @@ -293,7 +293,6 @@ "ExploreDocumentationAndGuides": "探索全面的文档和指南。", "Documentations": "文档", "Views": "意见", - "ReadMore": "阅读更多", "EnterYouEmailToGetNews": "输入您的电子邮件以获取有关 ABP 框架的最新消息", "Tiered": "分层", "SeparateIdentityServer": "独立的身份服务器", @@ -372,6 +371,7 @@ "MasteringAbpFramework_Book_What_You_Will_Learn_8": "使用 ABP 框架编写单元、集成和 UI 测试。", "MasteringAbpFramework_Book_WhoIsThisBookFor": "这本书是给谁看的", "MasteringAbpFramework_Book_WhoIsThisBookFor_Description": "本书适用于希望学习软件架构和最佳实践的 Web 开发人员,以使用 Microsoft 技术和 ABP 框架构建\n 可维护的基于 Web 的解决方案。 C#\n 和 ASP.NET Core 的基本知识是开始阅读本书所必需的。", - "ComputersAndTechnology": "计算机与技术" + "ComputersAndTechnology": "计算机与技术", + "ThisBookIsInDraftStageAndIsNotCompletedYet": "这本书正在草案阶段,还没有完成。" } } \ No newline at end of file diff --git a/common.DotSettings b/common.DotSettings index 5c1cda48fd..f2cc0339ae 100644 --- a/common.DotSettings +++ b/common.DotSettings @@ -38,5 +38,6 @@ False False False + True True \ No newline at end of file diff --git a/common.props b/common.props index 2adcbdab77..f8b7c620c2 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 6.0.0-rc.4 + 7.0.0 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/ diff --git a/docs/en/Background-Jobs-Hangfire.md b/docs/en/Background-Jobs-Hangfire.md index 4ee58d84ef..869a8075af 100644 --- a/docs/en/Background-Jobs-Hangfire.md +++ b/docs/en/Background-Jobs-Hangfire.md @@ -80,6 +80,41 @@ After you have installed these NuGet packages, you need to configure your projec } ```` +### Specifying Queue + +You can use the [`QueueAttribute`](https://docs.hangfire.io/en/latest/background-processing/configuring-queues.html) to specify the queue. + +````csharp +using System.Threading.Tasks; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Emailing; + +namespace MyProject +{ + [Queue("alpha")] + public class EmailSendingJob + : AsyncBackgroundJob, ITransientDependency + { + private readonly IEmailSender _emailSender; + + public EmailSendingJob(IEmailSender emailSender) + { + _emailSender = emailSender; + } + + public override async Task ExecuteAsync(EmailSendingArgs args) + { + await _emailSender.SendAsync( + args.EmailAddress, + args.Subject, + args.Body + ); + } + } +} +```` + ### Dashboard Authorization Hangfire Dashboard provides information about your background jobs, including method names and serialized arguments as well as gives you an opportunity to manage them by performing different actions – retry, delete, trigger, etc. So it is important to restrict access to the Dashboard. diff --git a/docs/en/Background-Jobs-RabbitMq.md b/docs/en/Background-Jobs-RabbitMq.md index 16b8b0981a..8eec3733fb 100644 --- a/docs/en/Background-Jobs-RabbitMq.md +++ b/docs/en/Background-Jobs-RabbitMq.md @@ -126,25 +126,31 @@ By default, all the job types use the `Default` RabbitMQ connection. Configure(options => { options.DefaultQueueNamePrefix = "my_app_jobs."; + options.DefaultDelayedQueueNamePrefix = "my_app_jobs.delayed" + options.PrefetchCount = 1; options.JobQueues[typeof(EmailSendingArgs)] = new JobQueueConfiguration( typeof(EmailSendingArgs), queueName: "my_app_jobs.emails", - connectionName: "SecondConnection" + connectionName: "SecondConnection", + delayedQueueName:"my_app_jobs.emails.delayed" ); }); ```` -* This example sets the default queue name prefix to `my_app_jobs.`. If different applications use the same RabbitMQ server, it would be important to use different prefixes for each application to not consume jobs of each other. +* This example sets the default queue name prefix to `my_app_jobs.` and default delayed queue name prefix to `my_app_jobs.delayed`. If different applications use the same RabbitMQ server, it would be important to use different prefixes for each application to not consume jobs of each other. +* Sets `PrefetchCount` for all queues. * Also specifies a different connection string for the `EmailSendingArgs`. `JobQueueConfiguration` class has some additional options in its constructor; * `queueName`: The queue name that is used for this job. The prefix is not added, so you need to specify the full name of the queue. +* `DelayedQueueName`: The delayed queue name that is used for delayed execution of job. The prefix is not added, so you need to specify the full name of the queue. * `connectionName`: The RabbitMQ connection name (see the connection configuration above). This is optional and the default value is `Default`. * `durable` (optional, default: `true`). * `exclusive` (optional, default: `false`). -* `autoDelete` (optional, default: `false`) +* `autoDelete` (optional, default: `false`). +* `PrefetchCount` (optional, default: null) See the RabbitMQ documentation if you want to understand the `durable`, `exclusive` and `autoDelete` options better, while most of the times the default configuration is what you want. diff --git a/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/How-to-Design-Multi-Lingual-Entity.md b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/How-to-Design-Multi-Lingual-Entity.md new file mode 100644 index 0000000000..2c4b860c95 --- /dev/null +++ b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/How-to-Design-Multi-Lingual-Entity.md @@ -0,0 +1,690 @@ +# How to Design Multi-Lingual Entity + +## Introduction + +If you want to open up to the global market these days, end-to-end localization is a must. ABP provides an already established infrastructure for static texts. However, this may not be sufficient for many applications. You may need to fully customize your app for a particular language and region. + +Let's take a look at a few quotes from Christian Arno's article "[How Foreign-Language Internet Strategies Boost Sales](https://www.mediapost.com/publications/article/155250/how-foreign-language-internet-strategies-boost-sal.html)" to better understand the impact of this: + +- 82% of European consumers are less likely to buy online if the site is not in their native tongue ([Eurobarometer survey](http://europa.eu/rapid/pressReleasesAction.do?reference=IP/11/556)). +- 72.4% of global consumers are more likely to buy a product if the information is available in their own language ([Common Sense Advisory](http://www.commonsenseadvisory.com/)). +- The English language currently only accounts for 31% of all online use, and more than half of all searches are in languages other than English. +- Today, 42% of all Internet users are in Asia, while almost one-quarter are in Europe and just over 10% are in Latin America. + +- Foreign languages have experienced exponential growth in online usage in the past decade -- with Chinese now officially the [second-most-prominent-language](http://english.peopledaily.com.cn/90001/90776/90882/7438489.html) on the Web. [Arabic](http://www.internetworldstats.com/stats7.htm) has increased by a whopping 2500%, while English has only risen by 204% + +If you are looking for ways to expand your market share by fully customizing your application for a particular language and region, in this article I will explain how you can do it with ABP framework. + +### Source Code + +You can find the source code of the application at [abpframework/abp-samples](https://github.com/abpframework/abp-samples/tree/master/AcmeBookStoreMultiLingual). + +### Demo of the Final Application + +At the end of this article, we will have created an application same as in the gif below. + +![data-model](./result.gif) + +## Development + +In order to keep the article short and get rid of unrelated information in the article (like defining entities etc.), we'll be using the [BookStore](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore) example, which is used in the "[Web Application Development Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC&DB=EF)" documentation of ABP Framework and we will make the Book entity as multi-lingual. If you do not want to finish this tutorial, you can find the application [here](https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore). + +### Determining the data model + +We need a robust, maintainable, and efficient data model to store content in multiple languages. + +> I read many articles to determine the data model correctly, and as a result, I decided to use one of the many approaches that suit us. +> However, as in everything, there is a trade-off here. If you are wondering about the advantages and disadvantages of the model we will implement compared to other models, I recommend you to read [this article](https://vertabelo.com/blog/data-modeling-for-multiple-languages-how-to-design-a-localization-ready-system/). + +![data-model](./data-model.png) + +As a result of the tutorial, we already have the `Book` and `Author` entities, as an extra, we will just add the `BookTranslation`. + +> In the article, we will make the Name property of the Book entity multi-lingual, but the article is independent of the Book entity, you can make the entity you want multi-lingual with similar codes according to your requirements. + +#### Acme.BookStore.Domain.Shared + +Create a folder named `MultiLingualObjects` and create the following interfaces in its contents. + +We will use the `IObjectTranslation` interface to mark the translation of a multi-lingual entity: + +```csharp +public interface IObjectTranslation +{ + string Language { get; set; } +} +``` + +We will use the `IMultiLingualObject` interface to mark multi-lingual entities: + +```csharp +public interface IMultiLingualObject + where TTranslation : class, IObjectTranslation +{ + ICollection Translations { get; set; } +} +``` + +#### Acme.BookStore.Domain + +In the `Books` folder, create the `BookTranslation` class as follows: + +```csharp +public class BookTranslation : Entity, IObjectTranslation +{ + public Guid BookId { get; set; } + + public string Name { get; set; } + + public string Language { get; set; } + + public override object[] GetKeys() + { + return new object[] {BookId, Language}; + } +} +``` + +`BookTranslation` contains the `Language` property, which contains a language code for translation and a reference to the multi-lingual entity. We also have the `BookId` foreign key to help us know which book is translated. + +Implement `IMultiLingualObject` in the `Book` class as follows: + +```csharp +public class Book : AuditedAggregateRoot, IMultiLingualObject +{ + public Guid AuthorId { get; set; } + + public string Name { get; set; } + + public BookType Type { get; set; } + + public DateTime PublishDate { get; set; } + + public float Price { get; set; } + + public ICollection Translations { get; set; } +} +``` + +Create a folder named `MultiLingualObjects` and add the following class inside of this folder: + +```csharp +public class MultiLingualObjectManager : ITransientDependency +{ + protected const int MaxCultureFallbackDepth = 5; + + public async Task FindTranslationAsync( + TMultiLingual multiLingual, + string culture = null, + bool fallbackToParentCultures = true) + where TMultiLingual : IMultiLingualObject + where TTranslation : class, IObjectTranslation + { + culture ??= CultureInfo.CurrentUICulture.Name; + + if (multiLingual.Translations.IsNullOrEmpty()) + { + return null; + } + + var translation = multiLingual.Translations.FirstOrDefault(pt => pt.Language == culture); + if (translation != null) + { + return translation; + } + + if (fallbackToParentCultures) + { + translation = GetTranslationBasedOnCulturalRecursive( + CultureInfo.CurrentUICulture.Parent, + multiLingual.Translations, + 0 + ); + + if (translation != null) + { + return translation; + } + } + + return null; + } + + protected TTranslation GetTranslationBasedOnCulturalRecursive( + CultureInfo culture, ICollection translations, int currentDepth) + where TTranslation : class, IObjectTranslation + { + if (culture == null || + culture.Name.IsNullOrWhiteSpace() || + translations.IsNullOrEmpty() || + currentDepth > MaxCultureFallbackDepth) + { + return null; + } + + var translation = translations.FirstOrDefault(pt => pt.Language.Equals(culture.Name, StringComparison.OrdinalIgnoreCase)); + return translation ?? GetTranslationBasedOnCulturalRecursive(culture.Parent, translations, currentDepth + 1); + } +} +``` + +With `MultiLingualObjectManager`'s `FindTranslationAsync` method, we get the translated version of the book according to `CurrentUICulture`. If no translation of culture is found, we return null. + +> Every thread in .NET has `CurrentCulture` and `CurrentUICulture` objects. + +#### Acme.BookStore.EntityFrameworkCore + +In the `OnModelCreating` method of the `BookStoreDbContext` class, configure the `BookTranslation` as follows: + +```csharp +builder.Entity(b => +{ + b.ToTable(BookStoreConsts.DbTablePrefix + "BookTranslations", + BookStoreConsts.DbSchema); + + b.ConfigureByConvention(); + + b.HasKey(x => new {x.BookId, x.Language}); +}); +``` + +> I haven't explicitly set up a one-to-many relationship between `Book` and `BookTranslation` here, but the entity framework will do it for us. + +After that, you can just run the following command in a command-line terminal to add a new database migration (in the directory of the `EntityFrameworkCore` project): + +```bash +dotnet ef migrations add Added_BookTranslation +``` + +This will add a new migration class to your project. You can then run the following command (or run the `.DbMigrator` application) to apply changes to the database: + +```bash +dotnet ef database update +``` + +Add the following code to the `ConfigureServices` method of the `BookStoreEntityFrameworkCoreModule`: + +```csharp + Configure(options => + { + options.Entity(bookOptions => + { + bookOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Translations); + }); +}); +``` + +Now we can use `WithDetailsAsync` without any parameters on `BookAppService` knowing that `Translations` will be included. + +#### Acme.BookStore.Application.Contracts + +Implement `IObjectTranslation` in the `BookDto` class as follows: + +```csharp +public class BookDto : AuditedEntityDto, IObjectTranslation +{ + public Guid AuthorId { get; set; } + + public string AuthorName { get; set; } + + public string Name { get; set; } + + public BookType Type { get; set; } + + public DateTime PublishDate { get; set; } + + public float Price { get; set; } + + public string Language { get; set; } +} +``` + +`Language` property is required to understand which language the translated book name belongs to in the UI. + +Create the `AddBookTranslationDto` class in the `Books` folder as follows: + +```csharp +public class AddBookTranslationDto : IObjectTranslation +{ + [Required] + public string Language { get; set; } + + [Required] + public string Name { get; set; } +} +``` + +Add the `AddTranslationsAsync` method to the `IBookAppService` as follows: + +```csharp +public interface IBookAppService : + ICrudAppService< + BookDto, + Guid, + PagedAndSortedResultRequestDto, + CreateUpdateBookDto> +{ + Task> GetAuthorLookupAsync(); + + Task AddTranslationsAsync(Guid id, AddBookTranslationDto input); // added this line +} +``` + +#### Acme.BookStore.Application + +Now, we need to implement the `AddTranslationsAsync` method in `BookAppService` and include `Translations` in the `Book` entity, for this you can change the `BookAppService` as follows: + +```csharp +[Authorize(BookStorePermissions.Books.Default)] +public class BookAppService : + CrudAppService< + Book, //The Book entity + BookDto, //Used to show books + Guid, //Primary key of the book entity + PagedAndSortedResultRequestDto, //Used for paging/sorting + CreateUpdateBookDto>, //Used to create/update a book + IBookAppService //implement the IBookAppService +{ + private readonly IAuthorRepository _authorRepository; + + public BookAppService( + IRepository repository, + IAuthorRepository authorRepository) + : base(repository) + { + _authorRepository = authorRepository; + GetPolicyName = BookStorePermissions.Books.Default; + GetListPolicyName = BookStorePermissions.Books.Default; + CreatePolicyName = BookStorePermissions.Books.Create; + UpdatePolicyName = BookStorePermissions.Books.Edit; + DeletePolicyName = BookStorePermissions.Books.Create; + } + + public override async Task GetAsync(Guid id) + { + //Get the IQueryable from the repository + var queryable = await Repository.WithDetailsAsync(); // this line changed + + //Prepare a query to join books and authors + var query = from book in queryable + join author in await _authorRepository.GetQueryableAsync() on book.AuthorId equals author.Id + where book.Id == id + select new { book, author }; + + //Execute the query and get the book with author + var queryResult = await AsyncExecuter.FirstOrDefaultAsync(query); + if (queryResult == null) + { + throw new EntityNotFoundException(typeof(Book), id); + } + + var bookDto = ObjectMapper.Map(queryResult.book); + bookDto.AuthorName = queryResult.author.Name; + return bookDto; + } + + public override async Task> GetListAsync(PagedAndSortedResultRequestDto input) + { + //Get the IQueryable from the repository + var queryable = await Repository.WithDetailsAsync(); // this line changed + + //Prepare a query to join books and authors + var query = from book in queryable + join author in await _authorRepository.GetQueryableAsync() on book.AuthorId equals author.Id + select new {book, author}; + + //Paging + query = query + .OrderBy(NormalizeSorting(input.Sorting)) + .Skip(input.SkipCount) + .Take(input.MaxResultCount); + + //Execute the query and get a list + var queryResult = await AsyncExecuter.ToListAsync(query); + + //Convert the query result to a list of BookDto objects + var bookDtos = queryResult.Select(x => + { + var bookDto = ObjectMapper.Map(x.book); + bookDto.AuthorName = x.author.Name; + return bookDto; + }).ToList(); + + //Get the total count with another query + var totalCount = await Repository.GetCountAsync(); + + return new PagedResultDto( + totalCount, + bookDtos + ); + } + + public async Task> GetAuthorLookupAsync() + { + var authors = await _authorRepository.GetListAsync(); + + return new ListResultDto( + ObjectMapper.Map, List>(authors) + ); + } + + public async Task AddTranslationsAsync(Guid id, AddBookTranslationDto input) + { + var queryable = await Repository.WithDetailsAsync(); + + var book = await AsyncExecuter.FirstOrDefaultAsync(queryable, x => x.Id == id); + + if (book.Translations.Any(x => x.Language == input.Language)) + { + throw new UserFriendlyException($"Translation already available for {input.Language}"); + } + + book.Translations.Add(new BookTranslation + { + BookId = book.Id, + Name = input.Name, + Language = input.Language + }); + + await Repository.UpdateAsync(book); + } + + private static string NormalizeSorting(string sorting) + { + if (sorting.IsNullOrEmpty()) + { + return $"book.{nameof(Book.Name)}"; + } + + if (sorting.Contains("authorName", StringComparison.OrdinalIgnoreCase)) + { + return sorting.Replace( + "authorName", + "author.Name", + StringComparison.OrdinalIgnoreCase + ); + } + + return $"book.{sorting}"; + } +} +``` + +Create the `MultiLingualBookObjectMapper` class as follows: + +```csharp +public class MultiLingualBookObjectMapper : IObjectMapper, ITransientDependency +{ + private readonly MultiLingualObjectManager _multiLingualObjectManager; + + private readonly ISettingProvider _settingProvider; + + public MultiLingualBookObjectMapper( + MultiLingualObjectManager multiLingualObjectManager, + ISettingProvider settingProvider) + { + _multiLingualObjectManager = multiLingualObjectManager; + _settingProvider = settingProvider; + } + + public BookDto Map(Book source) + { + var translation = AsyncHelper.RunSync(() => + _multiLingualObjectManager.FindTranslationAsync(source)); + + return new BookDto + { + Id = source.Id, + AuthorId = source.AuthorId, + Type = source.Type, + Name = translation?.Name ?? source.Name, + PublishDate = source.PublishDate, + Price = source.Price, + Language = translation?.Language ?? AsyncHelper.RunSync(() => _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage)), + CreationTime = source.CreationTime, + CreatorId = source.CreatorId, + LastModificationTime = source.LastModificationTime, + LastModifierId = source.LastModifierId + }; + } + + public BookDto Map(Book source, BookDto destination) + { + return default; + } +} +``` + +To map the multi-lingual `Book` entity to `BookDto`, we implement custom mapping using the `IObjectMapper` interface. If no translation is found, default values are returned. + +So far we have created the entire infrastructure. We don't need to change anything in the UI, if there is a translation according to the language chosen by the user, the list view will change. However, I want to create a simple modal where we can add new translations to an existing book in order to see what we have done. + +#### Acme.BookStore.Web + +Create a new razor page named `AddTranslationModal` in the `Books` folder as below. + +**View** + +```html +@page +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@model Acme.BookStore.Web.Pages.Books.AddTranslationModal + +@{ + Layout = null; +} + +
+ + Translations + + + + + + + + + +
+``` + +**Model** + +```csharp +public class AddTranslationModal : BookStorePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + public List Languages { get; set; } + + [BindProperty] + public BookTranslationViewModel TranslationViewModel { get; set; } + + private readonly IBookAppService _bookAppService; + private readonly ILanguageProvider _languageProvider; + + public AddTranslationModal( + IBookAppService bookAppService, + ILanguageProvider languageProvider) + { + _bookAppService = bookAppService; + _languageProvider = languageProvider; + } + + public async Task OnGetAsync() + { + Languages = await GetLanguagesSelectItem(); + + TranslationViewModel = new BookTranslationViewModel(); + } + + public async Task OnPostAsync() + { + await _bookAppService.AddTranslationsAsync(Id, ObjectMapper.Map(TranslationViewModel)); + + return NoContent(); + } + + private async Task> GetLanguagesSelectItem() + { + var result = await _languageProvider.GetLanguagesAsync(); + + return result.Select( + languageInfo => new SelectListItem + { + Value = languageInfo.CultureName, + Text = languageInfo.DisplayName + " (" + languageInfo.CultureName + ")" + } + ).ToList(); + } + + public class BookTranslationViewModel + { + [Required] + [SelectItems(nameof(Languages))] + public string Language { get; set; } + + [Required] + public string Name { get; set; } + + } +} +``` + +Then, we can open the `BookStoreWebAutoMapperProfile` class and define the required mapping as follows: + +```csharp +CreateMap(); +``` + +Finally, change the content of `index.js` in the `Books` folder as follows: + +```javascript +$(function () { + var l = abp.localization.getResource('BookStore'); + var createModal = new abp.ModalManager(abp.appPath + 'Books/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'Books/EditModal'); + var addTranslationModal = new abp.ModalManager(abp.appPath + 'Books/AddTranslationModal'); // added this line + + var dataTable = $('#BooksTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + serverSide: true, + paging: true, + order: [[1, "asc"]], + searching: false, + scrollX: true, + ajax: abp.libs.datatables.createAjax(acme.bookStore.books.book.getList), + columnDefs: [ + { + title: l('Actions'), + rowAction: { + items: + [ + { + text: l('Edit'), + visible: abp.auth.isGranted('BookStore.Books.Edit'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Add Translation'), // added this action + visible: abp.auth.isGranted('BookStore.Books.Edit'), + action: function (data) { + addTranslationModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('BookStore.Books.Delete'), + confirmMessage: function (data) { + return l( + 'BookDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + acme.bookStore.books.book + .delete(data.record.id) + .then(function() { + abp.notify.info( + l('SuccessfullyDeleted') + ); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('Name'), + data: "name" + }, + { + title: l('Author'), + data: "authorName" + }, + { + title: l('Type'), + data: "type", + render: function (data) { + return l('Enum:BookType:' + data); + } + }, + { + title: l('PublishDate'), + data: "publishDate", + render: function (data) { + return luxon + .DateTime + .fromISO(data, { + locale: abp.localization.currentCulture.name + }).toLocaleString(); + } + }, + { + title: l('Price'), + data: "price" + }, + { + title: l('CreationTime'), + data: "creationTime", + render: function (data) { + return luxon + .DateTime + .fromISO(data, { + locale: abp.localization.currentCulture.name + }).toLocaleString(luxon.DateTime.DATETIME_SHORT); + } + } + ] + }) + ); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewBookButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); +``` + +## Conclusion + +With a multi-lingual application, you can expand your market share, but if not designed well, may your application will be unusable. So, I've tried to explain how to design a sustainable multi-lingual entity in this article. + +### Source Code + +You can find source code of the example solution used in this article [here](https://github.com/abpframework/abp-samples/tree/master/AcmeBookStoreMultiLingual). diff --git a/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/data-model.png b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/data-model.png new file mode 100644 index 0000000000..c7e02bc2cd Binary files /dev/null and b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/data-model.png differ diff --git a/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/result.gif b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/result.gif new file mode 100644 index 0000000000..0bc41cb8f1 Binary files /dev/null and b/docs/en/Community-Articles/15-08-2022-How-to-Design-Multi-Lingual-Entity/result.gif differ diff --git a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md index 308358bb67..8e46bd6944 100644 --- a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md +++ b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md @@ -1,9 +1,13 @@ # How to Add Custom Properties to the User Entity +> **Note:** If your application is greater than version 4.3.3, please follow [this article](../2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md). + ## Introduction In this step-by-step article, I will explain how you can customize the user entity class, which is available in every web application you create using the ABP framework, according to your needs. When you read this article, you will learn how to override the services of built-in modules, extend the entities, extend data transfer objects and customize the user interface in the applications you develop using the ABP framework. +> **Note:** This article is not about customizing the `Login` page. If you have such a need, please follow [this article](../2020-05-09-Customize-the-Login-Page-for-MVC-Razor-Page-Applications/POST.md). + You can see the screenshots below which we will reach at the end of the article. ![custom-identity-user-list](./custom-identity-user-list.png) diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md new file mode 100644 index 0000000000..7c119c6e66 --- /dev/null +++ b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md @@ -0,0 +1,154 @@ +# How to Add Custom Properties to the User Entity + +> **Note:** If your application is less than version 4.4.x, please follow [this article](../2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md). + +## Introduction + +In this step-by-step article, I will explain how you can customize the user entity class, which is available in every web application you create using the ABP framework, according to your needs. When you read this article, you will learn how to override the services of built-in modules, extend the entities, extend data transfer objects and customize the user interface in the applications you develop using the ABP framework. + +> **Note:** This article is not about customizing the `Login` page. If you have such a need, please follow [this article](../2020-05-09-Customize-the-Login-Page-for-MVC-Razor-Page-Applications/POST.md). + +You can see the screenshots below which we will reach at the end of the article. + +![custom-identity-user-list](./custom-identity-user-list.png) + +![new-user](./new-user.png) + +## Preparing the Project + +### Startup template and the initial run + +Abp Framework offers startup templates to get into the work faster. We can create a new startup template using Abp CLI: + +`abp new CustomizeUserDemo` + +> In this article, I will go through the MVC application, but it will work also in the [Angular](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No), [Blazor Server](https://docs.abp.io/en/abp/latest/Getting-Started?UI=BlazorServer&DB=EF&Tiered=No), and [Blazor WebAssembly](https://docs.abp.io/en/abp/latest/Getting-Started?UI=Blazor&DB=EF&Tiered=No) application. + +After the download is finished, we can run **CustomizeUserDemo.DbMigrator** project to create the database migrations and seed the initial data (admin user, role, etc). Then we can run `CustomizeUserDemo.Web` to see that our application is working. + +> Default admin username is **admin** and password is **1q2w3E\*** + +![initial-project](./initial-project.png) + +In this article, we will go through a scenario together and find the solutions to our questions through this scenario. However, since the scenario is not a real-life scenario, it may be strange, please don't get too about this issue :) + +## Step-1 + +Create the Users folder in the **CustomizeUserDemo.Domain.Shared** project, create the class `UserConsts` inside the folder and update the class you created as below: + +```csharp +public static class UserConsts +{ + public const string TitlePropertyName = "Title"; + + public const string ReputationPropertyName = "Reputation"; + + public const int MaxTitleLength = 64; + + public const double MaxReputationValue = 1_000; + + public const double MinReputationValue = 1; +} +``` + +## Step-2 + +Update the `CustomizeUserDemoEfCoreEntityExtensionMappings` class in the **CustomizeUserDemo.EntityFramework** project in the EntityFrameworkCore folder as below: + +```csharp +public static class CustomizeUserDemoEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + CustomizeUserDemoGlobalFeatureConfigurator.Configure(); + CustomizeUserDemoModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + ObjectExtensionManager.Instance + .MapEfCoreProperty( + UserConsts.TitlePropertyName, + (_, propertyBuilder) => + { + propertyBuilder.HasDefaultValue(""); + propertyBuilder.HasMaxLength(UserConsts.MaxTitleLength); + } + ).MapEfCoreProperty( + UserConsts.ReputationPropertyName, + (_, propertyBuilder) => + { + propertyBuilder.HasDefaultValue(UserConsts.MinReputationValue); + } + ); + }); + } +} +``` + +This class can be used to map these extra properties to table fields in the database. Please read [this](https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities) article to improve your understanding of what we are doing. + +So far, we have added our extra features to the `User` entity and matched these features with the `ef core`. + +Now we need to add migration to see what has changed in our database. This for, open the Package Manager Console (PMC) under the menu Tools > NuGet Package Manager. + +![nuget-package-manager](./nuget-package-manager.png) + +Select the **CustomizeUserDemo.EntityFramework** as the **default project** and execute the following command: + +```bash +Add-Migration "Updated-User-Entity" +``` + +![added-new-migration](./added-new-migration.png) + +This will create a new migration class inside the `Migrations` folder of the **CustomizeUserDemo.EntityFrameworkCore** project. + +> If you are using another IDE than the Visual Studio, you can use `dotnet-ef` tool as [documented here](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli#create-a-migration). + +Finally, run the **CustomizeUserDemo.DbMigrator** project to update the database. + +When we updated the database, you can see that the `Title` and `Reputation` columns are added to the `Users` table. + +![user-table](./user-table.png) + +## Step-3 +Open the `CustomizeUserDemoModuleExtensionConfigurator` in the **CustomizeUserDemo.Domain.Shared** project, and change the contents of the `ConfigureExtraProperties` method as shown below: +```csharp +private static void ConfigureExtraProperties() +{ + ObjectExtensionManager.Instance.Modules().ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( + UserConsts.TitlePropertyName, + options => + { + options.Attributes.Add(new RequiredAttribute()); + options.Attributes.Add( + new StringLengthAttribute(UserConsts.MaxTitleLength) + ); + } + ); + user.AddOrUpdateProperty( + UserConsts.ReputationPropertyName, + options => + { + options.DefaultValue = UserConsts.MinReputationValue; + options.Attributes.Add( + new RangeAttribute(UserConsts.MinReputationValue, UserConsts.MaxReputationValue) + ); + } + ); + }); + }); +} +``` + +That's it. Now let's run the application and look at the Identity user page. You can also try to edit and recreate a record if you want, it will work even though we haven't done anything extra. Here is the magic code behind ABP framework. + +If there is a situation you want to add, you can click the contribute button or make a comment. Also, if you like the article, don't forget to share it :) + +Happy coding :) diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png new file mode 100755 index 0000000000..d459fdeed2 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/added-new-migration.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png new file mode 100644 index 0000000000..896ed947aa Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/custom-identity-user-list.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png new file mode 100755 index 0000000000..b64e93a99f Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/initial-project.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png new file mode 100644 index 0000000000..d3a5c66198 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/new-user.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png new file mode 100755 index 0000000000..680bc9d2e7 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/nuget-package-manager.png differ diff --git a/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png new file mode 100755 index 0000000000..5bb71b8325 Binary files /dev/null and b/docs/en/Community-Articles/2022-07-19-How-To-Add-Custom-Property-To-The-User-Entity/user-table.png differ diff --git a/docs/en/Dapr/Index.md b/docs/en/Dapr/Index.md new file mode 100644 index 0000000000..4cdf28c7f9 --- /dev/null +++ b/docs/en/Dapr/Index.md @@ -0,0 +1,469 @@ +# ABP Dapr Integration + +> This document assumes that you are already familiar with [Dapr](https://dapr.io/) and you want to use it in your ABP based applications. + +[Dapr](https://dapr.io/) (Distributed Application Runtime) provides APIs that simplify microservice connectivity. It is an open source project that is mainly backed by Microsoft. It is also a CNCF (Cloud Native Computing Foundation) project and trusted by community. + +ABP and Dapr has some intersecting features like service-to-service communication, distributed message bus and distributed locking. However their purposes are totally different. ABP's goal is to provide an end-to-end developer experience by offering an opinionated architecture and providing the necessary infrastructure libraries, reusable modules and tools to implement that architecture properly. Dapr's purpose, on the other hand, is to provide a runtime to decouple common microservice communication patterns from your application logic. + +ABP and Dapr can perfectly work together in the same application. ABP offers some packages to provide better integration where Dapr features intersect with ABP. You can use other Dapr features with no ABP integration packages based on [its own documentation](https://docs.dapr.io/). + +## ABP Dapr Integration Packages + +ABP provides the following NuGet packages for the Dapr integration: + +* [Volo.Abp.Dapr](https://www.nuget.org/packages/Volo.Abp.Dapr): The main Dapr integration package. All other packages depend on this package. +* [Volo.Abp.Http.Client.Dapr](https://www.nuget.org/packages/Volo.Abp.Http.Client.Dapr): Integration package for ABP's [dynamic](../API/Dynamic-CSharp-API-Clients.md) and [static](../API/Static-CSharp-API-Clients.md) C# API Client Proxies systems with Dapr's [service invocation](https://docs.dapr.io/developing-applications/building-blocks/service-invocation/service-invocation-overview/) building block. +* [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr): Implements ABP's distributed event bus with Dapr's [publish & subscribe](https://docs.dapr.io/developing-applications/building-blocks/pubsub/) building block. With this package, you can send events, but can not receive. +* [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus): Provides the endpoints to receive events from Dapr's [publish & subscribe](https://docs.dapr.io/developing-applications/building-blocks/pubsub/) building block. Use this package to send and receive events. +* [Volo.Abp.DistributedLocking.Dapr](https://www.nuget.org/packages/Volo.Abp.DistributedLocking.Dapr): Uses Dapr's [distributed lock](https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/) building block for [distributed locking](Distributed-Locking.md) service of the ABP Framework. + +In the following sections, we will see how to use these packages to use Dapr in your ABP based solutions. + +## Basics + +### Installation + +> This section explains how to add [Volo.Abp.Dapr](https://www.nuget.org/packages/Volo.Abp.Dapr), the core Dapr integration package to your project. If you are using one of the other Dapr integration packages, you can skip this section since this package will be indirectly added. + +Use the ABP CLI to add [Volo.Abp.Dapr](https://www.nuget.org/packages/Volo.Abp.Dapr) NuGet package to your project: + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.Dapr` package. +* Run `abp add-package Volo.Abp.Dapr` command. + +If you want to do it manually, install the [Volo.Abp.Dapr](https://www.nuget.org/packages/Volo.Abp.Dapr) NuGet package to your project and add `[DependsOn(typeof(AbpDaprModule))]` to the [ABP module](Module-Development-Basics.md) class inside your project. + +### AbpDaprOptions + +`AbpDaprOptions` is the main [options class](../Options.md) that you can configure the global Dapr settings. **All settings are optional and you mostly don't need to configure them.** If you need, you can configure it in the `ConfigureServices` method of your [module class](../Module-Development-Basics.md): + +````csharp +Configure(options => +{ + // ... +}); +```` + +Available properties of the `AbpDaprOptions` class: + +* `HttpEndpoint` (optional): HTTP endpoint that is used while creating a `DaprClient` object. If you don't specify, the default value is used. +* `GrpcEndpoint` (optional): The gRPC endpoint that is used while creating a `DaprClient` object. If you don't specify, the default value is used. +* `DaprApiToken` (optional): The [Dapr API token](https://docs.dapr.io/operations/security/api-token/) that is used while sending requests from the application to Dapr. It is filled from the `DAPR_API_TOKEN` environment variable by default (which is set by Dapr once it is configured). See the *Security* section in this document for details. +* `AppApiToken` (optional): The [App API token](https://docs.dapr.io/operations/security/app-api-token/) that is used to validate requests coming from Dapr. It is filled from the `APP_API_TOKEN` environment variable by default (which is set by Dapr once it is configured). See the *Security* section in this document for details. + +Alternatively, you can configure the options in the `Dapr` section of your `appsettings.json` file. Example: + +````csharp +"Dapr": { + "HttpEndpoint": "http://localhost:3500/" +} +```` + +### Injecting DaprClient + +ABP registers the `DaprClient` class to the [dependency injection](../Dependency-Injection.md) system. So, you can inject and use it whenever you need: + +````csharp +public class MyService : ITransientDependency +{ + private readonly DaprClient _daprClient; + + public MyService(DaprClient daprClient) + { + _daprClient = daprClient; + } + + public async Task DoItAsync() + { + // TODO: Use the injected _daprClient object + } +} +```` + +Injecting `DaprClient` is the recommended way of using it in your application code. When you inject it, the `IAbpDaprClientFactory` service is used to create it, which is explained in the next section. + +### IAbpDaprClientFactory + +`IAbpDaprClientFactory` can be used to create `DaprClient` or `HttpClient` objects to perform operations on Dapr. It uses `AbpDaprOptions`, so you can configure the settings in a central place. + +**Example usages:** + +````csharp +public class MyService : ITransientDependency +{ + private readonly IAbpDaprClientFactory _daprClientFactory; + + public MyService(IAbpDaprClientFactory daprClientFactory) + { + _daprClientFactory = daprClientFactory; + } + + public async Task DoItAsync() + { + // Create a DaprClient object with default options + DaprClient daprClient = await _daprClientFactory.CreateAsync(); + + /* Create a DaprClient object with configuring + * the DaprClientBuilder object */ + DaprClient daprClient2 = await _daprClientFactory + .CreateAsync(builder => + { + builder.UseDaprApiToken("..."); + }); + + // Create an HttpClient object + HttpClient httpClient = await _daprClientFactory + .CreateHttpClientAsync("target-app-id"); + } +} +```` + +`CreateHttpClientAsync` method also gets optional `daprEndpoint` and `daprApiToken` parameters. + +> ABP uses `IAbpDaprClientFactory` when it needs to create a Dapr client. You can also use Dapr API to create client objects in your application. Using `IAbpDaprClientFactory` is recommended, but not required. + +## C# API Client Proxies Integration + +ABP can [dynamically](../API/Dynamic-CSharp-API-Clients.md) or [statically](../API/Static-CSharp-API-Clients.md) generate proxy classes to invoke your HTTP APIs from a Dotnet client application. It makes dead simple to consume HTTP APIs in a distributed system. [Volo.Abp.Http.Client.Dapr](https://www.nuget.org/packages/Volo.Abp.Http.Client.Dapr) package configures the client-side proxies system, so it uses Dapr's service invocation building block for the communication between your applications. + +### Installation + +Use the ABP CLI to add [Volo.Abp.Http.Client.Dapr](https://www.nuget.org/packages/Volo.Abp.Http.Client.Dapr) NuGet package to your project (to the client side): + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.Http.Client.Dapr` package. +* Run `abp add-package Volo.Abp.Http.Client.Dapr` command. + +If you want to do it manually, install the [Volo.Abp.Http.Client.Dapr](https://www.nuget.org/packages/Volo.Abp.Http.Client.Dapr) NuGet package to your project and add `[DependsOn(typeof(AbpHttpClientDaprModule))]` to the [ABP module](Module-Development-Basics.md) class inside your project. + +### Configuration + +One you install the [Volo.Abp.Http.Client.Dapr](https://www.nuget.org/packages/Volo.Abp.Http.Client.Dapr) NuGet package, all you need to do it to configure ABP's remote services option either in `appsettings.json` or using the `AbpRemoteServiceOptions` [options class](../Options.md). + +**Example:** + +````csharp +{ + "RemoteServices": { + "Default": { + "BaseUrl": "http://dapr-httpapi/" + } + } +} +```` + +`dapr-httpapi` in this example is the application id of the server application in your Dapr configuration. + +The remove service name (`Default` in this example) should match the remote service name specified in the `AddHttpClientProxies` call for dynamic client proxies or `AddStaticHttpClientProxies` call for static client proxies. Using `Default` is fine if your client communicates to a single server. However, if your client uses multiple servers, you typically have multiple keys in the `RemoteServices` configuration. Once you configure the remote service endpoints as Dapr application ids, it will automatically work and make the HTTP calls through Dapr when you use ABP's client proxy system. + +> See the [dynamic](../API/Dynamic-CSharp-API-Clients.md) and [static](../API/Static-CSharp-API-Clients.md) client proxy documents for details about the ABP's client proxy system. + +## Distributed Event Bus Integration + +[ABP's distributed event bus](../Distributed-Event-Bus.md) system provides a convenient abstraction to allow applications communicate asynchronously via events. ABP has integration packages with various distributed messaging systems, like RabbitMQ, Kafka, and Azure. Dapr also has a [publish & subscribe building block](https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-overview/) for the same purpose: distributed messaging / events. + +ABP's [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr) and [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus) packages make possible to use the Dapr infrastructure for ABP's distributed event bus. + +The [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr) package can be used by any type of application (e.g., a Console or ASP.NET Core application) to publish events through Dapr. To be able to receive messages (by subscribing events), you need to have the [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus) package installed, and your application should be an ASP.NET Core application. + +### Installation + +If your application is an ASP.NET Core application and you want to send and receive events, you need to install the [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus) package as describe below: + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.AspNetCore.Mvc.Dapr.EventBus` package. +* Run `abp add-package Volo.Abp.AspNetCore.Mvc.Dapr.EventBus` command. + +If you want to do it manually, install the [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus) NuGet package to your project and add `[DependsOn(typeof(AbpAspNetCoreMvcDaprEventBusModule))]` to the [ABP module](Module-Development-Basics.md) class inside your project. + +> **If you install the [Volo.Abp.AspNetCore.Mvc.Dapr.EventBus](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus) package, you don't need to install the [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr) package, because the first one already has a reference to the latter one.** + +If your application is not an ASP.NET Core application, you can't receive events from Dapr, at least with ABP's integration packages (see [Dapr's document](https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-publish-subscribe/) if you want to receive events in a different type of application). However, you can still publish messages using the [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr) package. In this case, follow the steps below to install that package to your project: + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.EventBus.Dapr` package. +* Run `abp add-package Volo.Abp.EventBus.Dapr` command. + +If you want to do it manually, install the [Volo.Abp.EventBus.Dapr](https://www.nuget.org/packages/Volo.Abp.EventBus.Dapr) NuGet package to your project and add `[DependsOn(typeof(AbpEventBusDaprModule))]` to the [ABP module](Module-Development-Basics.md) class inside your project. + +### Configuration + +You can configure the `AbpDaprEventBusOptions` [options class](../Options.md) for Dapr configuration: + +````csharp +Configure(options => +{ + options.PubSubName = "pubsub"; +}); +```` + +Available properties of the `AbpDaprEventBusOptions` class: + +* `PubSubName` (optional): The `pubsubName` parameter while publishing messages through `DaprClient.PublishEventAsync` method. Default value: `pubsub`. + +### The ABP Subscription Endpoints + +ABP provides the following endpoints to receive events from Dapr: + +* `dapr/subscribe`: Dapr uses this endpoint to get a list of subscriptions from the application. ABP automatically returns all the subscriptions for your distributed event handler classes and custom controller actions with the `Topic` attribute. +* `api/abp/dapr/event`: The unified endpoint to receive all the events from Dapr. ABP dispatches the events to your event handlers based on the topic name. + +> **Since ABP provides the standard `dapr/subscribe` endpoint, you should not manually call the `app.MapSubscribeHandler()` method of Dapr.** You can use the `app.UseCloudEvents()` middleware in your ASP.NET Core pipeline if you want to support the [CloudEvents](https://cloudevents.io/) standard. + +### Usage + +#### The ABP Way + +You can follow [ABP's distributed event bus documentation](../Distributed-Event-Bus.md) to learn how to publish and subscribe to events in the ABP way. No change required in your application code to use Dapr pub-sub. ABP will automatically subscribe to Dapr for your event handler classes (those implement the `IDistributedEventHandler` interface). + +ABP provides `api/abp/dapr/event` + +**Example: Publish an event using the `IDistributedEventBus` service** + +````csharp +public class MyService : ITransientDependency +{ + private readonly IDistributedEventBus _distributedEventBus; + + public MyService(IDistributedEventBus distributedEventBus) + { + _distributedEventBus = distributedEventBus; + } + + public async Task DoItAsync() + { + await _distributedEventBus.PublishAsync(new StockCountChangedEto + { + ProductCode = "AT837234", + NewStockCount = 42 + }); + } +} +```` + +**Example: Subscribe to an event by implementing the `IDistributedEventHandler` interface** + +````csharp +public class MyHandler : + IDistributedEventHandler, + ITransientDependency +{ + public async Task HandleEventAsync(StockCountChangedEto eventData) + { + var productCode = eventData.ProductCode; + // ... + } +} +```` + +See [ABP's distributed event bus documentation](../Distributed-Event-Bus.md) to learn the details. + +#### Using the Dapr API + +In addition to ABP's standard distributed event bus system, you can also use Dapr's API to publish events. + +> If you directly use the Dapr API to publish events, you may not benefit from ABP's standard distributed event bus features, like the outbox/inbox pattern implementation. + +**Example: Publish an event using `DaprClient`** + +````csharp +public class MyService : ITransientDependency +{ + private readonly DaprClient _daprClient; + + public MyService(DaprClient daprClient) + { + _daprClient = daprClient; + } + + public async Task DoItAsync() + { + await _daprClient.PublishEventAsync( + "pubsub", // pubsub name + "StockChanged", // topic name + new StockCountChangedEto // event data + { + ProductCode = "AT837234", + NewStockCount = 42 + } + ); + } +} +```` + +**Example: Subscribe to an event by creating an ASP.NET Core controller** + +````csharp +public class MyController : AbpController +{ + [HttpPost("/stock-changed")] + [Topic("pubsub", "StockChanged")] + public async Task TestRouteAsync( + [FromBody] StockCountChangedEto model) + { + HttpContext.ValidateDaprAppApiToken(); + + // Do something with the event + return Ok(); + } +} +```` + +`HttpContext.ValidateDaprAppApiToken()` extension method is provided by ABP to check if the request is coming from Dapr. This is optional. You should configure Dapr to send App API token to your application if you want to enable the validation. If not configured, `ValidateDaprAppApiToken()` does nothing. See [Dapr's App API Token document](https://docs.dapr.io/operations/security/app-api-token/) for more information. Also see the *AbpDaprOptions* and *Security* sections in this document. + +See the [Dapr documentation](https://docs.microsoft.com/en-us/dotnet/architecture/dapr-for-net-developers/publish-subscribe) to learn the details of sending & receiving events with Dapr API. + +## Distributed Lock + +> Dapr's distributed lock feature currently in Alpha stage and may not be stable yet. It is not suggested to replace ABP's distributed lock with Dapr in that point. + +ABP provides a [Distributed Locking](../Distributed-Locking.md) abstraction to control access to a shared resource by multiple applications. Dapr also has a [distributed lock building block](https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/). [Volo.Abp.DistributedLocking.Dapr](https://www.nuget.org/packages/Volo.Abp.DistributedLocking.Dapr) package makes ABP using Dapr's distributed locking system. + +### Installation + +Use the ABP CLI to add [Volo.Abp.DistributedLocking.Dapr](https://www.nuget.org/packages/Volo.Abp.DistributedLocking.Dapr) NuGet package to your project (to the client side): + +* Install the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) if you haven't installed before. +* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.DistributedLocking.Dapr` package. +* Run `abp add-package Volo.Abp.DistributedLocking.Dapr` command. + +If you want to do it manually, install the [Volo.Abp.DistributedLocking.Dapr](https://www.nuget.org/packages/Volo.Abp.DistributedLocking.Dapr) NuGet package to your project and add `[DependsOn(typeof(AbpDistributedLockingDaprModule))]` to the [ABP module](../Module-Development-Basics.md) class inside your project. + +### Configuration + +You can use the `AbpDistributedLockDaprOptions` options class in the `ConfigureServices` method of [your module](../Module-Development-Basics.md) to configure the Dapr distributed lock: + +````csharp +Configure(options => +{ + options.StoreName = "mystore"; +}); +```` + +The following options are available: + +* **`StoreName`** (required): The store name used by Dapr. Lock key names are scoped in the same store. That means different applications can acquire the same lock name in different stores. Use the same store name for the same resources you want to control access. +* `Owner` (optional): The `owner` value used by `DaprClient.Lock` method. If you don't specify, ABP uses a random value, which is fine in general. +* `DefaultExpirationTimeout` (optional): Default value of the time after which the lock gets expired. Default value: 2 minutes. + +### Usage + +You can inject and use the `IAbpDistributedLock` service, just like explained in the [Distributed Locking document](../Distributed-Locking.md). + +**Example:** + +````csharp +public class MyService : ITransientDependency +{ + private readonly IAbpDistributedLock _distributedLock; + + public MyService(IAbpDistributedLock distributedLock) + { + _distributedLock = distributedLock; + } + + public async Task MyMethodAsync() + { + await using (var handle = + await _distributedLock.TryAcquireAsync("MyLockName")) + { + if (handle != null) + { + // your code that access the shared resource + } + } + } +} +```` + +There are two points we should mention about the `TryAcquireAsync` method, as different from the ABP's standard usage: + +* `timeout` parameter currently not used (even if you specify it), because Dapr doesn't support to wait to obtain the lock. +* Dapr uses expiration timeout system (that means the lock is automatically released after that timeout even if you don't release the lock by disposing the handler). However, ABP's `TryAcquireAsync` method has no such a parameter. Currently, you can set `AbpDistributedLockDaprOptions.DefaultExpirationTimeout` as a global value in your application. + +As mentioned first, Dapr's distributed lock feature currently in Alpha stage and its API is candidate to change. You should use it as is if you want, but be ready for the changes in the future. For now, we are recommending to use the [DistributedLock](https://github.com/madelson/DistributedLock) library as explained in ABP's [Distributed Locking document](../Distributed-Locking.md). + +## Security + +If you are using Dapr, most or all the incoming and outgoing requests in your application pass through Dapr. Dapr uses two kinds of API tokens to secure the communication between your application and Dapr. + +### Dapr API Token + +> This token is automatically set by default and generally you don't care about it. + +The [Enable API token authentication in Dapr](https://docs.dapr.io/operations/security/api-token/) document describes what the Dapr API token is and how it is configured. Please read that document if you want to enable it for your application. + +If you enabled the Dapr API token, you should send that token in every request to Dapr from your application. `AbpDaprOptions` defines a `DaprApiToken` property as a central point to configure the Dapr API token in your application. + +The default value of the `DaprApiToken` property is set from the `DAPR_API_TOKEN` environment variable and that environment variable is set by Dapr when it runs. So, most of the times, you don't need to configure `AbpDaprOptions.DaprApiToken` in your application. However, if you need to configure (or override) it, you can do in the `ConfigureServices` method of your module class as shown in the following code block: + +````csharp +Configure(options => +{ + options.DaprApiToken = "..."; +}); +```` + +Or you can set it in your `appsettings.json` file: + +````json +"Dapr": { + "DaprApiToken": "..." +} +```` + +Once you set it, it is used when you inject `DaprClient` or use `IAbpDaprClientFactory`. If you need that value in your application, you can inject `IDaprApiTokenProvider` and use its `GetDaprApiToken()` method. + +### App API Token + +> Enabling App API token validation is strongly recommended. Otherwise, for example, any client can directly call your event subscription endpoint, and your application acts like an event has occurred (if there is no other security policy in your event subscription endpoint). + +The [Authenticate requests from Dapr using token authentication](https://docs.dapr.io/operations/security/app-api-token/) document describes what the App API token is and how it is configured. Please read that document if you want to enable it for your application. + +If you enabled the App API token, you can validate it to ensure that the request is coming from Dapr. ABP provides useful shortcuts to validate it. + +**Example: Validate the App API token in an event handling HTTP API** + +````csharp +public class MyController : AbpController +{ + [HttpPost("/stock-changed")] + [Topic("pubsub", "StockChanged")] + public async Task TestRouteAsync( + [FromBody] StockCountChangedEto model) + { + // Validate the App API token! + HttpContext.ValidateDaprAppApiToken(); + + // Do something with the event + return Ok(); + } +} +```` + +`HttpContext.ValidateDaprAppApiToken()` is an extension method provided by the ABP Framework. It throws an `AbpAuthorizationException` if the token was missing or wrong in the HTTP header (the header name is `dapr-api-token`). You can also inject `IDaprAppApiTokenValidator` and use its methods to validate the token in any service (not only in a controller class). + +You can configure `AbpDaprOptions.AppApiToken` if you want to set (or override) the App API token value. The default value is set by the `APP_API_TOKEN` environment variable. You can change it in the `ConfigureServices` method of your module class as shown in the following code block: + +````csharp +Configure(options => +{ + options.AppApiToken = "..."; +}); +```` + +Or you can set it in your `appsettings.json` file: + +````json +"Dapr": { + "AppApiToken": "..." +} +```` + +If you need that value in your application, you can inject `IDaprApiTokenProvider` and use its `GetAppApiToken()` method. + +## See Also + +* [Dapr for .NET Developers](https://docs.microsoft.com/en-us/dotnet/architecture/dapr-for-net-developers/) +* [The Official Dapr Documentation](https://docs.dapr.io/) \ No newline at end of file diff --git a/docs/en/Dependency-Injection.md b/docs/en/Dependency-Injection.md index 668eac6644..a0ad342c4c 100644 --- a/docs/en/Dependency-Injection.md +++ b/docs/en/Dependency-Injection.md @@ -244,25 +244,35 @@ One restriction of property injection is that you cannot use the dependency in y Property injection is also useful when you want to design a base class that has some common services injected by default. If you're going to use constructor injection, all derived classes should also inject depended services into their own constructors which makes development harder. However, be very careful using property injection for non-optional services as it makes it harder to clearly see the requirements of a class. -### Resolve Service from IServiceProvider +#### DisablePropertyInjectionAttribute -You may want to resolve a service directly from ``IServiceProvider``. In that case, you can inject IServiceProvider into your class and use ``GetService`` method as shown below: +You can use `[DisablePropertyInjection]` attribute on class or properties to disable property injection for the whole class or some specific properties. ````C# +[DisablePropertyInjection] public class MyService : ITransientDependency { - private readonly IServiceProvider _serviceProvider; + public ITaxCalculator TaxCalculator { get; set; } +} - public MyService(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } +public class MyService : ITransientDependency +{ + public ILogger Logger { get; set; } - public void DoSomething() - { - var taxCalculator = _serviceProvider.GetService(); - //... - } + [DisablePropertyInjection] + public ITaxCalculator TaxCalculator { get; set; } +} + +```` + +### Resolve Service from IServiceProvider + +You may want to resolve a service directly from ``IServiceProvider``. In that case, you can inject IServiceProvider into your class and use ``GetService`` method as shown below: + +````C# +public class MyService : ITransientDependency +{ + public ILogger Logger { get; set; } } ```` diff --git a/docs/en/Deploy-azure-app-service.md b/docs/en/Deploy-azure-app-service.md new file mode 100644 index 0000000000..9e0309f3b9 --- /dev/null +++ b/docs/en/Deploy-azure-app-service.md @@ -0,0 +1,452 @@ +# Deploying ABP Project to Azure App Service + +In this document, you will learn how to create and deploy your first ABP web app to [Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/overview). The App Service supports various versions of .NET apps, and provides a highly scalable, self-patching web hosting service. ABP web apps are cross-platform and can be hosted on Linux, Windows or MacOS. + +****Prerequisites**** + +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/dotnet). +- A GitHub account [Create an account for free](http://github.com/). + + + +## Creating a new ABP application + +Create a repository on [GitHub.com](https://github.com/) (keep all settings as default). + +Open the command prompt and clone the repository into a folder on your computer + +```bash +git clone https://github.com/your-username/your-repository-name.git +``` + +Check your dotnet version. It should be at least 3.1.x + +```bash +dotnet --version +``` + +Install or update the [ABP CLI](https://docs.abp.io/en/abp/latest/cli) with the following command: + +```bash +dotnet tool install -g Volo.Abp.Cli || dotnet tool update -g Volo.Abp.Cli +``` + +Open the command prompt in the *GitHub repository folder* and create a new ABP Blazor solution with the command below: + +```bash +abp new YourAppName -u blazor +``` + + + +## Running the application + +Open the command prompt in the *[YourAppName].DbMigrator* project and enter the command below to apply the database migrations: + +```bash +dotnet run +``` + +Open the command prompt in the *[YourAppName].HttpApi.Host* project to run the API project: + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in *the launchSettings.json* file of the *[YourAppName].HttpApi.Host project*. You should get the *Swagger window* + +Open the command prompt in the *[YourAppName].Blazor* folder and enter the command below to run the Blazor project: + +```bash +dotnet run +``` + +Navigate to the *applicationUrl* specified in the *launchSettings.json* file of the *[YourAppName].Blazor* project and you should see the landing page. + +Stop both the *API* and the *Blazor* project by pressing **CTRL+C** + + + +## Committing to GitHub + +Before the GitHub commit, you have to delete the line "**/wwwroot/libs/*" at *.gitignore* file. + +![azdevops-23](images/azdevops-23.png) + +Open the command prompt in the root folder of your project and *add, commit and push* all your changes to your GitHub repository: + +```bash +git add . +git commit -m initialcommit +git push +``` + + + +## Configuring Azure database connection string + +Create a SQL database on Azure and change the connection string in all the *appsettings.json* files. + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *SQL Database* + +* Click the **Create** button in the *SQL Database window* + +* Create a new resource group. Name it *rg[YourAppName]* + +* Enter *[YourAppName]Db* as database name + +* Create a new Server and name it *[yourappname]server* + +* Enter a serveradmin login and passwords. Click the **OK** button + +* Select your *Location* + +* Check *Allow Azure services to access server* + +* Click **Configure database**. Go to the *Basic* version and click the **Apply** button + +* Click the **Review + create** button. Click **Create** + +* Click **Go to resource** and click **SQL server** when the SQL Database is created + +* Click **Networking** under Security left side menu + +* Select **Selected networks** and click **Add your client IP$ address** at the Firewall rules + +* Select **Allow Azure and resources to access this seerver** and save + +* Go to your **SQL database**, click **Connection strings** and copy the connection string + +* Copy/paste the *appsettings.json* files of the *[YourAppName].HttpApi.Host* and the *[YourAppName].DbMigrator* project + +* Do not forget to replace {your_password} with the correct server password you entered in Azure SQL Database + + + +## Running DB Migrations + +Open the command prompt in the *[YourAppName].DbMigrator* project again and enter the command below to apply the database migrations: + +```bash +dotnet run +``` + +Open the command prompt in the *[YourAppName].HttpApi.Host* project and enter the command below to check your API is working: + +```bash +dotnet run +``` + +Stop the *[YourAppName].HttpApi.Host* by pressing CTRL+C. + + + +## Committing to GitHub + +Open the command prompt in the root folder of your project and add, commit and push all your changes to your GitHub repository + +```bash +git add . +git commit -m initialcommit +git push +``` + + + +## Setting up the Build pipeline in AzureDevops and publish the Build Artifacts + +* Sign in Azure DevOps + +* Click **New organization** and follow the steps to create a new organisation. Name it [YourAppName]org + +* Enter [YourAppName]Proj as project name in the ***Create a project to get started*** window + +* Select **Public visibility** and click the **Create project** button + +* Click the **Pipelines** button to continue + +* Click the **Create Pipeline** button + + Select GitHub in the Select your repository window + +![azdevops-1](images/azdevops-1.png) + +* Enter the Connection name. *[YourAppName]GitHubConnection* and click **Authorize using OAuth** + +* Select your **GitHub** [YourAppName]repo and click Continue + +* Search for **ASP.NET** in the ***Select a template*** window + +![azdevops-2](images/azdevops-2.png) + +* Select the ASP.NET Core template and click the **Apply** button + +* Add the below commands block as a first step in the pipeline + + ``` + - task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + ``` + +![azdevops-18](images/azdevops-18.png) + +* Select **Settings** on the second task(Nugetcommand@2) in the pipeline + +* Select **Feeds in my Nuget.config** and type **Nuget.config** in the text box + +![azdevops-3](images/azdevops-3.png) + +* Add the below commands block to the end of the pipeline + + ``` + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + condition: succeededOrFailed() + ``` + + ![azdevops-4](images/azdevops-4.png) + +``` +# ASP.NET +# Build and test ASP.NET projects. +# Add steps that publish symbols, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 + +trigger: +- main + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '6.0.106' + +- task: NuGetToolInstaller@1 + +- task: NuGetCommand@2 + inputs: + command: 'restore' + restoreSolution: '$(solution)' + feedsToUse: 'config' + nugetConfigPath: 'NuGet.config' + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: VSTest@2 + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: '$(Parameters.ArtifactName)' + publishLocation: 'Container' + condition: succeededOrFailed() +``` + +* Click **Save & queue** in the top menu. Click **Save & queue** again and click **Save and run** to run the Build pipeline + +* When the Build pipeline has finished. Click **1 published; 1 consumed** + + + +## Creating a Web App in the Azure Portal to deploy [YourAppName].HttpApi.Host project + +* Search for Web App in the *Search the Marketplace* field + +* Click the **Create** button in the Web App window + +* Select rg[YourAppName] in the *Resource Group* dropdown + +* Enter [YourAppName]API in the *Name input* field + +* Select code, .NET Core 3.1 (LTS) and windows as *Operating System* + +* Enter [YourAppName]API in the *Name input* field + +* Select .NET Core 3.1 (LTS) in the *Runtime stack* dropdown + +* Select Windows as *Operating System* + +* Select the same *Region* as in the SQL server you created in Part 3 + +![azdevops-5](images/azdevops-5.png) + +* Click **Create new** in the Windows Plan. Name it [YourAppName]ApiWinPlan + +* Click **Change size** in Sku and size. Go to the Dev/Test Free F1 version and click the **Apply** button + +![azdevops-6](images/azdevops-6.png) + +* Click the **Review + create** button. Click the **Create** button + +* Click **Go to resource** when the Web App has been created + + + +## Creating a release pipeline in the AzureDevops and deploy [YourAppName].HttpApi.Host project + +* Sign in into [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) + +* Click [YourAppName]Proj and click **Releases** in the *Pipelines* menu + +* Click the **New pipeline** button in the *No release pipelines found* window + +* Select *Azure App Service deployment* and click the **Apply** button + +![azdevops-7](images/azdevops-7.png) + +* Enter *[YourAppName]staging* in the *Stage name* field in the *Stage* window. And close the window + +* Click **+ Add an artifact** in the *Pipeline* tab + +* Select the **Build** icon as *Source type* in the *Add an artifact* window + +* Select Build pipeline in the *Source (build pipeline)* dropdown and click the **Add** button + +![azdevops-8](images/azdevops-8.png) + +* Click the **Continuous deployment trigger (thunderbolt icon)** + +* Set the toggle to **Enabled** in the the *Continuous deployment trigger* window + +* Click **+ Add** in *No filters added*. Select **Include** in the *Type* dropdown. Select your branch in the *Build branch* dropdown and close the window + +![azdevops-9](images/azdevops-9.png) + +* Click **the little red circle with the exclamation mark** in the *Tasks* tab menu + +* Select your subscription in the *Azure subscription* dropdown. + +![azdevops-10](images/azdevops-10.png) + +* Click **Authorize** and enter your credentials in the next screens + +* After Authorization, select the **[YourAppName]API** in the *App service name* dropdown + +* Click the **Deploy Azure App Service** task + +* Select **[YourAppName].HttpApi.Host.zip** in the *Package or folder* input field + +![azdevops-11](images/azdevops-11.png) + +* Click the **Save** icon in the top menu and click **OK** + +* Click **Create release** in the top menu. Click **Create** to create a release + +* Click the *Pipeline* tab and wait until the Deployment succeeds + +![azdevops-12](images/azdevops-12.png) + +* Open a browser and navigate to the URL of your Web App + +``` +https://[YourAppName]api.azurewebsites.net +``` + +![azdevops-13](images/azdevops-13.png) + + + +## Creating a Web App in Azure Portal to deploy [YourAppName].Blazor project + +* Login into [Azure Portal](https://portal.azure.com/) + +* Click **Create a resource** + +* Search for *Web App* in the *Search the Marketplace* field + +* Click the **Create** button in the *Web App* window + +* Select *rg[YourAppName]* in the *Resource Group* dropdown + +* Enter *[YourAppName]Blazor* in the *Name* input field + +* Select *.NET Core 3.1 (LTS)* in the *Runtime stack* dropdown + +* Select *Windows* as *Operating System* + +* Select the same region as the SQL server you created in Part 3 + +* Select the [YourAppName]ApiWinPlan in the *Windows Plan* dropdown + +![azdevops-14](images/azdevops-14.png) + +* Click the **Review + create** button. Click **Create** button + +* Click **Go to resource** when the Web App has been created + +* Copy the URL of the Blazor Web App for later use + +``` +https://[YourAppName]blazor.azurewebsites.net +``` + + +## Changing the Web App configuration for the Azure App Service + +Copy the URL of the Api Host and Blazor Web App. Change appsettings.json files in the Web App as follows images. + +![azdevops-19](images/azdevops-19.png) + +![azdevops-20](images/azdevops-20.png) + +![azdevops-21](images/azdevops-21.png) + + + +## Adding an extra Stage in the Release pipeline in the AzureDevops to deploy [YourAppName].Blazor project + +* Go to the *Release* pipeline in [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) and click **Edit** + +* Click the **+ Add** link and add a **New Stage** + +![azdevops-15](images/azdevops-15.png) + +* Select *Azure App Service deployment* and click the **Apply** button + +* Enter *BlazorDeployment* in the *Stage name* input field and close the *Stage* window + +* Click the **little red circle with the exclamation mark** in the BlazorDeployment stage + +* Select your subscription in the *Azure subscription* dropdown + +* Select your Blazor Web App in the *App service name* dropdown + +* Click the **Deploy Azure App Service task** + +* Select *[YourAppName].Blazor.zip* in the *Package or folder* input field + +![azdevops-16](images/azdevops-16.png) + +* Click **Save** in the top menu and click the **OK** button after + +* Click **Create release** in the top menu and click the **Create** button + +![azdevops-17](images/azdevops-17.png) + +![azdevops-22](images/azdevops-22.png) diff --git a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md index 251a84510b..4823cbaae9 100644 --- a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md +++ b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -141,13 +141,14 @@ Configure(options => }); ```` -**Example: Configure the client and exchange names** +**Example: Configure the client, exchange names and prefetchCount** ````csharp Configure(options => { options.ClientName = "TestApp1"; options.ExchangeName = "TestMessages"; + options.PrefetchCount = 1; }); ```` diff --git a/docs/en/Distributed-Locking.md b/docs/en/Distributed-Locking.md index d29b60ad04..a1e653a6a6 100644 --- a/docs/en/Distributed-Locking.md +++ b/docs/en/Distributed-Locking.md @@ -101,6 +101,25 @@ namespace AbpDemo * `timeout` (`TimeSpan`): A timeout value to wait to obtain the lock. Default value is `TimeSpan.Zero`, which means it doesn't wait if the lock is already owned by another application. * `cancellationToken`: A cancellation token that can be triggered later to cancel the operation. +### Configuration + +#### AbpDistributedLockOptions + +`AbpDistributedLockOptions` is the main options class to configure the distributed locking. + +**Example: Set the distributed lock key prefix for the application** + +Configure(options => +{ + options.KeyPrefix = "MyApp1"; +}); + +> Write that code inside the `ConfigureServices` method of your [module class](Module-Development-Basics.md). + +##### Available Options + +* KeyPrefix (string, default: null): Specify the lock name prefix. + ### Using DistributedLock Library's API ABP's `IAbpDistributedLock` service is very limited and mainly designed to be internally used by the ABP Framework. For your own applications, you can use the DistributedLock library's own API. See its [own documentation](https://github.com/madelson/DistributedLock) for details. diff --git a/docs/en/Entities.md b/docs/en/Entities.md index c57af27457..ef8f52a04f 100644 --- a/docs/en/Entities.md +++ b/docs/en/Entities.md @@ -112,6 +112,21 @@ For the example above, the composite key is composed of `UserId` and `RoleId`. F > Also note that Entities with Composite Primary Keys cannot utilize the `IRepository` interface since it requires a single Id property. However, you can always use `IRepository`. See [repositories documentation](Repositories.md) for more. +### EntityEquals + +`Entity.EntityEquals(...)` method is used to check if two Entity Objects are equals. + +Example: + +```csharp +Book book1 = ... +Book book2 = ... + +if (book1.EntityEquals(book2)) //Check equality +{ + ... +} +``` ## AggregateRoot Class diff --git a/docs/en/Multi-Tenancy.md b/docs/en/Multi-Tenancy.md index 569bfeb4ca..7dac3762aa 100644 --- a/docs/en/Multi-Tenancy.md +++ b/docs/en/Multi-Tenancy.md @@ -222,7 +222,6 @@ The following resolvers are provided and configured by default; * `CurrentUserTenantResolveContributor`: Gets the tenant id from claims of the current user, if the current user has logged in. **This should always be the first contributor for the security**. * `QueryStringTenantResolveContributor`: Tries to find current tenant id from query string parameters. The parameter name is `__tenant` by default. -* `FormTenantResolveContributor`:Tries to find current tenant id from form parameters. The parameter name is `__tenant` by default. * `RouteTenantResolveContributor`: Tries to find current tenant id from route (URL path). The variable name is `__tenant` by default. If you defined a route with this variable, then it can determine the current tenant from the route. * `HeaderTenantResolveContributor`: Tries to find current tenant id from HTTP headers. The header name is `__tenant` by default. * `CookieTenantResolveContributor`: Tries to find current tenant id from cookie values. The cookie name is `__tenant` by default. diff --git a/docs/en/Themes/LeptonXLite/Blazor.md b/docs/en/Themes/LeptonXLite/Blazor.md index 636c33ef28..0e32aa9825 100644 --- a/docs/en/Themes/LeptonXLite/Blazor.md +++ b/docs/en/Themes/LeptonXLite/Blazor.md @@ -122,6 +122,37 @@ builder.RootComponents.Add("#ApplicationContainer"); ## Customization +### Layout + +* Create a razor page, like `MyMainLayout.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits MainLayout +@attribute [ExposeServices(typeof(MainLayout))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainLayout.razor.cs`, in your blazor application as shown below: + +```csharp +[ExposeServices(typeof(MainLayout))] +[Dependency(ReplaceServices = true) +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + public partial class MyMainLayout + { + public string Name = "My Main Layout"; + } +} +``` + +> Don't forget to remove the repeated attributes from the razor page! + ### Toolbars LeptonX Lite includes separeted toolbars for desktop & mobile. You can manage toolbars independently. Toolbar names can be accessible in the **LeptonXLiteToolbars** class. @@ -150,3 +181,299 @@ public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context) > _You can visit the [Toolbars Documentation](https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars) for better understanding._ {{end}} + +## Components + +LeptonX Blazor is built on the basis of components. You can use the components in your application as you wish, or you can customize the components by overriding them. If you want to override a component please follow the steps. + +### Branding Component + +The **brand component** is a simple component that can be used to display your brand. It contains a **logo** and a **company name**. + + + +#### How to Override Branding Component + +* Create a razor page, like `MyBrandingComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits Branding +@attribute [ExposeServices(typeof(Branding))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBrandingComponent.razor.cs`, in your blazor application as shown below: + +```csharp +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + public partial class MyBrandingComponent + { + public string Name = "My Branding Component"; + } +} +``` + +### Breadcrumb Component + +On websites that have a lot of pages, **breadcrumb navigation** can greatly **enhance the way users find their way** around. In terms of **usability**, breadcrumbs reduce the number of actions a website **visitor** needs to take in order to get to a **higher-level page**, and they **improve** the **findability** of **website sections** and **pages**. + + + +#### How to Override the BreadCrumb Component + +* Create a razor page, like `MyBreadcrumbsComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits Breadcrumbs +@attribute [ExposeServices(typeof(Breadcrumbs))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBreadcrumbsComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(Breadcrumbs))] + [Dependency(ReplaceServices = true)] + public partial class MyBreadcrumbsComponent + { + public string Name = "My Breadcrumbs Component"; + } +} +``` + +### Main Menu Component + +Sidebar menus have been used as **a directory for Related Pages** for a **Service** offering, **Navigation** items for a **specific service** or topic and even just as **Links** the user may be interested in. + + + +#### How to Override the Main Menu Component + +* Create a razor page, like `MyMainMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Navigation; +@using Volo.Abp.DependencyInjection + +@inherits MainMenu +@attribute [ExposeServices(typeof(MainMenu))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainMenu.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Navigation; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MainMenu))] + [Dependency(ReplaceServices = true)] + public partial class MainMenu + { + public string Name = "My Main Menu Component"; + } +} +``` + +> The **main menu** renders the menu items **dynamically**. The **menu item** is a **razor component** named `MainMenuItem.razor.cs` in the same namespace with **main menu** and you can **override it** like the main menu. + +### Toolbar Items Component + +Toolbar items are used to add **extra functionality to the toolbar**. The toolbar is a **horizontal bar** that **contains** a group of **toolbar items**. + +#### How to Override the Toolbar Items Component + +* Create a razor page, like `MyToolbarItemsComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits ToolbarItemsComponent +@attribute [ExposeServices(typeof(ToolbarItemsComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyToolbarItemsComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(ToolbarItemsComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyToolbarItemsComponent + { + public string Name = "My Toolbar Items Component"; + } +} +``` + +### Language Switch Component + +Think about a **multi-lingual** website and the first thing that could **hit your mind** is **the language switch component**. A **navigation bar** is a **great place** to **embed a language switch**. By embedding the language switch in the navigation bar of your website, you would **make it simpler** for users to **find it** and **easily** switch the **language** **without trying to locate it across the website.** + + + +#### How to Override the Language Switch Component + +* Create a razor page, like `MyLanguageSwitchComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits LanguageSwitchComponent +@attribute [ExposeServices(typeof(LanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyLanguageSwitchComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(LanguageSwitchComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyLanguageSwitchComponent + { + public string Name = "My Language Switch Component"; + } +} +``` + +### Mobile Language Switch Component + +The **mobile** **language switch component** is used to switch the language of the website **on mobile devices**. The mobile language switch component is a **dropdown menu** that **contains all the languages** of the website. + + + +#### How to Override the Mobile Language Switch Component + +* Create a razor page, like `MyMobilLanguageSwitchComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilLanguageSwitchComponent +@attribute [ExposeServices(typeof(MobilLanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMobilLanguageSwitchComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MobilLanguageSwitchComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyMobilLanguageSwitchComponent + { + public string Name = "My Mobile Language Switch Component"; + } +} +``` + +### User Menu Component + +The **User Menu** is the **menu** that **drops down** when you **click your name** or **profile picture** in the **upper right corner** of your page (**in the toolbar**). It drops down options such as **Settings**, **Logout**, etc. + + + +#### How to Override the User Menu Component + +* Create a razor page, like `MyUserMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilLanguageSwitchComponent +@attribute [ExposeServices(typeof(MobilLanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyUserMenuComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(UserMenuComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyUserMenuComponent + { + public string Name = "My User Menu Component"; + } +} +``` + +### Mobile User Menu Component + +The **mobile user menu component** is used to display the **user menu on mobile devices**. The mobile user menu component is a **dropdown menu** that contains all the **options** of the **user menu**. + + + +#### How to override the Mobile User Menu Component + +* Create a razor page, like `MyMobileUserMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilUserMenuComponent +@attribute [ExposeServices(typeof(MobilUserMenuComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMobileUserMenuComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MobileUserMenuComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyMobileUserMenuComponent + { + public string Name = "My Mobile User Menu Component"; + } +} +``` diff --git a/docs/en/UI/Blazor/Layout-Hooks.md b/docs/en/UI/Blazor/Layout-Hooks.md new file mode 100644 index 0000000000..1118e02d37 --- /dev/null +++ b/docs/en/UI/Blazor/Layout-Hooks.md @@ -0,0 +1,125 @@ +# Blazor UI: Layout Hooks + +ABP Framework theming system places the page layout into the [theme](Theming.md) NuGet packages. That means the final application doesn't include a layout, so you can't directly change the layout code to customize it. + +> If you create a Blazor WASM project, the `index.html` file will be included within the template. You can also customize it to your needs. + +You can copy the theme code into your solution. In this case, you are completely free to customize it. However, then you won't be able to get automatic updates of the theme (by upgrading the theme NuGet package). + +The **Layout Hook System** allows you to **add code** at some specific parts of the layout. All layouts of all themes should implement these hooks. Finally, you can add a **razor component** into a hook point. + +## Example: Add a Simple Announcement Alert + +Assume that you need to add a simple banner to the layout (that will be available for all the pages) to make an announcement about your new product. First, **create a razor component** in your project: + +![bookstore-banner-component](../../images/bookstore-banner-component.png) + +**AnnouncementComponent.razor.cs** + +```csharp +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; + +namespace Acme.BookStore.Blazor.Components; + +public partial class AnnouncementComponent : ComponentBase +{ + private const string AnnouncementLocalStorageKey = "product-announcement-status"; + + [Inject] + public IJSRuntime JsRuntime { get; set; } + + public bool ShowBanner { get; set; } + + protected override async Task OnInitializedAsync() + { + ShowBanner = await ShowAnnouncementBannerAsync(); + } + + private async Task ShowAnnouncementBannerAsync() + { + var announcementLocalStorageValue = await JsRuntime.InvokeAsync("localStorage.getItem", AnnouncementLocalStorageKey); + + return announcementLocalStorageValue != null && + bool.TryParse(announcementLocalStorageValue, out var showAnnouncementBanner) && showAnnouncementBanner; + } + + private async Task HideAnnouncementBannerAsync() + { + await JsRuntime.InvokeVoidAsync("localStorage.setItem", AnnouncementLocalStorageKey, true); + ShowBanner = false; + StateHasChanged(); + } +} +``` + +**AnnouncementComponent.razor** + +```html +@if(ShowBanner) +{ +
+ A brand new product is in sale. Click here to learn more. + +
+} +``` + +Then, you can add this component to any of the hook points in the `ConfigureServices` of your module class: + +```csharp +Configure(options => +{ + options.Add( + LayoutHooks.Body.Last, //The hook name + typeof(AnnouncementComponent) //The component to add + ); +}); +``` + +Now, the `AnnouncementComponent` will be rendered in the `body` of the page as the last item. + +### Specifying the Layout + +The configuration above adds the `AnnouncementComponent` to all layouts. You may want to only add it to a specific layout: + +````csharp +Configure(options => +{ + options.Add( + LayoutHooks.Body.Last, + typeof(AnnouncementComponent), + layout: StandardLayouts.Application //Set the layout to add + ); +}); +```` + +See the *Layouts* section below to learn more about the layout system. + +## Layout Hook Points + +There are some pre-defined layout hook points. The standard hook points are: + +* `LayoutHooks.Body.First`: Used to add a component as the first item in the HTML body tag. +* `LayoutHooks.Body.Last`: Used to add a component as the last item in the HTML body tag. + +> You (or the modules you are using) can add **multiple items to the same hook point**. All of them will be added to the layout in the order they were added. + +## Layouts + +The layout system allows themes to define the standard named layouts and allows any page to select a proper layout for its purpose. There is one pre-defined layout: + +* "**Application**": The main (and the default) layout for an application. It typically contains a header, menu (sidebar), footer, toolbar... etc. + +This layout is defined in the `StandardLayouts` class as constants. You can definitely create your own layouts, but this layout is the standard layout and it's implemented by all the themes out of the box. + +> If you don't specify the layout, your razor component will be rendered in all of the layouts. + +### Layout Location + +You can find the `MainLayout.razor` [here](https://github.com/abpframework/abp/blob/dev/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor) for the basic theme. You can take it as a reference to build your own layouts or you can override it, if necessary. + +## See Also + +* [Customization / Overriding Components](Customization-Overriding-Components.md) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 14c584d376..ed9cb37135 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -939,6 +939,10 @@ { "text": "PWA Configuration", "path": "UI/Blazor/Pwa-Configuration.md" + }, + { + "text": "Layout Hooks", + "path": "UI/Blazor/Layout-Hooks.md" } ] }, @@ -1279,6 +1283,10 @@ } ] }, + { + "text": "Dapr Integration", + "path": "Dapr/Index.md" + }, { "text": "Testing", "path": "Testing.md" diff --git a/docs/en/images/bookstore-banner-component.png b/docs/en/images/bookstore-banner-component.png new file mode 100644 index 0000000000..2363b06fae Binary files /dev/null and b/docs/en/images/bookstore-banner-component.png differ diff --git a/docs/es/Getting-Started-AspNetCore-Application.md b/docs/es/Getting-Started-AspNetCore-Application.md new file mode 100644 index 0000000000..c4d124d827 --- /dev/null +++ b/docs/es/Getting-Started-AspNetCore-Application.md @@ -0,0 +1,140 @@ +# Empezando con ABP y una Aplicacion AspNet Core MVC Web + +Este tutorial explica como empezar una aplicacion ABP desde cero usando las dependencias minimas. Uno generalmente desea +empezar con la **[plantilla de inicio](Getting-Started-AspNetCore-MVC-Template.md)**. + +## Crea un Proyecto Nuevo + +1. Crea una Aplicacion Web AspNet Core nueva usando Visual Studio 2022 (17.0.0+): + +![](images/create-new-aspnet-core-application-v2.png) + +2. Configura el nuevo proyecto: + +![](images/select-empty-web-application-v2.png) + +3. Presione el boton Create: + +![create-aspnet-core-application](images/create-aspnet-core-application.png) + +## Instale el paquete Volo.Abp.AspNetCore.Mvc + +Volo.Abp.AspNetCore.Mvc es el paquete de integracion con AspNet Core MVC para ABP. Siendo asi, instalalo en su proyecto: + +```` +Install-Package Volo.Abp.AspNetCore.Mvc +```` + +## Crea el primer modulo ABP + +ABP es un marco de referencia modular y require una clase de **inicio (raíz) tipo modulo** derivada de ``AbpModule``: + +````C# +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Hosting; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Modularity; + +namespace BasicAspNetCoreApplication +{ + [DependsOn(typeof(AbpAspNetCoreMvcModule))] + public class AppModule : AbpModule + { + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + // Configura la canalización de peticiones HTTP. + if (env.IsDevelopment()) + { + app.UseExceptionHandler("/Error"); + // El valor por defecto de HSTS es 30 dias. Debes cambiar esto en ambientes productivos. Referencia https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseConfiguredEndpoints(); + } + } +} +```` + +``AppModule`` es un buen nombre para el modulo de inicio de una aplicacion. + +Los paquetes de ABP definen clases de tipo modulo y cada modulo puede depender de otro. +En el codigo anterior, el ``AppModule`` depende de el modulo ``AbpAspNetCoreMvcModule`` (definido por el paquete [Volo.Abp.AspNetCore.Mvc](https://www.nuget.org/packages/Volo.Abp.AspNetCore.Mvc)). Es comun agregar el atributo ``DependsOn`` despues de instalar un paquete ABP nuevo. + +En vez de la clase de inicion Startup, estamos configurando una canalizacion de ASP.NET Core en este modulo. + +## La clase Program + +El proximo paso es modificar la clase Program para integrate el sistema de modulos ABP: + +````C# +using BasicAspNetCoreApplication; + +var builder = WebApplication.CreateBuilder(args); + +await builder.Services.AddApplicationAsync(); + +var app = builder.Build(); + +await app.InitializeApplicationAsync(); +await app.RunAsync(); +```` + +``builder.Services.AddApplicationAsync();`` Agrega todos los servicios definidos en todos los modulos empezando desde ``AppModule``. + +``app.InitializeApplicationAsync()`` inicializa y empieza la aplicacion. + +## Ejecutar la Aplicación + +Es todo! Ejecuta la aplicación, debe funcionar como esperado. + +## Uso de Autofac como Marco de Inyección de Dependencia + +Mientras el sistema de Inyección de Dependencia de ASP.NET Core es suficiente para requerimientos basico, [Autofac](https://autofac.org/) proporciona características avanzadas como Inyección de Propiedades e Intercepcion de Metodos, los cuales son necesarios para que ABP pueda llevar a cabo funciones avanzadas. + +El acto de remplazar el sistema DI de ASP.NET Core por Autofac e integrarlo con ABP es facil. + +1. Instala el paquete [Volo.Abp.Autofac](https://www.nuget.org/packages/Volo.Abp.Autofac) + +```` +Install-Package Volo.Abp.Autofac +```` + +2. Agrega la dependencia sobre el modulo ``AbpAutofacModule`` + +````C# +[DependsOn(typeof(AbpAspNetCoreMvcModule))] +[DependsOn(typeof(AbpAutofacModule))] //Agrega la dependencia sobre el modulo ABP Autofac +public class AppModule : AbpModule +{ + ... +} +```` + +3. Actualiza `Program.cs` para que use Autofac: + +````C# +using BasicAspNetCoreApplication; + +var builder = WebApplication.CreateBuilder(args); + +builder.Host.UseAutofac(); //Agrega esta linea + +await builder.Services.AddApplicationAsync(); + +var app = builder.Build(); + +await app.InitializeApplicationAsync(); +await app.RunAsync(); +```` + +## Codigo fuente + + Obten el codigo fuente del ejemplo creado en este tutorial de [aqui](https://github.com/abpframework/abp-samples/tree/master/BasicAspNetCoreApplication). diff --git a/docs/es/images/create-aspnet-core-application.png b/docs/es/images/create-aspnet-core-application.png new file mode 100644 index 0000000000..b8b98f5c32 Binary files /dev/null and b/docs/es/images/create-aspnet-core-application.png differ diff --git a/docs/es/images/create-new-aspnet-core-application-v2.png b/docs/es/images/create-new-aspnet-core-application-v2.png new file mode 100644 index 0000000000..f8274ae2a4 Binary files /dev/null and b/docs/es/images/create-new-aspnet-core-application-v2.png differ diff --git a/docs/es/images/select-empty-web-application-v2.png b/docs/es/images/select-empty-web-application-v2.png new file mode 100644 index 0000000000..da32f71857 Binary files /dev/null and b/docs/es/images/select-empty-web-application-v2.png differ diff --git a/docs/pt-BR/Validation.md b/docs/pt-BR/Validation.md index 5818566cdd..662235431a 100644 --- a/docs/pt-BR/Validation.md +++ b/docs/pt-BR/Validation.md @@ -1,3 +1,182 @@ -## Validation +# Validação -Façam \ No newline at end of file +O sistema de validação é utilizado para validar a entrada do usuário ou a requisição do cliente para uma ação de um controller ou por um serviço. + +O ABP é compatível com o sistema de Validação de Modelos do ASP.NET Core e tudo escrito na [sua documentação](https://docs.microsoft.com/en-us/aspnet/core/mvc/models/validation) é válido para aplicações baseadas no ABP. Logo, esse documento foca nas funcionalidades do ABP ao invés de repetir a documentação da Microsoft. + +Além disso, o ABP adiciona os seguintes benefícios: + +* Define `IValidationEnabled` para adicionar validação automática para uma classe qualquer. Como todos os [serviços de aplicação](Application-Services.md) já o implementam, eles também são validados automaticamente. +* Automaticamente traduz os erros de validação para os atributos de anotação de dados. +* Provê serviços extensíveis para validar a chamada de um método ou o estado de um objeto. +* Provê integração com o [FluentValidation](https://fluentvalidation.net/) + +## Validando DTOs + +Essa seção introduz brevemente o sistema de validação. Para mais detalhes, veja a [Documentação da Validação de Modelo em ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/mvc/models/validation). + +### Atributos de anotação de dados + +Utilizar anotações de dados é uma maneira simples de implementar uma validação formal para um [DTO](Data-Transfer-Objects.md) de uma forma declarativa. Exemplo: + +````csharp +public class CreateBookDto +{ + [Required] + [StringLength(100)] + public string Name { get; set; } + + [Required] + [StringLength(1000)] + public string Description { get; set; } + + [Range(0, 999.99)] + public decimal Price { get; set; } +} +```` +Quando você utilizar essa classe como parâmetro para um [serviço da aplicação](Application-Services.md) ou um controller, ele será automaticamente validado e a validação traduzida será lançada ([e tratada](Exception-Handling.md) pelo ABP framework). + +### IValidatableObject + +`IValidatableObject` pode ser implementado por um DTO para executar uma lógica customizada de validação. O `CreateBookDto` no exemplo a seguir implementa essa interface e verifica se o `Name` é igual a `Description` e retorna um erro de validação nesse caso. + +````csharp +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Acme.BookStore +{ + public class CreateBookDto : IValidatableObject + { + [Required] + [StringLength(100)] + public string Name { get; set; } + + [Required] + [StringLength(1000)] + public string Description { get; set; } + + [Range(0, 999.99)] + public decimal Price { get; set; } + + public IEnumerable Validate( + ValidationContext validationContext) + { + if (Name == Description) + { + yield return new ValidationResult( + "Name and Description can not be the same!", + new[] { "Name", "Description" } + ); + } + } + } +} +```` + +#### Resolvendo um serviço. + +Se você precisar resolver um serviço do [sistema de injeção de dependências](Dependency-Injection.md), você pode utilizar o objeto `ValidationContext`. + +````csharp +var myService = validationContext.GetRequiredService(); +```` + +> Enquanto resolver os serviços no método `Validate` permite várias possibilidades, não é um boa prática implementar sua lógica de validação do domínio nos DTOs. Mantenha os DTOs simples. Seu propósito é transferir dados (DTO: Data Transfer Object, ou Objeto de Transferência de Dados). + +## Infraestrutura de Validação. + +Essa seção explica alguns serviços adicionais fornecidos pelo ABP Framework. + +### Interface IValidationEnabled + +`IValidationEnabled` é um marcador vazio de interface que pode ser implementado por qualquer classe (registrada e resolvida a partir do [DI](Dependency-Injection.md)) para permitir que o ABP framework realize o sistema de validação para os métodos da classe. Por exemplo: + +````csharp +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Validation; + +namespace Acme.BookStore +{ + public class MyService : ITransientDependency, IValidationEnabled + { + public virtual async Task DoItAsync(MyInput input) + { + //... + } + } +} +```` + +> O ABP framework utiliza o sistema de [Proxying Dinâmico / Interceptadores](Dynamic-Proxying-Interceptors.md) para realizar a validação. Para fazê-lo funcionar, seu método deve ser **virtual** ou seu serviço deve ser injetado e utilizado através de uma **interface** (como `IMyService`). + +#### Habilitando e Desabilitando Validações + +Você pode utilizar o `[DisableValidation]` e desabilitar a validação para métodos, classes e propriedades. + +````csharp +[DisableValidation] +public Void MyMethod() +{ +} + +[DisableValidation] +public class InputClass +{ + public string MyProperty { get; set; } +} + +public class InputClass +{ + [DisableValidation] + public string MyProperty { get; set; } +} +```` + +### AbpValidationException + +Uma vez que o ABP determina um erro de validação, é lançada uma validação do tipo `AbpValidationException`. O código da sua aplicação poderá lançar o `AbpValidationException`, mas na maioria das vezes não será necessário. + +* A propriedade `ValidationErrors` do `AbpValidationException` contem a lista com os erros de validação. +* O nível de log do `AbpValidationException` é definido como `Warning`. Todos os erros de validação são logados no [Sistema de Logging](Logging.md). +* `AbpValidationException` é tratado automaticamente pelo ABP framework e é convertido em um erro utilizável com o código de status HTTP 400. Veja a documentação de [Manipulação de Exceção](Exception-Handling.md) para mais informações. + +## Tópicos Avançados + +### IObjectValidator + +Além da validação automática, você pode querer validar um objeto manualmente. Nesse caso, [injete](Dependency-Injection.md) e use o serviço `IObjectValidator`: + +* O método `ValidateAsync` valida o objeto informado baseado nas regras de validação e lança uma `AbpValidationException` se não estiver em um estado válido. + +* `GetErrorsAsync` não lança uma exceção, somente retorna os erros de validação. + +`IObjectValidator` é implementado pelo `ObjectValidator` por padrão. `ObjectValidator` é extensível; você pode implementar a interface `IObjectValidationContributor` para contribuir com uma lógica customizada. Exemplo: + +````csharp +public class MyObjectValidationContributor + : IObjectValidationContributor, ITransientDependency +{ + public Task AddErrorsAsync(ObjectValidationContext context) + { + //Get the validating object + var obj = context.ValidatingObject; + + //Add the validation errors if available + context.Errors.Add(...); + return Task.CompletedTask; + } +} +```` + +* Lembre-se de registrar sua classe no [DI](Dependency-Injection.md) (implementar `ITransientDependency` faz isso no exemplo anterior) +* ABP vai automaticamente descobrir sua classe e utilizá-la em qualquer tipo de validação de objetos (incluindo chamadas de métodos de validação automáticas). + +### IMethodInvocationValidator + +`IMethodInvocationValidator` é utilizado para validar a chamada de um método. Ele utiliza internamente o `IObjectValidator` para validar os objetos passados na chamada do método. Você normalmente não precisa deste serviço, já que ele é utilizado automaticamente pelo framework, mas você pode querer reutilizar ou substituir na sua aplicação em alguns casos raros. + +## Integração com FluentValidation + +O pacote Volo.Abp.FluentValidation integra a biblioteca FluentValidation com o sistema de validação (implementando o `IObjectValidationContributor`). Veja o [documento de Integração com o FluentValidation](FluentValidation.md) para mais informações. diff --git a/docs/zh-Hans/Background-Jobs-Hangfire.md b/docs/zh-Hans/Background-Jobs-Hangfire.md index b1bf7b8c79..fb899758cc 100644 --- a/docs/zh-Hans/Background-Jobs-Hangfire.md +++ b/docs/zh-Hans/Background-Jobs-Hangfire.md @@ -66,6 +66,41 @@ public class YourModule : AbpModule } ```` +### 指定队列 + +你可以使用 [`QueueAttribute`](https://docs.hangfire.io/en/latest/background-processing/configuring-queues.html) 来指定队列. + +````csharp +using System.Threading.Tasks; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Emailing; + +namespace MyProject +{ + [Queue("alpha")] + public class EmailSendingJob + : AsyncBackgroundJob, ITransientDependency + { + private readonly IEmailSender _emailSender; + + public EmailSendingJob(IEmailSender emailSender) + { + _emailSender = emailSender; + } + + public override async Task ExecuteAsync(EmailSendingArgs args) + { + await _emailSender.SendAsync( + args.EmailAddress, + args.Subject, + args.Body + ); + } + } +} +```` + 1. 如果你想要使用Hangfire的面板,你可以在 `Module` 类的 `OnApplicationInitialization` 方法添加: `UseHangfireDashboard` ````csharp diff --git a/docs/zh-Hans/Background-Jobs-RabbitMq.md b/docs/zh-Hans/Background-Jobs-RabbitMq.md index 0f9fb21d8a..8bf61846e7 100644 --- a/docs/zh-Hans/Background-Jobs-RabbitMq.md +++ b/docs/zh-Hans/Background-Jobs-RabbitMq.md @@ -126,25 +126,31 @@ Configure(options => Configure(options => { options.DefaultQueueNamePrefix = "my_app_jobs."; + options.DefaultDelayedQueueNamePrefix = "my_app_jobs.delayed" + options.PrefetchCount = 1; options.JobQueues[typeof(EmailSendingArgs)] = new JobQueueConfiguration( typeof(EmailSendingArgs), queueName: "my_app_jobs.emails", - connectionName: "SecondConnection" + connectionName: "SecondConnection", + delayedQueueName:"my_app_jobs.emails.delayed" ); }); ``` -- 这个示例将默认的队列名前缀设置为 `my_app_jobs.`,如果多个项目都使用的同一个 RabbitMQ 服务,设置不同的前缀可以避免执行其他项目的后台作业. +- 这个示例将默认的队列名前缀设置为 `my_app_jobs.`并且设置默认的延迟队列名为 `my_app_jobs.delayed`,如果多个项目都使用的同一个 RabbitMQ 服务,设置不同的前缀可以避免执行其他项目的后台作业. +- 设置了预取数量, 用于所有队列. - 这里还设置了 `EmailSendingArgs` 绑定的 RabbitMQ 连接. `JobQueueConfiguration` 类的构造函数中,还有一些其他的可选参数. - `queueName`: 指定后台作业对应的队列名称(全名). +* `DelayedQueueName`: 指定后台延迟执行的作业对于的队列名称(全名). - `connectionName`: 后台作业对应的 RabbitMQ 连接名称,默认是 `Default`. - `durable`: 可选参数,默认为 `true`. - `exclusive`: 可选参数,默认为 `false`. - `autoDelete`: 可选参数,默认为 `false`. +* `PrefetchCount` (可选参数, 默认为: null) 如果你想要更多地了解 `durable`,`exclusive`,`autoDelete` 的用法,请阅读 RabbitMQ 提供的文档. diff --git a/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md index 1cd6b5b9dd..f45d4d90bf 100644 --- a/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md +++ b/docs/zh-Hans/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -141,13 +141,14 @@ Configure(options => }); ```` -**示例: 配置客户端和交换机名称** +**示例: 配置客户端,交换机名称和预取数量** ````csharp Configure(options => { options.ClientName = "TestApp1"; options.ExchangeName = "TestMessages"; + options.PrefetchCount = 1; }); ```` diff --git a/docs/zh-Hans/Distributed-Locking.md b/docs/zh-Hans/Distributed-Locking.md index 2176230403..a570f598af 100644 --- a/docs/zh-Hans/Distributed-Locking.md +++ b/docs/zh-Hans/Distributed-Locking.md @@ -101,6 +101,25 @@ namespace AbpDemo * `timeout` (`TimeSpan`): 等待获取锁的超时值. 默认值为`TimeSpan.Zero`, 这意味着如果锁已经被另一个应用程序拥有, 它不会等待. * `cancellationToken`: 取消令牌可在触发后取消操作. +### 配置 + +#### AbpDistributedLockOptions + +`AbpDistributedLockOptions` 是配置分布式锁的主要选项类. + +**示例: 设置应用程序的分布式锁Key前缀** + +Configure(options => +{ + options.KeyPrefix = "MyApp1"; +}); + +> 在你的[模块类](Module-Development-Basics.md)中的 `ConfigureServices` 方法进行配置. + +##### 可用选项 + +* KeyPrefix (string, 默认值: null): 指定分布式锁名称前缀. + ### 使用DistributedLock库的API ABP的`IAbpDistributedLock`服务非常有限, 主要用于ABP框架的内部使用. 对于你自己的应用程序, 可以使用DistributedLock库自己的API. 参见[文档](https://github.com/madelson/DistributedLock)详细信息. diff --git a/docs/zh-Hans/Entities.md b/docs/zh-Hans/Entities.md index 8fbf16ddd3..b9c236e346 100644 --- a/docs/zh-Hans/Entities.md +++ b/docs/zh-Hans/Entities.md @@ -105,6 +105,22 @@ public class UserRole : Entity > 需要注意,复合主键实体不可以使用 `IRepository` 接口,因为它需要一个唯一的Id属性. 但你可以使用 `IRepository`.更多信息请参见[仓储](Repositories.md)的文档. +### EntityEquals + +`Entity.EntityEquals(...)` 方法用于检查两个实体对象是否相等. + +示例: + +```csharp +Book book1 = ... +Book book2 = ... + +if (book1.EntityEquals(book2)) //Check equality +{ + ... +} +``` + ## 聚合根 "*聚合是域驱动设计中的一种模式.DDD的聚合是一组可以作为一个单元处理的域对象.例如,订单及订单系列的商品,这些是独立的对象,但将订单(连同订单系列的商品)视为一个聚合通常是很有用的*"( [查看详细介绍](http://martinfowler.com/bliki/DDD_Aggregate.html)) diff --git a/docs/zh-Hans/Multi-Tenancy.md b/docs/zh-Hans/Multi-Tenancy.md index 472dde9eab..6db625e7d9 100644 --- a/docs/zh-Hans/Multi-Tenancy.md +++ b/docs/zh-Hans/Multi-Tenancy.md @@ -322,7 +322,6 @@ Volo.Abp.AspNetCore.MultiTenancy 添加了下面这些租户解析器,从当前W * **CurrentUserTenantResolveContributor**: 如果当前用户已登录,从当前用户的声明中获取租户Id. **出于安全考虑,应该始终将其做为第一个Contributor**. * **QueryStringTenantResolveContributor**: 尝试从query string参数中获取当前租户,默认参数名为"__tenant". -* **FormTenantResolveContributor**: 尝试从form参数中获取当前租户,默认参数名为"__tenant". * **RouteTenantResolveContributor**:尝试从当前路由中获取(URL路径),默认是变量名是"__tenant".所以,如果你的路由中定义了这个变量,就可以从路由中确定当前租户. * **HeaderTenantResolveContributor**: 尝试从HTTP header中获取当前租户,默认的header名称是"__tenant". * **CookieTenantResolveContributor**: 尝试从当前cookie中获取当前租户.默认的Cookie名称是"__tenant". diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index fadd40bcc5..4ce47bdbc8 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -409,6 +409,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.RemoteServices", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Mvc.PlugIn", "test\Volo.Abp.AspNetCore.Mvc.PlugIn\Volo.Abp.AspNetCore.Mvc.PlugIn.csproj", "{C6D6D878-208A-4FD2-822E-365545D8681B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Dapr", "src\Volo.Abp.Dapr\Volo.Abp.Dapr.csproj", "{192A829F-D608-4E41-8DE0-058E943E453F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.EventBus.Dapr", "src\Volo.Abp.EventBus.Dapr\Volo.Abp.EventBus.Dapr.csproj", "{DCC41E99-EBC7-4F19-BA0D-A6F770D8E431}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Http.Client.Dapr", "src\Volo.Abp.Http.Client.Dapr\Volo.Abp.Http.Client.Dapr.csproj", "{18B796D2-D45D-41AE-9A42-75C9B14B20DF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Mvc.Dapr", "src\Volo.Abp.AspNetCore.Mvc.Dapr\Volo.Abp.AspNetCore.Mvc.Dapr.csproj", "{5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Mvc.Dapr.EventBus", "src\Volo.Abp.AspNetCore.Mvc.Dapr.EventBus\Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.csproj", "{B02EF042-C39E-45C4-A92D-BF7554E1889D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.DistributedLocking.Dapr", "src\Volo.Abp.DistributedLocking.Dapr\Volo.Abp.DistributedLocking.Dapr.csproj", "{CAE48068-233C-47A9-BEAB-DDF521730E7A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1219,6 +1231,30 @@ Global {C6D6D878-208A-4FD2-822E-365545D8681B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C6D6D878-208A-4FD2-822E-365545D8681B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C6D6D878-208A-4FD2-822E-365545D8681B}.Release|Any CPU.Build.0 = Release|Any CPU + {192A829F-D608-4E41-8DE0-058E943E453F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {192A829F-D608-4E41-8DE0-058E943E453F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {192A829F-D608-4E41-8DE0-058E943E453F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {192A829F-D608-4E41-8DE0-058E943E453F}.Release|Any CPU.Build.0 = Release|Any CPU + {DCC41E99-EBC7-4F19-BA0D-A6F770D8E431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCC41E99-EBC7-4F19-BA0D-A6F770D8E431}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCC41E99-EBC7-4F19-BA0D-A6F770D8E431}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCC41E99-EBC7-4F19-BA0D-A6F770D8E431}.Release|Any CPU.Build.0 = Release|Any CPU + {18B796D2-D45D-41AE-9A42-75C9B14B20DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18B796D2-D45D-41AE-9A42-75C9B14B20DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18B796D2-D45D-41AE-9A42-75C9B14B20DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18B796D2-D45D-41AE-9A42-75C9B14B20DF}.Release|Any CPU.Build.0 = Release|Any CPU + {5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1}.Release|Any CPU.Build.0 = Release|Any CPU + {B02EF042-C39E-45C4-A92D-BF7554E1889D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B02EF042-C39E-45C4-A92D-BF7554E1889D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B02EF042-C39E-45C4-A92D-BF7554E1889D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B02EF042-C39E-45C4-A92D-BF7554E1889D}.Release|Any CPU.Build.0 = Release|Any CPU + {CAE48068-233C-47A9-BEAB-DDF521730E7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAE48068-233C-47A9-BEAB-DDF521730E7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAE48068-233C-47A9-BEAB-DDF521730E7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAE48068-233C-47A9-BEAB-DDF521730E7A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1425,6 +1461,12 @@ Global {3683340D-92F5-4B14-B77B-34A163333309} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {EDFFDA74-090D-439C-A58D-06CCF86D4423} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {C6D6D878-208A-4FD2-822E-365545D8681B} = {447C8A77-E5F0-4538-8687-7383196D04EA} + {192A829F-D608-4E41-8DE0-058E943E453F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {DCC41E99-EBC7-4F19-BA0D-A6F770D8E431} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {18B796D2-D45D-41AE-9A42-75C9B14B20DF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {5EED625D-8D86-492A-BCB8-F6C8CD8D4AA1} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B02EF042-C39E-45C4-A92D-BF7554E1889D} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {CAE48068-233C-47A9-BEAB-DDF521730E7A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor new file mode 100644 index 0000000000..f512232b86 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor @@ -0,0 +1,7 @@ +@if (LayoutHookViewModel.Hooks.Any()) +{ + foreach (var hook in LayoutHookViewModel.Hooks) + { + + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs new file mode 100644 index 0000000000..18fbcd89c2 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Options; +using Volo.Abp.Ui.LayoutHooks; + +namespace Volo.Abp.AspNetCore.Components.Web.Theming.Components.LayoutHooks; + +public partial class LayoutHook : ComponentBase +{ + [Parameter] + public string Name { get; set; } + + [Parameter] + public string Layout { get; set; } + + [Inject] + protected IOptions LayoutHookOptions { get; set; } + + protected LayoutHookViewModel LayoutHookViewModel { get; private set; } + + protected override Task OnInitializedAsync() + { + if (LayoutHookOptions.Value.Hooks.TryGetValue(Name, out var layoutHooks)) + { + layoutHooks = layoutHooks + .WhereIf(string.IsNullOrWhiteSpace(Layout), x => x.Layout == Layout) + .ToList(); + } + + layoutHooks ??= new List(); + + LayoutHookViewModel = new LayoutHookViewModel(layoutHooks.ToArray(), Layout); + + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs new file mode 100644 index 0000000000..ea73a5673f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/StandardLayouts.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout; + +public static class StandardLayouts +{ + public const string Application = "Application"; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs index 05531096d4..00f7f5da23 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarManager.cs @@ -3,16 +3,17 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars; public class PageToolbarManager : IPageToolbarManager, ITransientDependency { - protected IHybridServiceScopeFactory ServiceScopeFactory { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } public PageToolbarManager( - IHybridServiceScopeFactory serviceScopeFactory) + IServiceScopeFactory serviceScopeFactory) { ServiceScopeFactory = serviceScopeFactory; } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs index 523a770a17..c3ba260a88 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs @@ -9,26 +9,43 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly; public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency { - protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; } + protected AbpApplicationConfigurationClientProxy ApplicationConfigurationClientProxy { get; } + + protected AbpApplicationLocalizationClientProxy ApplicationLocalizationClientProxy { get; } protected ApplicationConfigurationCache Cache { get; } protected ICurrentTenantAccessor CurrentTenantAccessor { get; } public WebAssemblyCachedApplicationConfigurationClient( - AbpApplicationConfigurationClientProxy applicationConfigurationAppService, + AbpApplicationConfigurationClientProxy applicationConfigurationClientProxy, ApplicationConfigurationCache cache, - ICurrentTenantAccessor currentTenantAccessor) + ICurrentTenantAccessor currentTenantAccessor, + AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy) { - ApplicationConfigurationAppService = applicationConfigurationAppService; + ApplicationConfigurationClientProxy = applicationConfigurationClientProxy; Cache = cache; CurrentTenantAccessor = currentTenantAccessor; + ApplicationLocalizationClientProxy = applicationLocalizationClientProxy; } public virtual async Task InitializeAsync() { - var configurationDto = await ApplicationConfigurationAppService.GetAsync(); + var configurationDto = await ApplicationConfigurationClientProxy.GetAsync( + new ApplicationConfigurationRequestOptions { + IncludeLocalizationResources = false + } + ); + + var localizationDto = await ApplicationLocalizationClientProxy.GetAsync( + new ApplicationLocalizationRequestDto { + CultureName = configurationDto.Localization.CurrentCulture.Name, + OnlyDynamics = true + } + ); + configurationDto.Localization.Resources = localizationDto.Resources; + Cache.Set(configurationDto); CurrentTenantAccessor.Current = new BasicTenantInfo( diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs index ad36cf0f11..e0d8ecd806 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs @@ -15,7 +15,6 @@ public class AbpAspNetCoreMultiTenancyModule : AbpModule Configure(options => { options.TenantResolvers.Add(new QueryStringTenantResolveContributor()); - options.TenantResolvers.Add(new FormTenantResolveContributor()); options.TenantResolvers.Add(new RouteTenantResolveContributor()); options.TenantResolvers.Add(new HeaderTenantResolveContributor()); options.TenantResolvers.Add(new CookieTenantResolveContributor()); diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs index 67ef0a4c2c..d55343c94c 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/FormTenantResolveContributor.cs @@ -1,10 +1,11 @@ -using System.Linq; +using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Volo.Abp.MultiTenancy; namespace Volo.Abp.AspNetCore.MultiTenancy; +[Obsolete("This may make some features of ASP NET Core unavailable, Will be removed in future versions.")] public class FormTenantResolveContributor : HttpTenantResolveContributorBase { public const string ContributorName = "Form"; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationConfigurationClientProxy.Generated.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationConfigurationClientProxy.Generated.cs index 198cfce711..2d57dc66ab 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationConfigurationClientProxy.Generated.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationConfigurationClientProxy.Generated.cs @@ -15,8 +15,11 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies; [ExposeServices(typeof(IAbpApplicationConfigurationAppService), typeof(AbpApplicationConfigurationClientProxy))] public partial class AbpApplicationConfigurationClientProxy : ClientProxyBase, IAbpApplicationConfigurationAppService { - public virtual async Task GetAsync() + public virtual async Task GetAsync(ApplicationConfigurationRequestOptions options) { - return await RequestAsync(nameof(GetAsync)); + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(ApplicationConfigurationRequestOptions), options } + }); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.Generated.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.Generated.cs new file mode 100644 index 0000000000..74db054d18 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.Generated.cs @@ -0,0 +1,25 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Modeling; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +// ReSharper disable once CheckNamespace +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IAbpApplicationLocalizationAppService), typeof(AbpApplicationLocalizationClientProxy))] +public partial class AbpApplicationLocalizationClientProxy : ClientProxyBase, IAbpApplicationLocalizationAppService +{ + public virtual async Task GetAsync(ApplicationLocalizationRequestDto input) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(ApplicationLocalizationRequestDto), input } + }); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.cs new file mode 100644 index 0000000000..11bef4cecf --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/AbpApplicationLocalizationClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of AbpApplicationLocalizationClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies; + +public partial class AbpApplicationLocalizationClientProxy +{ +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/abp-generate-proxy.json b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/abp-generate-proxy.json index bf15515078..ce18e3eefd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/abp-generate-proxy.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/ClientProxies/abp-generate-proxy.json @@ -7,6 +7,8 @@ "Pages.Abp.MultiTenancy.AbpTenantController": { "controllerName": "AbpTenant", "controllerGroupName": "AbpTenant", + "isRemoteService": true, + "apiVersion": null, "type": "Pages.Abp.MultiTenancy.AbpTenantController", "interfaces": [ { @@ -93,6 +95,8 @@ "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController": { "controllerName": "AbpApplicationConfiguration", "controllerGroupName": "AbpApplicationConfiguration", + "isRemoteService": true, + "apiVersion": null, "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController", "interfaces": [ { @@ -100,14 +104,36 @@ } ], "actions": { - "GetAsync": { - "uniqueName": "GetAsync", + "GetAsyncByOptions": { + "uniqueName": "GetAsyncByOptions", "name": "GetAsync", "httpMethod": "GET", "url": "api/abp/application-configuration", "supportedVersions": [], - "parametersOnMethod": [], - "parameters": [], + "parametersOnMethod": [ + { + "name": "options", + "typeAsString": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions, Volo.Abp.AspNetCore.Mvc.Contracts", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "options", + "name": "IncludeLocalizationResources", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "options" + } + ], "returnValue": { "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto", "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto" @@ -117,9 +143,74 @@ } } }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController": { + "controllerName": "AbpApplicationLocalization", + "controllerGroupName": "AbpApplicationLocalization", + "isRemoteService": true, + "apiVersion": null, + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController", + "interfaces": [ + { + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationLocalizationAppService" + } + ], + "actions": { + "GetAsyncByInput": { + "uniqueName": "GetAsyncByInput", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/abp/application-localization", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto, Volo.Abp.AspNetCore.Mvc.Contracts", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "CultureName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "OnlyDynamics", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationLocalizationAppService" + } + } + }, "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController": { "controllerName": "AbpApiDefinition", "controllerGroupName": "AbpApiDefinition", + "isRemoteService": true, + "apiVersion": null, "type": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController", "interfaces": [], "actions": { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteExternalLocalizationStore.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteExternalLocalizationStore.cs new file mode 100644 index 0000000000..c5548acc62 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteExternalLocalizationStore.cs @@ -0,0 +1,87 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Localization; +using Volo.Abp.Localization.External; + +namespace Volo.Abp.AspNetCore.Mvc.Client; + +public class RemoteExternalLocalizationStore : IExternalLocalizationStore, ITransientDependency +{ + protected ICachedApplicationConfigurationClient ConfigurationClient { get; } + protected AbpLocalizationOptions LocalizationOptions { get; } + + public RemoteExternalLocalizationStore( + ICachedApplicationConfigurationClient configurationClient, + IOptions localizationOptions) + { + ConfigurationClient = configurationClient; + LocalizationOptions = localizationOptions.Value; + } + + public virtual LocalizationResourceBase GetResourceOrNull(string resourceName) + { + var configurationDto = ConfigurationClient.Get(); + return CreateLocalizationResourceFromConfigurationOrNull(resourceName, configurationDto); + } + + public virtual async Task GetResourceOrNullAsync(string resourceName) + { + var configurationDto = await ConfigurationClient.GetAsync(); + return CreateLocalizationResourceFromConfigurationOrNull(resourceName, configurationDto); + } + + public virtual async Task GetResourceNamesAsync() + { + var configurationDto = await ConfigurationClient.GetAsync(); + return configurationDto + .Localization + .Resources + .Keys + .Where(x => !LocalizationOptions.Resources.ContainsKey(x)) + .ToArray(); +; } + + public virtual async Task GetResourcesAsync() + { + var configurationDto = await ConfigurationClient.GetAsync(); + var resources = new List(); + + foreach (var resource in configurationDto.Localization.Resources) + { + if (LocalizationOptions.Resources.ContainsKey(resource.Key)) + { + continue; + } + + resources.Add(CreateNonTypedLocalizationResource(resource.Key, resource.Value)); + } + + return resources.ToArray(); + } + + protected virtual LocalizationResourceBase CreateLocalizationResourceFromConfigurationOrNull( + string resourceName, + ApplicationConfigurationDto configurationDto) + { + var resourceDto = configurationDto.Localization.Resources.GetOrDefault(resourceName); + + if (resourceDto == null) + { + return null; + } + + return CreateNonTypedLocalizationResource(resourceName, resourceDto); + } + + protected virtual NonTypedLocalizationResource CreateNonTypedLocalizationResource( + string resourceName, + ApplicationLocalizationResourceDto resourceDto) + { + return new NonTypedLocalizationResource(resourceName) + .AddBaseResources(resourceDto.BaseResources); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs index c01fc6a1af..e6e180c5f2 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteLocalizationContributor.cs @@ -1,15 +1,20 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.Localization; namespace Volo.Abp.AspNetCore.Mvc.Client; public class RemoteLocalizationContributor : ILocalizationResourceContributor { - private LocalizationResource _resource; + public bool IsDynamic => true; + + private LocalizationResourceBase _resource; private ICachedApplicationConfigurationClient _applicationConfigurationClient; private ILogger _logger; @@ -21,50 +26,137 @@ public class RemoteLocalizationContributor : ILocalizationResourceContributor ?? NullLogger.Instance; } - public LocalizedString GetOrNull(string cultureName, string name) + public virtual LocalizedString GetOrNull(string cultureName, string name) + { + /* cultureName is not used because remote localization can only + * be done in the current culture. */ + + return GetOrNullInternal(_resource.ResourceName, name); + } + + protected virtual LocalizedString GetOrNullInternal(string resourceName, string name) { - var resource = GetResourceOrNull(); + var resource = GetResourceOrNull(resourceName); if (resource == null) { return null; } - var value = resource.GetOrDefault(name); - if (value == null) + var value = resource.Texts.GetOrDefault(name); + if (value != null) { - return null; + return new LocalizedString(name, value); + } + + foreach (var baseResource in resource.BaseResources) + { + value = GetOrNullInternal(baseResource, name); + if (value != null) + { + return new LocalizedString(name, value); + } + } + + return null; + } + + public virtual void Fill(string cultureName, Dictionary dictionary) + { + /* cultureName is not used because remote localization can only + * be done in the current culture. */ + + FillInternal(_resource.ResourceName, dictionary); + } + + protected virtual void FillInternal(string resourceName, Dictionary dictionary) + { + var resource = GetResourceOrNull(resourceName); + if (resource == null) + { + return; + } + + foreach (var baseResource in resource.BaseResources) + { + FillInternal(baseResource, dictionary); } - return new LocalizedString(name, value); + foreach (var keyValue in resource.Texts) + { + dictionary[keyValue.Key] = new LocalizedString(keyValue.Key, keyValue.Value); + } } - public void Fill(string cultureName, Dictionary dictionary) + public virtual async Task FillAsync(string cultureName, Dictionary dictionary) + { + /* cultureName is not used because remote localization can only + * be done in the current culture. */ + + await FillInternalAsync(_resource.ResourceName, dictionary); + } + + protected virtual async Task FillInternalAsync(string resourceName, Dictionary dictionary) { - var resource = GetResourceOrNull(); + var resource = await GetResourceOrNullAsync(resourceName); if (resource == null) { return; } + + foreach (var baseResource in resource.BaseResources) + { + await FillInternalAsync(baseResource, dictionary); + } - foreach (var keyValue in resource) + foreach (var keyValue in resource.Texts) { dictionary[keyValue.Key] = new LocalizedString(keyValue.Key, keyValue.Value); } } - private Dictionary GetResourceOrNull() + public virtual Task> GetSupportedCulturesAsync() + { + /* This contributor does not know all the supported cultures by the + remote localization resource, and it is not needed on the client side */ + return Task.FromResult((IEnumerable)Array.Empty()); + } + + protected virtual ApplicationLocalizationResourceDto GetResourceOrNull(string resourceName) { var applicationConfigurationDto = _applicationConfigurationClient.Get(); + return GetResourceOrNull(applicationConfigurationDto, resourceName); + } + + protected virtual async Task GetResourceOrNullAsync(string resourceName) + { + var applicationConfigurationDto = await _applicationConfigurationClient.GetAsync(); + return GetResourceOrNull(applicationConfigurationDto, resourceName); + } - var resource = applicationConfigurationDto + protected virtual ApplicationLocalizationResourceDto GetResourceOrNull( + ApplicationConfigurationDto applicationConfigurationDto, + string resourceName) + { + var resource = applicationConfigurationDto.Localization.Resources.GetOrDefault(resourceName); + if (resource != null) + { + return resource; + } + + var legacyResource = applicationConfigurationDto .Localization.Values - .GetOrDefault(_resource.ResourceName); + .GetOrDefault(resourceName); - if (resource == null) + if (legacyResource != null) { - _logger.LogWarning($"Could not find the localization resource {_resource.ResourceName} on the remote server!"); + return new ApplicationLocalizationResourceDto + { + Texts = legacyResource, + BaseResources = Array.Empty() + }; } - return resource; + _logger.LogWarning($"Could not find the localization resource {resourceName} on the remote server!"); + return null; } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs index 7bb2e67b49..405d43906d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs @@ -15,6 +15,7 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu { protected IHttpContextAccessor HttpContextAccessor { get; } protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; } + protected AbpApplicationLocalizationClientProxy ApplicationLocalizationClientProxy { get; } protected ICurrentUser CurrentUser { get; } protected IDistributedCache Cache { get; } @@ -22,11 +23,13 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu IDistributedCache cache, AbpApplicationConfigurationClientProxy applicationConfigurationAppService, ICurrentUser currentUser, - IHttpContextAccessor httpContextAccessor) + IHttpContextAccessor httpContextAccessor, + AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy) { ApplicationConfigurationAppService = applicationConfigurationAppService; CurrentUser = currentUser; HttpContextAccessor = httpContextAccessor; + ApplicationLocalizationClientProxy = applicationLocalizationClientProxy; Cache = cache; } @@ -42,7 +45,7 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu configuration = await Cache.GetOrAddAsync( cacheKey, - async () => await ApplicationConfigurationAppService.GetAsync(), + async () => await GetRemoteConfigurationAsync(), () => new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(300) //TODO: Should be configurable. @@ -57,6 +60,27 @@ public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigu return configuration; } + private async Task GetRemoteConfigurationAsync() + { + var config = await ApplicationConfigurationAppService.GetAsync( + new ApplicationConfigurationRequestOptions + { + IncludeLocalizationResources = false + } + ); + + var localizationDto = await ApplicationLocalizationClientProxy.GetAsync( + new ApplicationLocalizationRequestDto { + CultureName = config.Localization.CurrentCulture.Name, + OnlyDynamics = true + } + ); + + config.Localization.Resources = localizationDto.Resources; + + return config; + } + public ApplicationConfigurationDto Get() { var cacheKey = CreateCacheKey(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationRequestOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationRequestOptions.cs new file mode 100644 index 0000000000..a01534775a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationRequestOptions.cs @@ -0,0 +1,9 @@ +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +public class ApplicationConfigurationRequestOptions +{ + /// + /// Set to true to fill the Values property in . + /// + public bool IncludeLocalizationResources { get; set; } = true; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs index f92c9d7bb9..b1c0c16e76 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationConfigurationDto.cs @@ -7,8 +7,23 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; [Serializable] public class ApplicationLocalizationConfigurationDto { + /// + /// This is not filled if is false. + /// public Dictionary> Values { get; set; } + /// + /// This property will never be filled by the application configuration endpoint + /// (by AbpApplicationConfigurationAppService). However, it is here to be filled + /// using the application localization endpoint (AbpApplicationLocalizationAppService). + /// This is an ugly design, but it is the best solution for backward-compability and + /// simple implementation. + /// + /// It's client's responsibility to fill this property + /// using the application localization endpoint. + /// + public Dictionary Resources { get; set; } = new(); + public List Languages { get; set; } public CurrentCultureDto CurrentCulture { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationDto.cs new file mode 100644 index 0000000000..d301490bed --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationDto.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +[Serializable] +public class ApplicationLocalizationDto +{ + public Dictionary Resources { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationRequestDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationRequestDto.cs new file mode 100644 index 0000000000..535d572b3f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationRequestDto.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +public class ApplicationLocalizationRequestDto +{ + [Required] + public string CultureName { get; set; } + + public bool OnlyDynamics { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationResourceDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationResourceDto.cs new file mode 100644 index 0000000000..a7200423d2 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationLocalizationResourceDto.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +[Serializable] +public class ApplicationLocalizationResourceDto +{ + public Dictionary Texts { get; set; } + + public string[] BaseResources { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentCultureDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentCultureDto.cs index 8f1896e31f..83f1e0c803 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentCultureDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentCultureDto.cs @@ -1,5 +1,8 @@ -namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; +using System; +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +[Serializable] public class CurrentCultureDto { public string DisplayName { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationConfigurationAppService.cs index 9c8fd3d414..ae4f22cc06 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationConfigurationAppService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationConfigurationAppService.cs @@ -5,5 +5,5 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; public interface IAbpApplicationConfigurationAppService : IApplicationService { - Task GetAsync(); -} + Task GetAsync(ApplicationConfigurationRequestOptions options); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationLocalizationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationLocalizationAppService.cs new file mode 100644 index 0000000000..af72c8f7ee --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/IAbpApplicationLocalizationAppService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +public interface IAbpApplicationLocalizationAppService : IApplicationService +{ + Task GetAsync(ApplicationLocalizationRequestDto input); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xml b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xsd b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.csproj new file mode 100644 index 0000000000..78b46cad27 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.csproj @@ -0,0 +1,18 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusModule.cs new file mode 100644 index 0000000000..333a5aae9a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusModule.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Http.Json; +using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; +using Volo.Abp.EventBus.Dapr; +using Volo.Abp.Json.SystemTextJson; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +[DependsOn( + typeof(AbpAspNetCoreMvcDaprModule), + typeof(AbpEventBusDaprModule) +)] +public class AbpAspNetCoreMvcDaprEventBusModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + // TODO: Add NewtonsoftJson json converter. + + Configure(options => + { + options.SerializerOptions.Converters.Add(new AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter()); + }); + + Configure(options => + { + options.JsonSerializerOptions.Converters.Add(new AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter()); + }); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusOptions.cs new file mode 100644 index 0000000000..02ca4c8e22 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprEventBusOptions.cs @@ -0,0 +1,11 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +public class AbpAspNetCoreMvcDaprEventBusOptions +{ + public List Contributors { get; } + + public AbpAspNetCoreMvcDaprEventBusOptions() + { + Contributors = new List(); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubConsts.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubConsts.cs new file mode 100644 index 0000000000..e785f2e737 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubConsts.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +public class AbpAspNetCoreMvcDaprPubSubConsts +{ + public const string DaprSubscribeUrl = "dapr/subscribe"; + + public const string DaprEventCallbackUrl = "api/abp/dapr/event"; +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProvider.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProvider.cs new file mode 100644 index 0000000000..e797bd2fc0 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProvider.cs @@ -0,0 +1,63 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus; +using Volo.Abp.EventBus.Dapr; +using Volo.Abp.EventBus.Distributed; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +public class AbpAspNetCoreMvcDaprPubSubProvider : ITransientDependency +{ + protected IServiceProvider ServiceProvider { get; } + protected AbpAspNetCoreMvcDaprEventBusOptions AspNetCoreMvcDaprEventBusOptions { get; } + protected AbpDaprEventBusOptions DaprEventBusOptions { get; } + protected AbpDistributedEventBusOptions DistributedEventBusOptions { get; } + + public AbpAspNetCoreMvcDaprPubSubProvider( + IServiceProvider serviceProvider, + IOptions aspNetCoreDaprEventBusOptions, + IOptions daprEventBusOptions, + IOptions distributedEventBusOptions) + { + ServiceProvider = serviceProvider; + AspNetCoreMvcDaprEventBusOptions = aspNetCoreDaprEventBusOptions.Value; + DaprEventBusOptions = daprEventBusOptions.Value; + DistributedEventBusOptions = distributedEventBusOptions.Value; + } + + public virtual async Task> GetSubscriptionsAsync() + { + var subscriptions = new List(); + foreach (var handler in DistributedEventBusOptions.Handlers) + { + foreach (var @interface in handler.GetInterfaces().Where(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IDistributedEventHandler<>))) + { + var eventType = @interface.GetGenericArguments()[0]; + var eventName = EventNameAttribute.GetNameOrDefault(eventType); + + subscriptions.Add(new AbpAspNetCoreMvcDaprSubscriptionDefinition() + { + PubSubName = DaprEventBusOptions.PubSubName, + Topic = eventName, + Route = AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl + }); + } + } + + if (AspNetCoreMvcDaprEventBusOptions.Contributors.Any()) + { + using (var scope = ServiceProvider.CreateScope()) + { + var context = new AbpAspNetCoreMvcDaprPubSubProviderContributorContext(scope.ServiceProvider, subscriptions); + foreach (var contributor in AspNetCoreMvcDaprEventBusOptions.Contributors) + { + await contributor.ContributeAsync(context); + } + } + } + + return subscriptions; + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProviderContributorContext.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProviderContributorContext.cs new file mode 100644 index 0000000000..564b541dec --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/AbpAspNetCoreMvcDaprPubSubProviderContributorContext.cs @@ -0,0 +1,16 @@ +using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +public class AbpAspNetCoreMvcDaprPubSubProviderContributorContext +{ + public IServiceProvider ServiceProvider { get; } + + public List Subscriptions { get; } + + public AbpAspNetCoreMvcDaprPubSubProviderContributorContext(IServiceProvider serviceProvider, List daprSubscriptionModels) + { + ServiceProvider = serviceProvider; + Subscriptions = daprSubscriptionModels; + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprPubSubController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprPubSubController.cs new file mode 100644 index 0000000000..674e227cd0 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Controllers/AbpAspNetCoreMvcDaprPubSubController.cs @@ -0,0 +1,38 @@ +using System.Text.Json; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; +using Volo.Abp.Dapr; +using Volo.Abp.EventBus.Dapr; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Controllers; + +[Area("abp")] +[RemoteService(Name = "abp")] +public class AbpAspNetCoreMvcDaprPubSubController : AbpController +{ + [HttpGet(AbpAspNetCoreMvcDaprPubSubConsts.DaprSubscribeUrl)] + public virtual async Task> SubscribeAsync() + { + return await HttpContext.RequestServices.GetRequiredService().GetSubscriptionsAsync(); + } + + [HttpPost(AbpAspNetCoreMvcDaprPubSubConsts.DaprEventCallbackUrl)] + public virtual async Task EventsAsync() + { + this.HttpContext.ValidateDaprAppApiToken(); + + var bodyJsonDocument = await JsonDocument.ParseAsync(HttpContext.Request.Body); + var request = JsonSerializer.Deserialize(bodyJsonDocument.RootElement.GetRawText(), + HttpContext.RequestServices.GetRequiredService>().Value.JsonSerializerOptions); + + var distributedEventBus = HttpContext.RequestServices.GetRequiredService(); + var daprSerializer = HttpContext.RequestServices.GetRequiredService(); + + var eventData = daprSerializer.Deserialize(bodyJsonDocument.RootElement.GetProperty("data").GetRawText(), distributedEventBus.GetEventType(request.Topic)); + await distributedEventBus.TriggerHandlersAsync(distributedEventBus.GetEventType(request.Topic), eventData); + + return Ok(); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/IAbpAspNetCoreMvcDaprPubSubProviderContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/IAbpAspNetCoreMvcDaprPubSubProviderContributor.cs new file mode 100644 index 0000000000..87047cd7ec --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/IAbpAspNetCoreMvcDaprPubSubProviderContributor.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus; + +public interface IAbpAspNetCoreMvcDaprPubSubProviderContributor +{ + Task ContributeAsync(AbpAspNetCoreMvcDaprPubSubProviderContributorContext context); +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionDefinition.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionDefinition.cs new file mode 100644 index 0000000000..287e78e01a --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionDefinition.cs @@ -0,0 +1,10 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; + +public class AbpAspNetCoreMvcDaprSubscriptionDefinition +{ + public string PubSubName { get; set; } + + public string Topic { get; set; } + + public string Route { get; set; } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionRequest.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionRequest.cs new file mode 100644 index 0000000000..46c04b5a44 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/Models/AbpAspNetCoreMvcDaprSubscriptionRequest.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; + +public class AbpAspNetCoreMvcDaprSubscriptionRequest +{ + public string PubSubName { get; set; } + + public string Topic { get; set; } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy.cs new file mode 100644 index 0000000000..0aa6bd4f7c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy.cs @@ -0,0 +1,11 @@ +using System.Text.Json; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; + +public class AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy : JsonNamingPolicy +{ + public override string ConvertName(string name) + { + return name.ToLower(); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter.cs new file mode 100644 index 0000000000..bcd2a0e1be --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus/Volo/Abp/AspNetCore/Mvc/Dapr/EventBus/SystemTextJson/AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter.cs @@ -0,0 +1,25 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.Models; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr.EventBus.SystemTextJson; + +public class AbpAspNetCoreMvcDaprSubscriptionDefinitionConverter : JsonConverter +{ + private JsonSerializerOptions? _writeJsonSerializerOptions; + + public override AbpAspNetCoreMvcDaprSubscriptionDefinition Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + throw new NotSupportedException(); + } + + public override void Write(Utf8JsonWriter writer, AbpAspNetCoreMvcDaprSubscriptionDefinition value, JsonSerializerOptions options) + { + _writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(new JsonSerializerOptions(options) + { + PropertyNamingPolicy = new AbpAspNetCoreMvcDaprPubSubJsonNamingPolicy() + }, x => x == this); + + JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xml b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xsd b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo.Abp.AspNetCore.Mvc.Dapr.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo.Abp.AspNetCore.Mvc.Dapr.csproj new file mode 100644 index 0000000000..d792a30b24 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo.Abp.AspNetCore.Mvc.Dapr.csproj @@ -0,0 +1,22 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/AbpAspNetCoreMvcDaprModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/AbpAspNetCoreMvcDaprModule.cs new file mode 100644 index 0000000000..f8ba3fcfc2 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/AbpAspNetCoreMvcDaprModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Dapr; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr; + +[DependsOn( + typeof(AbpAspNetCoreMvcModule), + typeof(AbpDaprModule) +)] +public class AbpAspNetCoreMvcDaprModule : AbpModule +{ + +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprAppApiTokenValidator.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprAppApiTokenValidator.cs new file mode 100644 index 0000000000..817eb9824d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprAppApiTokenValidator.cs @@ -0,0 +1,75 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Authorization; +using Volo.Abp.Dapr; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr; + +public class DaprAppApiTokenValidator : IDaprAppApiTokenValidator, ISingletonDependency +{ + protected IHttpContextAccessor HttpContextAccessor { get; } + protected HttpContext HttpContext => GetHttpContext(); + + public DaprAppApiTokenValidator(IHttpContextAccessor httpContextAccessor) + { + HttpContextAccessor = httpContextAccessor; + } + + public virtual void CheckDaprAppApiToken() + { + var expectedAppApiToken = GetConfiguredAppApiTokenOrNull(); + if (expectedAppApiToken.IsNullOrWhiteSpace()) + { + return; + } + + var headerAppApiToken = GetDaprAppApiTokenOrNull(); + if (headerAppApiToken.IsNullOrWhiteSpace()) + { + throw new AbpAuthorizationException("Expected Dapr App API Token is not provided! Dapr should set the 'dapr-api-token' HTTP header."); + } + + if (expectedAppApiToken != headerAppApiToken) + { + throw new AbpAuthorizationException("The Dapr App API Token (provided in the 'dapr-api-token' HTTP header) doesn't match the expected value!"); + } + } + + public virtual bool IsValidDaprAppApiToken() + { + var expectedAppApiToken = GetConfiguredAppApiTokenOrNull(); + if (expectedAppApiToken.IsNullOrWhiteSpace()) + { + return true; + } + + var headerAppApiToken = GetDaprAppApiTokenOrNull(); + return expectedAppApiToken == headerAppApiToken; + } + + public virtual string? GetDaprAppApiTokenOrNull() + { + string apiTokenHeader = HttpContext.Request.Headers["dapr-api-token"]; + if (string.IsNullOrEmpty(apiTokenHeader) || apiTokenHeader.Length < 1) + { + return null; + } + + return apiTokenHeader; + } + + protected virtual string? GetConfiguredAppApiTokenOrNull() + { + return HttpContext + .RequestServices + .GetRequiredService() + .GetAppApiToken(); + } + + protected virtual HttpContext GetHttpContext() + { + return HttpContextAccessor.HttpContext ?? throw new AbpException("HttpContext is not available!"); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprHttpContextExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprHttpContextExtensions.cs new file mode 100644 index 0000000000..15663d0c3c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/DaprHttpContextExtensions.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Mvc.Dapr; + +public static class DaprHttpContextExtensions +{ + public static void ValidateDaprAppApiToken(this HttpContext httpContext) + { + httpContext + .RequestServices + .GetRequiredService() + .CheckDaprAppApiToken(); + } + + public static bool IsValidDaprAppApiToken(this HttpContext httpContext) + { + return httpContext + .RequestServices + .GetRequiredService() + .IsValidDaprAppApiToken(); + } + + public static string? GetDaprAppApiTokenOrNull(HttpContext httpContext) + { + return httpContext + .RequestServices + .GetRequiredService() + .GetDaprAppApiTokenOrNull(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/IDaprAppApiTokenValidator.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/IDaprAppApiTokenValidator.cs new file mode 100644 index 0000000000..ed5f281ea8 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Dapr/Volo/Abp/AspNetCore/Mvc/Dapr/IDaprAppApiTokenValidator.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.AspNetCore.Mvc.Dapr; + +public interface IDaprAppApiTokenValidator +{ + void CheckDaprAppApiToken(); + bool IsValidDaprAppApiToken(); + string? GetDaprAppApiTokenOrNull(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSize.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSize.cs index f022dacce5..452a616365 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSize.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSize.cs @@ -5,5 +5,11 @@ public enum AbpModalSize Default, Small, Large, - ExtraLarge + ExtraLarge, + Fullscreen, + FullscreenSmDown, + FullscreenMdDown, + FullscreenLgDown, + FullscreenXlDown, + FullscreenXxlDown } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSizeExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSizeExtensions.cs index 7b0de7a595..9477783557 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSizeExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalSizeExtensions.cs @@ -14,6 +14,18 @@ public static class AbpModalSizeExtensions return "modal-xl"; case AbpModalSize.Default: return ""; + case AbpModalSize.Fullscreen: + return "modal-fullscreen"; + case AbpModalSize.FullscreenSmDown: + return "modal-fullscreen-sm-down"; + case AbpModalSize.FullscreenMdDown: + return "modal-fullscreen-md-down"; + case AbpModalSize.FullscreenLgDown: + return "modal-fullscreen-lg-down"; + case AbpModalSize.FullscreenXlDown: + return "modal-fullscreen-xl-down"; + case AbpModalSize.FullscreenXxlDown: + return "modal-fullscreen-xxl-down"; default: throw new AbpException($"Unknown {nameof(AbpModalSize)}: {size}"); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleFileContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleFileContributor.cs index f6b709c897..7f218e7fbf 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleFileContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleFileContributor.cs @@ -16,7 +16,7 @@ public class BundleFileContributor : BundleContributor { foreach (var file in Files) { - context.Files.AddIfNotContains(file); + context.Files.AddIfNotContains(x => x.Equals(file, StringComparison.OrdinalIgnoreCase), () => file); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/hu.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/hu.json index 108b3520d7..0e9d2b2281 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/hu.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/hu.json @@ -1,13 +1,13 @@ { - "culture": "hu", - "texts": { - "GivenTenantIsNotExist": "Adott bérlő nem létezik: {0}", - "GivenTenantIsNotAvailable": "A megadott előfizető nem érhető el: {0}", - "Tenant": "Előfizető", - "Switch": "váltás", - "Name": "Neve", - "SwitchTenantHint": "Hagyja üresen az előfizető nevet hogy a host oldalra kapcsoljon.", - "SwitchTenant": "Előfizető váltás", - "NotSelected": "Nincs kiválasztva" - } + "culture": "hu", + "texts": { + "GivenTenantIsNotExist": "Adott bérlő nem létezik: {0}", + "GivenTenantIsNotAvailable": "A megadott előfizető nem érhető el: {0}", + "Tenant": "Előfizető", + "Switch": "váltás", + "Name": "Neve", + "SwitchTenantHint": "Hagyja üresen az előfizető nevet hogy a host oldalra kapcsoljon.", + "SwitchTenant": "Előfizető váltás", + "NotSelected": "Nincs kiválasztva" } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs index b795c62c39..ec27b8087c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/PageToolbars/PageToolbarManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; @@ -10,11 +11,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars; public class PageToolbarManager : IPageToolbarManager, ITransientDependency { protected AbpPageToolbarOptions Options { get; } - protected IHybridServiceScopeFactory ServiceScopeFactory { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } public PageToolbarManager( IOptions options, - IHybridServiceScopeFactory serviceScopeFactory) + IServiceScopeFactory serviceScopeFactory) { Options = options.Value; ServiceScopeFactory = serviceScopeFactory; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageToolbar/Button/AbpPageToolbarButtonViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageToolbar/Button/AbpPageToolbarButtonViewComponent.cs index 097fad5f40..56ae47f0c8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageToolbar/Button/AbpPageToolbarButtonViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Pages/Shared/Components/AbpPageToolbar/Button/AbpPageToolbarButtonViewComponent.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button; @@ -15,7 +16,7 @@ public class AbpPageToolbarButtonViewComponent : AbpViewComponent StringLocalizerFactory = stringLocalizerFactory; } - public IViewComponentResult Invoke( + public async Task InvokeAsync( ILocalizableString text, string name, string icon, @@ -31,11 +32,11 @@ public class AbpPageToolbarButtonViewComponent : AbpViewComponent return View( "~/Pages/Shared/Components/AbpPageToolbar/Button/Default.cshtml", new AbpPageToolbarButtonViewModel( - text.Localize(StringLocalizerFactory), + await text.LocalizeAsync(StringLocalizerFactory), name, icon, id, - busyText?.Localize(StringLocalizerFactory), + busyText == null ? null : await busyText.LocalizeAsync(StringLocalizerFactory), iconType, type, size, diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml index 61e9afbf6e..34536ec373 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/Default.cshtml @@ -1,5 +1,4 @@ -@using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook -@model LayoutHookViewModel +@model Volo.Abp.Ui.LayoutHooks.LayoutHookViewModel @if (Model.Hooks.Any()) { foreach (var hook in Model.Hooks) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs index 45eaa2b6a3..5bd18e4c31 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewComponent.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; +using Volo.Abp.Ui.LayoutHooks; namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Mvc/Abstractions/ActionDescriptorExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Mvc/Abstractions/ActionDescriptorExtensions.cs index 4bc4673860..24c9b071bd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Mvc/Abstractions/ActionDescriptorExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Mvc/Abstractions/ActionDescriptorExtensions.cs @@ -43,4 +43,14 @@ public static class ActionDescriptorExtensions { return actionDescriptor is PageActionDescriptor; } + + public static PageActionDescriptor AsPageAction(this ActionDescriptor actionDescriptor) + { + if (!actionDescriptor.IsPageAction()) + { + throw new AbpException($"{nameof(actionDescriptor)} should be type of {typeof(PageActionDescriptor).AssemblyQualifiedName}"); + } + + return actionDescriptor as PageActionDescriptor; + } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs index 528a04583d..0deae4b5b3 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs @@ -17,6 +17,7 @@ using Volo.Abp.Data; using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.Localization; +using Volo.Abp.Localization.External; using Volo.Abp.MultiTenancy; using Volo.Abp.Settings; using Volo.Abp.Timing; @@ -82,7 +83,7 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp _multiTenancyOptions = multiTenancyOptions.Value; } - public virtual async Task GetAsync() + public virtual async Task GetAsync(ApplicationConfigurationRequestOptions options) { //TODO: Optimize & cache..? @@ -93,7 +94,7 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp Auth = await GetAuthConfigAsync(), Features = await GetFeaturesConfigAsync(), GlobalFeatures = await GetGlobalFeaturesConfigAsync(), - Localization = await GetLocalizationConfigAsync(), + Localization = await GetLocalizationConfigAsync(options), CurrentUser = GetCurrentUser(), Setting = await GetSettingConfigAsync(), MultiTenancy = GetMultiTenancy(), @@ -171,7 +172,8 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp foreach (var policyName in policyNames) { - if (await _defaultAuthorizationPolicyProvider.GetPolicyAsync(policyName) == null && _permissionDefinitionManager.GetOrNull(policyName) != null) + if (await _defaultAuthorizationPolicyProvider.GetPolicyAsync(policyName) == null && + await _permissionDefinitionManager.GetOrNullAsync(policyName) != null) { abpPolicyNames.Add(policyName); } @@ -204,26 +206,42 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp return authConfig; } - protected virtual async Task GetLocalizationConfigAsync() + protected virtual async Task GetLocalizationConfigAsync( + ApplicationConfigurationRequestOptions options) { var localizationConfig = new ApplicationLocalizationConfigurationDto(); localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync()); - foreach (var resource in _localizationOptions.Resources.Values) + if (options.IncludeLocalizationResources) { - var dictionary = new Dictionary(); - - var localizer = _serviceProvider.GetRequiredService( - typeof(IStringLocalizer<>).MakeGenericType(resource.ResourceType) - ) as IStringLocalizer; - - foreach (var localizedString in localizer.GetAllStrings()) + var resourceNames = _localizationOptions + .Resources + .Values + .Select(x => x.ResourceName) + .Union( + await LazyServiceProvider + .LazyGetRequiredService() + .GetResourceNamesAsync() + ); + + foreach (var resourceName in resourceNames) { - dictionary[localizedString.Name] = localizedString.Value; - } + var dictionary = new Dictionary(); + + var localizer = await StringLocalizerFactory + .CreateByResourceNameOrNullAsync(resourceName); + + if (localizer != null) + { + foreach (var localizedString in await localizer.GetAllStringsAsync()) + { + dictionary[localizedString.Name] = localizedString.Value; + } + } - localizationConfig.Values[resource.ResourceName] = dictionary; + localizationConfig.Values[resourceName] = dictionary; + } } localizationConfig.CurrentCulture = GetCurrentCultureInfo(); @@ -290,7 +308,7 @@ public class AbpApplicationConfigurationAppService : ApplicationService, IAbpApp { var result = new ApplicationFeatureConfigurationDto(); - foreach (var featureDefinition in _featureDefinitionManager.GetAll()) + foreach (var featureDefinition in await _featureDefinitionManager.GetAllAsync()) { if (!featureDefinition.IsVisibleToClients) { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs index 6c410a8a7b..427aaf65a6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationController.cs @@ -21,9 +21,10 @@ public class AbpApplicationConfigurationController : AbpControllerBase, IAbpAppl } [HttpGet] - public virtual async Task GetAsync() + public virtual async Task GetAsync( + ApplicationConfigurationRequestOptions options) { _antiForgeryManager.SetCookie(); - return await _applicationConfigurationAppService.GetAsync(); + return await _applicationConfigurationAppService.GetAsync(options); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs index 92a4bdef0d..7fafee261c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs @@ -17,14 +17,14 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; [ApiExplorerSettings(IgnoreApi = true)] public class AbpApplicationConfigurationScriptController : AbpController { - private readonly IAbpApplicationConfigurationAppService _configurationAppService; + private readonly AbpApplicationConfigurationAppService _configurationAppService; private readonly IJsonSerializer _jsonSerializer; private readonly AbpAspNetCoreMvcOptions _options; private readonly IJavascriptMinifier _javascriptMinifier; private readonly IAbpAntiForgeryManager _antiForgeryManager; public AbpApplicationConfigurationScriptController( - IAbpApplicationConfigurationAppService configurationAppService, + AbpApplicationConfigurationAppService configurationAppService, IJsonSerializer jsonSerializer, IOptions options, IJavascriptMinifier javascriptMinifier, @@ -41,7 +41,13 @@ public class AbpApplicationConfigurationScriptController : AbpController [Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)] public async Task Get() { - var script = CreateAbpExtendScript(await _configurationAppService.GetAsync()); + var script = CreateAbpExtendScript( + await _configurationAppService.GetAsync( + new ApplicationConfigurationRequestOptions { + IncludeLocalizationResources = false + } + ) + ); _antiForgeryManager.SetCookie(); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationAppService.cs new file mode 100644 index 0000000000..48d7f949c3 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationAppService.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Options; +using Volo.Abp.Application.Services; +using Volo.Abp.Localization; +using Volo.Abp.Localization.External; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +public class AbpApplicationLocalizationAppService : + ApplicationService, + IAbpApplicationLocalizationAppService +{ + protected IExternalLocalizationStore ExternalLocalizationStore { get; } + protected AbpLocalizationOptions LocalizationOptions { get; } + + public AbpApplicationLocalizationAppService( + IExternalLocalizationStore externalLocalizationStore, + IOptions localizationOptions) + { + ExternalLocalizationStore = externalLocalizationStore; + LocalizationOptions = localizationOptions.Value; + } + + public async Task GetAsync(ApplicationLocalizationRequestDto input) + { + using (CultureHelper.Use(input.CultureName)) + { + var resources = LocalizationOptions + .Resources + .Values + .Union( + await ExternalLocalizationStore.GetResourcesAsync() + ).ToArray(); + + var localizationConfig = new ApplicationLocalizationDto { + Resources = new Dictionary(resources.Length) + }; + + foreach (var resource in resources) + { + var dictionary = new Dictionary(); + var localizer = await StringLocalizerFactory.CreateByResourceNameOrNullAsync(resource.ResourceName); + if (localizer != null) + { + Dictionary staticLocalizedStrings = null; + + if (input.OnlyDynamics) + { + staticLocalizedStrings = (await localizer.GetAllStringsAsync( + includeParentCultures: true, + includeBaseLocalizers: false, + includeDynamicContributors: false + )).ToDictionary(x => x.Name); + } + + var localizedStringsWithDynamics = await localizer.GetAllStringsAsync( + includeParentCultures: true, + includeBaseLocalizers: false, + includeDynamicContributors: true + ); + + foreach (var localizedString in localizedStringsWithDynamics) + { + if (input.OnlyDynamics) + { + var staticLocalizedString = staticLocalizedStrings.GetOrDefault(localizedString.Name); + if (staticLocalizedString != null && + localizedString.Value == staticLocalizedString.Value) + { + continue; + } + } + + dictionary[localizedString.Name] = localizedString.Value; + } + } + + localizationConfig.Resources[resource.ResourceName] = + new ApplicationLocalizationResourceDto { + Texts = dictionary, + BaseResources = resource.BaseResourceNames.ToArray() + }; + } + + return localizationConfig; + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationController.cs new file mode 100644 index 0000000000..a056746022 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationLocalizationController.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; + +[Area("abp")] +[RemoteService(Name = "abp")] +[Route("api/abp/application-localization")] +public class AbpApplicationLocalizationController: AbpControllerBase, IAbpApplicationLocalizationAppService +{ + private readonly IAbpApplicationLocalizationAppService _localizationAppService; + + public AbpApplicationLocalizationController(IAbpApplicationLocalizationAppService localizationAppService) + { + _localizationAppService = localizationAppService; + } + + [HttpGet] + public virtual async Task GetAsync(ApplicationLocalizationRequestDto input) + { + return await _localizationAppService.GetAsync(input); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs index 8acfcefd3d..0f9b05830d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ObjectExtending/CachedObjectExtensionsDtoService.cs @@ -204,9 +204,7 @@ public class CachedObjectExtensionsDtoService : ICachedObjectExtensionsDtoServic { return new LocalizableStringDto( localizableStringInstance.Name, - localizableStringInstance.ResourceType != null - ? LocalizationResourceNameAttribute.GetName(localizableStringInstance.ResourceType) - : null + localizableStringInstance.ResourceName ); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs index 47ed4c4614..dfffeea5b4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditActionFilter.cs @@ -70,7 +70,9 @@ public class AbpAuditActionFilter : IAsyncActionFilter, ITransientDependency } var auditingHelper = context.GetRequiredService(); - if (!auditingHelper.ShouldSaveAudit(context.ActionDescriptor.GetMethodInfo(), true)) + if (!auditingHelper.ShouldSaveAudit( + context.ActionDescriptor.GetMethodInfo(), + defaultValue: GetDefaultAuditBehavior(options, context.ActionDescriptor))) { return false; } @@ -85,4 +87,20 @@ public class AbpAuditActionFilter : IAsyncActionFilter, ITransientDependency return true; } + + private static bool GetDefaultAuditBehavior( + AbpAuditingOptions abpAuditingOptions, + ActionDescriptor actionDescriptor) + { + if (!abpAuditingOptions.IsEnabledForIntegrationServices && + actionDescriptor + .AsControllerActionDescriptor() + .ControllerTypeInfo + .IsDefined(typeof(IntegrationServiceAttribute), true)) + { + return false; + } + + return true; + } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs index 2abfd477db..1f347decf7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs @@ -75,7 +75,7 @@ public class AbpAuditPageFilter : IAsyncPageFilter, ITransientDependency } var auditingHelper = context.GetRequiredService(); - if (!auditingHelper.ShouldSaveAudit(context.HandlerMethod.MethodInfo, true)) + if (!auditingHelper.ShouldSaveAudit(context.HandlerMethod.MethodInfo, defaultValue: true)) { return false; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs index 3891827c0f..0906d46006 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs @@ -26,9 +26,11 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep string httpMethod, [CanBeNull] ConventionalControllerSetting configuration) { - var controllerNameInUrl = NormalizeUrlControllerName(rootPath, controllerName, action, httpMethod, configuration); + var apiRoutePrefix = GetApiRoutePrefix(action, configuration); + var controllerNameInUrl = + NormalizeUrlControllerName(rootPath, controllerName, action, httpMethod, configuration); - var url = $"api/{rootPath}/{NormalizeControllerNameCase(controllerNameInUrl, configuration)}"; + var url = $"{apiRoutePrefix}/{rootPath}/{NormalizeControllerNameCase(controllerNameInUrl, configuration)}"; //Add {id} path if needed var idParameterModel = action.Parameters.FirstOrDefault(p => p.ParameterName == "id"); @@ -69,6 +71,16 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep return url; } + protected virtual string GetApiRoutePrefix(ActionModel actionModel, ConventionalControllerSetting configuration) + { + if (actionModel.Controller.ControllerType.IsDefined(typeof(IntegrationServiceAttribute), true)) + { + return AbpAspNetCoreConsts.DefaultIntegrationServiceApiPrefix; + } + + return AbpAspNetCoreConsts.DefaultApiPrefix; + } + protected virtual string NormalizeUrlActionName(string rootPath, string controllerName, ActionModel action, string httpMethod, [CanBeNull] ConventionalControllerSetting configuration) { @@ -108,7 +120,8 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep ); } - protected virtual string NormalizeControllerNameCase(string controllerName, [CanBeNull] ConventionalControllerSetting configuration) + protected virtual string NormalizeControllerNameCase(string controllerName, + [CanBeNull] ConventionalControllerSetting configuration) { if (configuration?.UseV3UrlStyle ?? Options.UseV3UrlStyle) { @@ -120,7 +133,8 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep } } - protected virtual string NormalizeActionNameCase(string actionName, [CanBeNull] ConventionalControllerSetting configuration) + protected virtual string NormalizeActionNameCase(string actionName, + [CanBeNull] ConventionalControllerSetting configuration) { if (configuration?.UseV3UrlStyle ?? Options.UseV3UrlStyle) { @@ -132,13 +146,15 @@ public class ConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDep } } - protected virtual string NormalizeIdPropertyNameCase(PropertyInfo property, [CanBeNull] ConventionalControllerSetting configuration) + protected virtual string NormalizeIdPropertyNameCase(PropertyInfo property, + [CanBeNull] ConventionalControllerSetting configuration) { return property.Name; } - protected virtual string NormalizeSecondaryIdNameCase(ParameterModel secondaryId, [CanBeNull] ConventionalControllerSetting configuration) + protected virtual string NormalizeSecondaryIdNameCase(ParameterModel secondaryId, + [CanBeNull] ConventionalControllerSetting configuration) { return secondaryId.ParameterName; } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpApplicationLocalizationScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpApplicationLocalizationScriptController.cs new file mode 100644 index 0000000000..d8da85f871 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpApplicationLocalizationScriptController.cs @@ -0,0 +1,69 @@ +using System; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; +using Volo.Abp.Auditing; +using Volo.Abp.Http; +using Volo.Abp.Json; +using Volo.Abp.Localization; +using Volo.Abp.Minify.Scripts; + +namespace Volo.Abp.AspNetCore.Mvc.Localization; + +[Area("Abp")] +[Route("Abp/ApplicationLocalizationScript")] +[DisableAuditing] +[RemoteService(false)] +[ApiExplorerSettings(IgnoreApi = true)] +public class AbpApplicationLocalizationScriptController : AbpController +{ + protected AbpApplicationLocalizationAppService LocalizationAppService { get; } + protected AbpAspNetCoreMvcOptions Options { get; } + protected IJsonSerializer JsonSerializer { get; } + protected IJavascriptMinifier JavascriptMinifier { get; } + + public AbpApplicationLocalizationScriptController( + AbpApplicationLocalizationAppService localizationAppService, + IOptions options, + IJsonSerializer jsonSerializer, + IJavascriptMinifier javascriptMinifier) + { + LocalizationAppService = localizationAppService; + JsonSerializer = jsonSerializer; + JavascriptMinifier = javascriptMinifier; + Options = options.Value; + } + + [HttpGet] + [Produces(MimeTypes.Application.Javascript, MimeTypes.Text.Plain)] + public async Task GetAsync(ApplicationLocalizationRequestDto input) + { + var script = CreateScript( + await LocalizationAppService.GetAsync(input) + ); + + return Content( + Options.MinifyGeneratedScript == true + ? JavascriptMinifier.Minify(script) + : script, + MimeTypes.Application.Javascript + ); + } + + private string CreateScript(ApplicationLocalizationDto localizationDto) + { + var script = new StringBuilder(); + + script.AppendLine("(function(){"); + script.AppendLine(); + script.AppendLine( + $"$.extend(true, abp.localization, {JsonSerializer.Serialize(localizationDto, indented: true)})"); + script.AppendLine(); + script.Append("})();"); + + return script.ToString(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs index dc44f12124..9f5d6aa530 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs @@ -3,12 +3,14 @@ using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; using Microsoft.AspNetCore.RequestLocalization; +using Volo.Abp.Auditing; using Volo.Abp.Localization; namespace Volo.Abp.AspNetCore.Mvc.Localization; [Area("Abp")] [Route("Abp/Languages/[action]")] +[DisableAuditing] [RemoteService(false)] [ApiExplorerSettings(IgnoreApi = true)] public class AbpLanguagesController : AbpController diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs index 20ac2e4cb8..3501882e3a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs @@ -5,7 +5,7 @@ using Volo.Abp.Http.ProxyScripting.Generators.JQuery; namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting; -public class ServiceProxyGenerationModel //: TODO: IShouldNormalize +public class ServiceProxyGenerationModel { public string Type { get; set; } diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs index a6569d001b..15c1d74ccb 100644 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs @@ -9,7 +9,7 @@ public static class AbpHostingEnvironmentExtensions this IWebHostEnvironment env, AbpConfigurationBuilderOptions options = null) { - options = options ?? new AbpConfigurationBuilderOptions(); + options ??= new AbpConfigurationBuilderOptions(); if (options.BasePath.IsNullOrEmpty()) { diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs index 1324df0865..6fd02a0470 100644 --- a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationMiddleware.cs @@ -27,7 +27,9 @@ public class AbpRequestLocalizationMiddleware : IMiddleware, ITransientDependenc { var middleware = new RequestLocalizationMiddleware( next, - new OptionsWrapper(await _requestLocalizationOptionsProvider.GetLocalizationOptionsAsync()), + new OptionsWrapper( + await _requestLocalizationOptionsProvider.GetLocalizationOptionsAsync() + ), _loggerFactory ); diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreConsts.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreConsts.cs new file mode 100644 index 0000000000..dff987b6b3 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreConsts.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.AspNetCore; + +public static class AbpAspNetCoreConsts +{ + public const string DefaultApiPrefix = "api"; + public const string DefaultIntegrationServiceApiPrefix = "integration-api"; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreAuditingOptions.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreAuditingOptions.cs index 7977205096..693945e903 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreAuditingOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreAuditingOptions.cs @@ -10,5 +10,5 @@ public class AbpAspNetCoreAuditingOptions /// will be disabled for URLs /// starting with an ignored URL. /// - public List IgnoredUrls { get; } = new List(); + public List IgnoredUrls { get; } = new(); } diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs index 9cae64501a..83deaef26a 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs @@ -94,8 +94,23 @@ public class AbpAuditingMiddleware : IMiddleware, ITransientDependency private bool IsIgnoredUrl(HttpContext context) { - return context.Request.Path.Value != null && - AspNetCoreAuditingOptions.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x)); + if (context.Request.Path.Value == null) + { + return false; + } + + if (!AuditingOptions.IsEnabledForIntegrationServices && + context.Request.Path.Value.StartsWith($"/{AbpAspNetCoreConsts.DefaultIntegrationServiceApiPrefix}/")) + { + return true; + } + + if (AspNetCoreAuditingOptions.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x))) + { + return true; + } + + return false; } private async Task ShouldWriteAuditLogAsync(AuditLogInfo auditLogInfo, HttpContext httpContext, bool hasError) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/DependencyInjection/HttpContextServiceScopeFactory.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/DependencyInjection/HttpContextServiceScopeFactory.cs deleted file mode 100644 index a7f00f7451..0000000000 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/DependencyInjection/HttpContextServiceScopeFactory.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.AspNetCore.DependencyInjection; - -[ExposeServices( - typeof(IHybridServiceScopeFactory), - typeof(HttpContextServiceScopeFactory) - )] -[Dependency(ReplaceServices = true)] -public class HttpContextServiceScopeFactory : IHybridServiceScopeFactory, ITransientDependency -{ - protected IHttpContextAccessor HttpContextAccessor { get; } - - protected IServiceScopeFactory ServiceScopeFactory { get; } - - public HttpContextServiceScopeFactory( - IHttpContextAccessor httpContextAccessor, - IServiceScopeFactory serviceScopeFactory) - { - HttpContextAccessor = httpContextAccessor; - ServiceScopeFactory = serviceScopeFactory; - } - - public virtual IServiceScope CreateScope() - { - var httpContext = HttpContextAccessor.HttpContext; - if (httpContext == null) - { - return ServiceScopeFactory.CreateScope(); - } - - return new NonDisposedHttpContextServiceScope(httpContext.RequestServices); - } - - protected class NonDisposedHttpContextServiceScope : IServiceScope - { - public IServiceProvider ServiceProvider { get; } - - public NonDisposedHttpContextServiceScope(IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - } - - public void Dispose() - { - - } - } -} diff --git a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs index be59ea0431..a7be0c29a1 100644 --- a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs +++ b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs @@ -10,7 +10,7 @@ public interface IDeletionAuditedObject : IHasDeletionTime /// /// Id of the deleter user. /// - Guid? DeleterId { get; set; } + Guid? DeleterId { get; } } /// @@ -22,5 +22,5 @@ public interface IDeletionAuditedObject : IDeletionAuditedObject /// /// Reference to the deleter user. /// - TUser Deleter { get; set; } + TUser Deleter { get; } } diff --git a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs index a84fc78c41..ef45b1b057 100644 --- a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs +++ b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasDeletionTime.cs @@ -11,5 +11,5 @@ public interface IHasDeletionTime : ISoftDelete /// /// Deletion time. /// - DateTime? DeletionTime { get; set; } + DateTime? DeletionTime { get; } } diff --git a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs index b7b7494081..001d07d617 100644 --- a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs +++ b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IHasModificationTime.cs @@ -10,5 +10,5 @@ public interface IHasModificationTime /// /// The last modified time for this entity. /// - DateTime? LastModificationTime { get; set; } + DateTime? LastModificationTime { get; } } diff --git a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs index 5ba4fd1e02..48f26b6299 100644 --- a/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs +++ b/framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs @@ -10,7 +10,7 @@ public interface IModificationAuditedObject : IHasModificationTime /// /// Last modifier user for this entity. /// - Guid? LastModifierId { get; set; } + Guid? LastModifierId { get; } } /// @@ -22,5 +22,5 @@ public interface IModificationAuditedObject : IModificationAuditedObject /// /// Reference to the last modifier user of this entity. /// - TUser LastModifier { get; set; } + TUser LastModifier { get; } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs index bb3f104ce4..b6527f10c8 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs @@ -1,4 +1,6 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Data; using Volo.Abp.Json; using Volo.Abp.Modularity; @@ -24,4 +26,17 @@ public class AbpAuditingModule : AbpModule { context.Services.OnRegistred(AuditingInterceptorRegistrar.RegisterIfNeeded); } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var applicationName = context.Services.GetApplicationName(); + + if (!applicationName.IsNullOrEmpty()) + { + Configure(options => + { + options.ApplicationName = applicationName; + }); + } + } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs index b3c6aeb051..441cd8ef23 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingOptions.cs @@ -37,6 +37,12 @@ public class AbpAuditingOptions /// Default: true. /// public bool AlwaysLogOnException { get; set; } + + /// + /// Disables/enables audit logging for integration services. + /// Default: false. + /// + public bool IsEnabledForIntegrationServices { get; set; } public List>> AlwaysLogSelectors { get; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs index d85bad82eb..16632420d7 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs @@ -99,7 +99,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency { if (targetObject is IHasModificationTime objectWithModificationTime) { - objectWithModificationTime.LastModificationTime = Clock.Now; + ObjectHelper.TrySetProperty(objectWithModificationTime, x => x.LastModificationTime, () => Clock.Now); } } @@ -112,7 +112,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency if (!CurrentUser.Id.HasValue) { - modificationAuditedObject.LastModifierId = null; + ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => null); return; } @@ -120,7 +120,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency { if (multiTenantEntity.TenantId != CurrentUser.TenantId) { - modificationAuditedObject.LastModifierId = null; + ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => null); return; } } @@ -134,7 +134,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency } */ - modificationAuditedObject.LastModifierId = CurrentUser.Id; + ObjectHelper.TrySetProperty(modificationAuditedObject, x => x.LastModifierId, () => CurrentUser.Id); } protected virtual void SetDeletionTime(object targetObject) @@ -143,7 +143,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency { if (objectWithDeletionTime.DeletionTime == null) { - objectWithDeletionTime.DeletionTime = Clock.Now; + ObjectHelper.TrySetProperty(objectWithDeletionTime, x => x.DeletionTime, () => Clock.Now); } } } @@ -162,7 +162,7 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency if (!CurrentUser.Id.HasValue) { - deletionAuditedObject.DeleterId = null; + ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => null); return; } @@ -170,11 +170,11 @@ public class AuditPropertySetter : IAuditPropertySetter, ITransientDependency { if (multiTenantEntity.TenantId != CurrentUser.TenantId) { - deletionAuditedObject.DeleterId = null; + ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => null); return; } } - deletionAuditedObject.DeleterId = CurrentUser.Id; + ObjectHelper.TrySetProperty(deletionAuditedObject, x => x.DeleterId, () => CurrentUser.Id); } } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs index 1f3c6b433c..7468f10986 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs @@ -52,7 +52,7 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency CorrelationIdProvider = correlationIdProvider; } - public virtual bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false) + public virtual bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false, bool ignoreIntegrationServiceAttribute = false) { if (methodInfo == null) { @@ -77,7 +77,7 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency var classType = methodInfo.DeclaringType; if (classType != null) { - var shouldAudit = AuditingInterceptorRegistrar.ShouldAuditTypeByDefaultOrNull(classType); + var shouldAudit = AuditingInterceptorRegistrar.ShouldAuditTypeByDefaultOrNull(classType, ignoreIntegrationServiceAttribute); if (shouldAudit != null) { return shouldAudit.Value; diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs index 63c38ef3c3..78de793b6c 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs @@ -62,7 +62,9 @@ public class AuditingInterceptor : AbpInterceptor, ITransientDependency return false; } - if (!auditingHelper.ShouldSaveAudit(invocation.Method)) + if (!auditingHelper.ShouldSaveAudit( + invocation.Method, + ignoreIntegrationServiceAttribute: options.IsEnabledForIntegrationServices)) { return false; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs index 45af44ef91..db5d44cec5 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs @@ -22,7 +22,7 @@ public static class AuditingInterceptorRegistrar return false; } - if (ShouldAuditTypeByDefaultOrNull(type) == true) + if (ShouldAuditTypeByDefaultOrNull(type, ignoreIntegrationServiceAttribute: true) == true) { return true; } @@ -36,7 +36,7 @@ public static class AuditingInterceptorRegistrar } //TODO: Move to a better place - public static bool? ShouldAuditTypeByDefaultOrNull(Type type) + public static bool? ShouldAuditTypeByDefaultOrNull(Type type, bool ignoreIntegrationServiceAttribute) { //TODO: In an inheritance chain, it would be better to check the attributes on the top class first. @@ -52,7 +52,10 @@ public static class AuditingInterceptorRegistrar if (typeof(IAuditingEnabled).IsAssignableFrom(type)) { - return true; + if (ignoreIntegrationServiceAttribute || !type.IsDefined(typeof(IntegrationServiceAttribute), true)) + { + return true; + } } return null; diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityPropertyChangeInfo.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityPropertyChangeInfo.cs index f6e1b76cd7..5e92f6622e 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityPropertyChangeInfo.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityPropertyChangeInfo.cs @@ -9,19 +9,19 @@ public class EntityPropertyChangeInfo /// Maximum length of property. /// Value: 96. /// - public const int MaxPropertyNameLength = 96; + public static int MaxPropertyNameLength = 96; /// /// Maximum length of and properties. /// Value: 512. /// - public const int MaxValueLength = 512; + public static int MaxValueLength = 512; /// /// Maximum length of property. /// Value: 512. /// - public const int MaxPropertyTypeFullNameLength = 192; + public static int MaxPropertyTypeFullNameLength = 192; public virtual string NewValue { get; set; } diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingHelper.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingHelper.cs index 915d2fcfc1..5a2878d1b0 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingHelper.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/IAuditingHelper.cs @@ -7,7 +7,7 @@ namespace Volo.Abp.Auditing; //TODO: Move ShouldSaveAudit & IsEntityHistoryEnabled and rename to IAuditingFactory public interface IAuditingHelper { - bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false); + bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false, bool ignoreIntegrationServiceAttribute = false); bool IsEntityHistoryEnabled(Type entityType, bool defaultValue = false); diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/AbpPermissionOptions.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/AbpPermissionOptions.cs index 17ff28798e..4bdd7c0bb8 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/AbpPermissionOptions.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/AbpPermissionOptions.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Collections; +using System.Collections.Generic; +using Volo.Abp.Collections; namespace Volo.Abp.Authorization.Permissions; @@ -8,9 +9,16 @@ public class AbpPermissionOptions public ITypeList ValueProviders { get; } + public HashSet DeletedPermissions { get; } + + public HashSet DeletedPermissionGroups { get; } + public AbpPermissionOptions() { DefinitionProviders = new TypeList(); ValueProviders = new TypeList(); + + DeletedPermissions = new HashSet(); + DeletedPermissionGroups = new HashSet(); } } diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/ICanAddChildPermission.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/ICanAddChildPermission.cs new file mode 100644 index 0000000000..57a224699f --- /dev/null +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/ICanAddChildPermission.cs @@ -0,0 +1,14 @@ +using JetBrains.Annotations; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.Authorization.Permissions; + +public interface ICanAddChildPermission +{ + PermissionDefinition AddPermission( + [NotNull] string name, + ILocalizableString displayName = null, + MultiTenancySides multiTenancySide = MultiTenancySides.Both, + bool isEnabled = true); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs index 6d1f9a31fd..411b030b6a 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionContext.cs @@ -37,8 +37,7 @@ public interface IPermissionDefinitionContext /// PermissionGroupDefinition AddGroup( [NotNull] string name, - ILocalizableString displayName = null, - MultiTenancySides multiTenancySide = MultiTenancySides.Both); + ILocalizableString displayName = null); /// /// Tries to remove a permission group. diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManager.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManager.cs index 553148671c..b4628a15bc 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManager.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManager.cs @@ -1,17 +1,18 @@ using System.Collections.Generic; +using System.Threading.Tasks; using JetBrains.Annotations; namespace Volo.Abp.Authorization.Permissions; public interface IPermissionDefinitionManager { - [NotNull] - PermissionDefinition Get([NotNull] string name); + [ItemNotNull] + Task GetAsync([NotNull] string name); - [CanBeNull] - PermissionDefinition GetOrNull([NotNull] string name); + [ItemCanBeNull] + Task GetOrNullAsync([NotNull] string name); - IReadOnlyList GetPermissions(); + Task> GetPermissionsAsync(); - IReadOnlyList GetGroups(); + Task> GetGroupsAsync(); } diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs index 75d463f30f..fb6f07690c 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs @@ -7,7 +7,9 @@ using Volo.Abp.SimpleStateChecking; namespace Volo.Abp.Authorization.Permissions; -public class PermissionDefinition : IHasSimpleStateCheckers +public class PermissionDefinition : + IHasSimpleStateCheckers, + ICanAddChildPermission { /// /// Unique name of the permission. @@ -110,6 +112,16 @@ public class PermissionDefinition : IHasSimpleStateCheckers /// Sets a property in the dictionary. diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs index 7a10fe4b5e..5b5543e868 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionDefinitionContext.cs @@ -20,8 +20,7 @@ public class PermissionDefinitionContext : IPermissionDefinitionContext public virtual PermissionGroupDefinition AddGroup( string name, - ILocalizableString displayName = null, - MultiTenancySides multiTenancySide = MultiTenancySides.Both) + ILocalizableString displayName = null) { Check.NotNull(name, nameof(name)); @@ -30,7 +29,7 @@ public class PermissionDefinitionContext : IPermissionDefinitionContext throw new AbpException($"There is already an existing permission group with name: {name}"); } - return Groups[name] = new PermissionGroupDefinition(name, displayName, multiTenancySide); + return Groups[name] = new PermissionGroupDefinition(name, displayName); } [NotNull] diff --git a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs index d2efedc0d9..9fd904f54c 100644 --- a/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs +++ b/framework/src/Volo.Abp.Authorization.Abstractions/Volo/Abp/Authorization/Permissions/PermissionGroupDefinition.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.Authorization.Permissions; -public class PermissionGroupDefinition //TODO: Consider to make possible a group have sub groups +public class PermissionGroupDefinition : ICanAddChildPermission { /// /// Unique name of the group. @@ -21,12 +21,6 @@ public class PermissionGroupDefinition //TODO: Consider to make possible a group } private ILocalizableString _displayName; - /// - /// MultiTenancy side. - /// Default: - /// - public MultiTenancySides MultiTenancySide { get; set; } - public IReadOnlyList Permissions => _permissions.ToImmutableList(); private readonly List _permissions; @@ -45,19 +39,17 @@ public class PermissionGroupDefinition //TODO: Consider to make possible a group protected internal PermissionGroupDefinition( string name, - ILocalizableString displayName = null, - MultiTenancySides multiTenancySide = MultiTenancySides.Both) + ILocalizableString displayName = null) { Name = name; DisplayName = displayName ?? new FixedLocalizableString(Name); - MultiTenancySide = multiTenancySide; Properties = new Dictionary(); _permissions = new List(); } public virtual PermissionDefinition AddPermission( - string name, + [NotNull] string name, ILocalizableString displayName = null, MultiTenancySides multiTenancySide = MultiTenancySides.Both, bool isEnabled = true) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs index 01037f3e96..fb37427c48 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationPolicyProvider.cs @@ -31,7 +31,7 @@ public class AbpAuthorizationPolicyProvider : DefaultAuthorizationPolicyProvider return policy; } - var permission = _permissionDefinitionManager.GetOrNull(policyName); + var permission = await _permissionDefinitionManager.GetOrNullAsync(policyName); if (permission != null) { //TODO: Optimize & Cache! @@ -43,16 +43,14 @@ public class AbpAuthorizationPolicyProvider : DefaultAuthorizationPolicyProvider return null; } - public Task> GetPoliciesNamesAsync() + public async Task> GetPoliciesNamesAsync() { - return Task.FromResult( - _options.GetPoliciesNames() - .Union( - _permissionDefinitionManager - .GetPermissions() - .Select(p => p.Name) - ) - .ToList() - ); + return _options.GetPoliciesNames() + .Union( + (await _permissionDefinitionManager + .GetPermissionsAsync()) + .Select(p => p.Name) + ) + .ToList(); } } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/AuthenticatedSimpleStateCheckerSerializerContributor.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/AuthenticatedSimpleStateCheckerSerializerContributor.cs new file mode 100644 index 0000000000..2a23b5bfcd --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/AuthenticatedSimpleStateCheckerSerializerContributor.cs @@ -0,0 +1,38 @@ +using System.Text.Json.Nodes; +using Volo.Abp.DependencyInjection; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.Authorization.Permissions; + +public class AuthenticatedSimpleStateCheckerSerializerContributor : + ISimpleStateCheckerSerializerContributor, + ISingletonDependency +{ + public const string CheckerShortName = "A"; + + public string SerializeToJson(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers + { + if (checker is not RequireAuthenticatedSimpleStateChecker) + { + return null; + } + + var jsonObject = new JsonObject { + ["T"] = CheckerShortName + }; + + return jsonObject.ToJsonString(); + } + + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers + { + if (jsonObject["T"]?.ToString() != CheckerShortName) + { + return null; + } + + return new RequireAuthenticatedSimpleStateChecker(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IDynamicPermissionDefinitionStore.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IDynamicPermissionDefinitionStore.cs new file mode 100644 index 0000000000..ad74dae46b --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IDynamicPermissionDefinitionStore.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Volo.Abp.Authorization.Permissions; + +public interface IDynamicPermissionDefinitionStore +{ + Task GetOrNullAsync(string name); + + Task> GetPermissionsAsync(); + + Task> GetGroupsAsync(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IStaticPermissionDefinitionStore.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IStaticPermissionDefinitionStore.cs new file mode 100644 index 0000000000..719412e4db --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/IStaticPermissionDefinitionStore.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Volo.Abp.Authorization.Permissions; + +public interface IStaticPermissionDefinitionStore +{ + Task GetOrNullAsync(string name); + + Task> GetPermissionsAsync(); + + Task> GetGroupsAsync(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/NullDynamicPermissionDefinitionStore.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/NullDynamicPermissionDefinitionStore.cs new file mode 100644 index 0000000000..61e70b057c --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/NullDynamicPermissionDefinitionStore.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Authorization.Permissions; + +public class NullDynamicPermissionDefinitionStore : IDynamicPermissionDefinitionStore, ISingletonDependency +{ + private readonly static Task CachedPermissionResult = Task.FromResult((PermissionDefinition)null); + + private readonly static Task> CachedPermissionsResult = + Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); + + private readonly static Task> CachedGroupsResult = + Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); + + public Task GetOrNullAsync(string name) + { + return CachedPermissionResult; + } + + public Task> GetPermissionsAsync() + { + return CachedPermissionsResult; + } + + public Task> GetGroupsAsync() + { + return CachedGroupsResult; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs index fec8771afa..168eb3064b 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionChecker.cs @@ -43,8 +43,12 @@ public class PermissionChecker : IPermissionChecker, ITransientDependency { Check.NotNull(name, nameof(name)); - var permission = PermissionDefinitionManager.Get(name); - + var permission = await PermissionDefinitionManager.GetOrNullAsync(name); + if (permission == null) + { + return false; + } + if (!permission.IsEnabled) { return false; @@ -97,18 +101,24 @@ public class PermissionChecker : IPermissionChecker, ITransientDependency { Check.NotNull(names, nameof(names)); - var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() ?? CurrentTenant.GetMultiTenancySide(); - var result = new MultiplePermissionGrantResult(); if (!names.Any()) { return result; } + var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() ?? + CurrentTenant.GetMultiTenancySide(); + var permissionDefinitions = new List(); foreach (var name in names) { - var permission = PermissionDefinitionManager.Get(name); + var permission = await PermissionDefinitionManager.GetOrNullAsync(name); + if (permission == null) + { + result.Result.Add(name, PermissionGrantResult.Prohibited); + continue; + } result.Result.Add(name, PermissionGrantResult.Undefined); diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinitionManager.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinitionManager.cs index 7f4de3c767..de24ff59c5 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinitionManager.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinitionManager.cs @@ -1,47 +1,27 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Authorization.Permissions; -public class PermissionDefinitionManager : IPermissionDefinitionManager, ISingletonDependency +public class PermissionDefinitionManager : IPermissionDefinitionManager, ITransientDependency { - protected IDictionary PermissionGroupDefinitions => _lazyPermissionGroupDefinitions.Value; - private readonly Lazy> _lazyPermissionGroupDefinitions; - - protected IDictionary PermissionDefinitions => _lazyPermissionDefinitions.Value; - private readonly Lazy> _lazyPermissionDefinitions; - - protected AbpPermissionOptions Options { get; } - - private readonly IServiceProvider _serviceProvider; + private readonly IStaticPermissionDefinitionStore _staticStore; + private readonly IDynamicPermissionDefinitionStore _dynamicStore; public PermissionDefinitionManager( - IOptions options, - IServiceProvider serviceProvider) + IStaticPermissionDefinitionStore staticStore, + IDynamicPermissionDefinitionStore dynamicStore) { - _serviceProvider = serviceProvider; - Options = options.Value; - - _lazyPermissionDefinitions = new Lazy>( - CreatePermissionDefinitions, - isThreadSafe: true - ); - - _lazyPermissionGroupDefinitions = new Lazy>( - CreatePermissionGroupDefinitions, - isThreadSafe: true - ); + _staticStore = staticStore; + _dynamicStore = dynamicStore; } - public virtual PermissionDefinition Get(string name) + public virtual async Task GetAsync(string name) { - var permission = GetOrNull(name); - + var permission = await GetOrNullAsync(name); if (permission == null) { throw new AbpException("Undefined permission: " + name); @@ -50,82 +30,41 @@ public class PermissionDefinitionManager : IPermissionDefinitionManager, ISingle return permission; } - public virtual PermissionDefinition GetOrNull(string name) + public virtual async Task GetOrNullAsync(string name) { Check.NotNull(name, nameof(name)); - return PermissionDefinitions.GetOrDefault(name); - } - - public virtual IReadOnlyList GetPermissions() - { - return PermissionDefinitions.Values.ToImmutableList(); - } - - public IReadOnlyList GetGroups() - { - return PermissionGroupDefinitions.Values.ToImmutableList(); - } - - protected virtual Dictionary CreatePermissionDefinitions() - { - var permissions = new Dictionary(); - - foreach (var groupDefinition in PermissionGroupDefinitions.Values) - { - foreach (var permission in groupDefinition.Permissions) - { - AddPermissionToDictionaryRecursively(permissions, permission); - } - } - - return permissions; + return await _staticStore.GetOrNullAsync(name) ?? + await _dynamicStore.GetOrNullAsync(name); } - protected virtual void AddPermissionToDictionaryRecursively( - Dictionary permissions, - PermissionDefinition permission) + public virtual async Task> GetPermissionsAsync() { - if (permissions.ContainsKey(permission.Name)) - { - throw new AbpException("Duplicate permission name: " + permission.Name); - } - - permissions[permission.Name] = permission; - - foreach (var child in permission.Children) - { - AddPermissionToDictionaryRecursively(permissions, child); - } + var staticPermissions = await _staticStore.GetPermissionsAsync(); + var staticPermissionNames = staticPermissions + .Select(p => p.Name) + .ToImmutableHashSet(); + + var dynamicPermissions = await _dynamicStore.GetPermissionsAsync(); + + /* We prefer static permissions over dynamics */ + return staticPermissions.Concat( + dynamicPermissions.Where(d => !staticPermissionNames.Contains(d.Name)) + ).ToImmutableList(); } - protected virtual Dictionary CreatePermissionGroupDefinitions() + public async Task> GetGroupsAsync() { - using (var scope = _serviceProvider.CreateScope()) - { - var context = new PermissionDefinitionContext(scope.ServiceProvider); - - var providers = Options - .DefinitionProviders - .Select(p => scope.ServiceProvider.GetRequiredService(p) as IPermissionDefinitionProvider) - .ToList(); - - foreach (var provider in providers) - { - provider.PreDefine(context); - } - - foreach (var provider in providers) - { - provider.Define(context); - } - - foreach (var provider in providers) - { - provider.PostDefine(context); - } - - return context.Groups; - } + var staticGroups = await _staticStore.GetGroupsAsync(); + var staticGroupNames = staticGroups + .Select(p => p.Name) + .ToImmutableHashSet(); + + var dynamicGroups = await _dynamicStore.GetGroupsAsync(); + + /* We prefer static groups over dynamics */ + return staticGroups.Concat( + dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name)) + ).ToImmutableList(); } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionsSimpleStateCheckerSerializerContributor.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionsSimpleStateCheckerSerializerContributor.cs new file mode 100644 index 0000000000..3b890797f6 --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionsSimpleStateCheckerSerializerContributor.cs @@ -0,0 +1,62 @@ +using System.Linq; +using System.Text.Json.Nodes; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.DependencyInjection; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.GlobalFeatures; + +public class PermissionsSimpleStateCheckerSerializerContributor : + ISimpleStateCheckerSerializerContributor, + ISingletonDependency +{ + public const string CheckerShortName = "P"; + + public string SerializeToJson(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers + { + if (checker is not RequirePermissionsSimpleStateChecker permissionsSimpleStateChecker) + { + return null; + } + + var jsonObject = new JsonObject { + ["T"] = CheckerShortName, + ["A"] = permissionsSimpleStateChecker.RequiresAll + }; + + var nameArray = new JsonArray(); + foreach (var permissionName in permissionsSimpleStateChecker.PermissionNames) + { + nameArray.Add(permissionName); + } + + jsonObject["N"] = nameArray; + return jsonObject.ToJsonString(); + } + + public ISimpleStateChecker Deserialize( + JsonObject jsonObject, + TState state) + where TState : IHasSimpleStateCheckers + { + if (jsonObject["T"]?.ToString() != CheckerShortName) + { + return null; + } + + var nameArray = jsonObject["N"] as JsonArray; + if (nameArray == null) + { + throw new AbpException("'N' is not an array in the serialized state checker! JsonObject: " + jsonObject.ToJsonString()); + } + + return new RequirePermissionsSimpleStateChecker( + new RequirePermissionsSimpleBatchStateCheckerModel( + state, + nameArray.Select(x => x.ToString()).ToArray(), + (bool?)jsonObject["A"] ?? false + ) + ); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleStateChecker.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleStateChecker.cs index 3ae1809b55..fd8eef3791 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleStateChecker.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/RequirePermissionsSimpleStateChecker.cs @@ -8,6 +8,10 @@ namespace Volo.Abp.Authorization.Permissions; public class RequirePermissionsSimpleStateChecker : ISimpleStateChecker where TState : IHasSimpleStateCheckers { + public bool RequiresAll => _model.RequiresAll; + + public string[] PermissionNames => _model.Permissions; + private readonly RequirePermissionsSimpleBatchStateCheckerModel _model; public RequirePermissionsSimpleStateChecker(RequirePermissionsSimpleBatchStateCheckerModel model) diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs new file mode 100644 index 0000000000..ee4803d61e --- /dev/null +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/StaticPermissionDefinitionStore.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Authorization.Permissions; + +public class StaticPermissionDefinitionStore : IStaticPermissionDefinitionStore, ISingletonDependency +{ + protected IDictionary PermissionGroupDefinitions => _lazyPermissionGroupDefinitions.Value; + private readonly Lazy> _lazyPermissionGroupDefinitions; + + protected IDictionary PermissionDefinitions => _lazyPermissionDefinitions.Value; + private readonly Lazy> _lazyPermissionDefinitions; + + protected AbpPermissionOptions Options { get; } + + private readonly IServiceProvider _serviceProvider; + + public StaticPermissionDefinitionStore( + IServiceProvider serviceProvider, + IOptions options) + { + _serviceProvider = serviceProvider; + Options = options.Value; + + _lazyPermissionDefinitions = new Lazy>( + CreatePermissionDefinitions, + isThreadSafe: true + ); + + _lazyPermissionGroupDefinitions = new Lazy>( + CreatePermissionGroupDefinitions, + isThreadSafe: true + ); + } + + protected virtual Dictionary CreatePermissionDefinitions() + { + var permissions = new Dictionary(); + + foreach (var groupDefinition in PermissionGroupDefinitions.Values) + { + foreach (var permission in groupDefinition.Permissions) + { + AddPermissionToDictionaryRecursively(permissions, permission); + } + } + + return permissions; + } + + protected virtual void AddPermissionToDictionaryRecursively( + Dictionary permissions, + PermissionDefinition permission) + { + if (permissions.ContainsKey(permission.Name)) + { + throw new AbpException("Duplicate permission name: " + permission.Name); + } + + permissions[permission.Name] = permission; + + foreach (var child in permission.Children) + { + AddPermissionToDictionaryRecursively(permissions, child); + } + } + + protected virtual Dictionary CreatePermissionGroupDefinitions() + { + using (var scope = _serviceProvider.CreateScope()) + { + var context = new PermissionDefinitionContext(scope.ServiceProvider); + + var providers = Options + .DefinitionProviders + .Select(p => scope.ServiceProvider.GetRequiredService(p) as IPermissionDefinitionProvider) + .ToList(); + + foreach (var provider in providers) + { + provider.PreDefine(context); + } + + foreach (var provider in providers) + { + provider.Define(context); + } + + foreach (var provider in providers) + { + provider.PostDefine(context); + } + + return context.Groups; + } + } + + public Task GetOrNullAsync(string name) + { + return Task.FromResult(PermissionDefinitions.GetOrDefault(name)); + } + + public virtual Task> GetPermissionsAsync() + { + return Task.FromResult>( + PermissionDefinitions.Values.ToImmutableList() + ); + } + + public Task> GetGroupsAsync() + { + return Task.FromResult>( + PermissionGroupDefinitions.Values.ToImmutableList() + ); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs b/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs index 868ecb3fa5..03084d8351 100644 --- a/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs +++ b/framework/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Autofac.Core; using Autofac.Extras.DynamicProxy; +using Volo.Abp.Autofac; using Volo.Abp.Castle.DynamicProxy; using Volo.Abp.DependencyInjection; using Volo.Abp.Modularity; @@ -67,10 +68,11 @@ public static class AbpRegistrationBuilderExtensions Type implementationType) where TActivatorData : ReflectionActivatorData { - //Enable Property Injection only for types in an assembly containing an AbpModule - if (moduleContainer.Modules.Any(m => m.Assembly == implementationType.Assembly)) + // Enable Property Injection only for types in an assembly containing an AbpModule and without a DisablePropertyInjection attribute on class or properties. + if (moduleContainer.Modules.Any(m => m.Assembly == implementationType.Assembly) && + implementationType.GetCustomAttributes(typeof(DisablePropertyInjectionAttribute), true).IsNullOrEmpty()) { - registrationBuilder = registrationBuilder.PropertiesAutowired(); + registrationBuilder = registrationBuilder.PropertiesAutowired(new AbpPropertySelector(false)); } return registrationBuilder; diff --git a/framework/src/Volo.Abp.Autofac/Volo/Abp/Autofac/AbpPropertySelector.cs b/framework/src/Volo.Abp.Autofac/Volo/Abp/Autofac/AbpPropertySelector.cs new file mode 100644 index 0000000000..00d20e9bca --- /dev/null +++ b/framework/src/Volo.Abp.Autofac/Volo/Abp/Autofac/AbpPropertySelector.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.Reflection; +using Autofac.Core; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Autofac; + +public class AbpPropertySelector : DefaultPropertySelector +{ + public AbpPropertySelector(bool preserveSetValues) + : base(preserveSetValues) + { + } + + public override bool InjectProperty(PropertyInfo propertyInfo, object instance) + { + return propertyInfo.GetCustomAttributes(typeof(DisablePropertyInjectionAttribute), true).IsNullOrEmpty() && + base.InjectProperty(propertyInfo, instance); + } + +} diff --git a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs index 2ebad0797f..2583ada9fc 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs @@ -1,6 +1,9 @@ using System; +using System.Reflection; using System.Threading.Tasks; using Hangfire; +using Hangfire.States; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; namespace Volo.Abp.BackgroundJobs.Hangfire; @@ -8,16 +11,35 @@ namespace Volo.Abp.BackgroundJobs.Hangfire; [Dependency(ReplaceServices = true)] public class HangfireBackgroundJobManager : IBackgroundJobManager, ITransientDependency { + protected AbpBackgroundJobOptions Options { get; } + + public HangfireBackgroundJobManager(IOptions options) + { + Options = options.Value; + } + public virtual Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null) { return Task.FromResult(delay.HasValue ? BackgroundJob.Schedule>( - adapter => adapter.ExecuteAsync(args), + adapter => adapter.ExecuteAsync(GetQueueName(typeof(TArgs)),args), delay.Value ) : BackgroundJob.Enqueue>( - adapter => adapter.ExecuteAsync(args) + adapter => adapter.ExecuteAsync(GetQueueName(typeof(TArgs)) ,args) )); } + + protected virtual string GetQueueName(Type argsType) + { + var queueName = EnqueuedState.DefaultQueue; + var queueAttribute = Options.GetJob(argsType).JobType.GetCustomAttribute(); + if (queueAttribute != null) + { + queueName = queueAttribute.Queue; + } + + return queueName; + } } diff --git a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs index a2ad7dc77d..7ba0cd7db4 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Hangfire; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -20,7 +21,8 @@ public class HangfireJobExecutionAdapter Options = options.Value; } - public async Task ExecuteAsync(TArgs args) + [Queue("{0}")] + public async Task ExecuteAsync(string queue, TArgs args) { if (!Options.IsJobExecutionEnabled) { diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs index 83efe8ff31..540d848412 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpRabbitMqBackgroundJobOptions.cs @@ -19,6 +19,8 @@ public class AbpRabbitMqBackgroundJobOptions /// Default value: "AbpBackgroundJobsDelayed." /// public string DefaultDelayedQueueNamePrefix { get; set; } + + public ushort? PrefetchCount { get; set; } public AbpRabbitMqBackgroundJobOptions() { diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs index 208d7ecd9f..9c3bf26e62 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueue.cs @@ -66,7 +66,8 @@ public class JobQueue : IJobQueue new JobQueueConfiguration( typeof(TArgs), AbpRabbitMqBackgroundJobOptions.DefaultQueueNamePrefix + JobConfiguration.JobName, - AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName + AbpRabbitMqBackgroundJobOptions.DefaultDelayedQueueNamePrefix + JobConfiguration.JobName, + prefetchCount: AbpRabbitMqBackgroundJobOptions.PrefetchCount ); } @@ -140,9 +141,14 @@ public class JobQueue : IJobQueue if (AbpBackgroundJobOptions.IsJobExecutionEnabled) { + if (QueueConfiguration.PrefetchCount.HasValue) + { + ChannelAccessor.Channel.BasicQos(0, QueueConfiguration.PrefetchCount.Value, false); + } + Consumer = new AsyncEventingBasicConsumer(ChannelAccessor.Channel); Consumer.Received += MessageReceived; - + //TODO: What BasicConsume returns? ChannelAccessor.Channel.BasicConsume( queue: QueueConfiguration.QueueName, diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs index 792eb9815e..ee706ab864 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueConfiguration.cs @@ -20,12 +20,14 @@ public class JobQueueConfiguration : QueueDeclareConfiguration string connectionName = null, bool durable = true, bool exclusive = false, - bool autoDelete = false) + bool autoDelete = false, + ushort? prefetchCount = null) : base( queueName, durable, exclusive, - autoDelete) + autoDelete, + prefetchCount) { JobArgsType = jobArgsType; ConnectionName = connectionName; diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs index 6c09a80f73..08cc66130c 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Data; using Volo.Abp.DistributedLocking; using Volo.Abp.Guids; using Volo.Abp.Modularity; @@ -19,10 +20,20 @@ namespace Volo.Abp.BackgroundJobs; )] public class AbpBackgroundJobsModule : AbpModule { - public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) { - var options = context.ServiceProvider.GetRequiredService>().Value; - if (options.IsJobExecutionEnabled) + if (context.Services.IsDataMigrationEnvironment()) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + } + } + + public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + if (context.ServiceProvider.GetRequiredService>().Value.IsJobExecutionEnabled) { await context.AddBackgroundWorkerAsync(); } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs index a1a079fe27..359ea1a422 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs @@ -5,6 +5,7 @@ using Blazorise.Snackbar; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Localization; using Volo.Abp.AspNetCore.Components.Notifications; +using Volo.Abp.Localization; namespace Volo.Abp.BlazoriseUI.Components; @@ -54,13 +55,15 @@ public partial class UiNotificationAlert : ComponentBase, IDisposable Title = e.Title; Options = e.Options; - var okButtonText = Options?.OkButtonText?.Localize(StringLocalizerFactory); + var okButtonText = Options?.OkButtonText == null + ? null + : await Options.OkButtonText.LocalizeAsync(StringLocalizerFactory); await SnackbarStack.PushAsync(Message, Title, GetSnackbarColor(e.NotificationType), (options) => - { - options.CloseButtonIcon = IconName.Times; - options.ActionButtonText = okButtonText; - }); + { + options.CloseButtonIcon = IconName.Times; + options.ActionButtonText = okButtonText; + }); } public virtual void Dispose() diff --git a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs index d52a40e5b5..68a59aab2d 100644 --- a/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs +++ b/framework/src/Volo.Abp.Caching.StackExchangeRedis/Volo/Abp/Caching/StackExchangeRedis/AbpRedisCache.cs @@ -15,18 +15,18 @@ namespace Volo.Abp.Caching.StackExchangeRedis; [DisableConventionalRegistration] public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems { - protected static readonly string SetScript; protected static readonly string AbsoluteExpirationKey; protected static readonly string SlidingExpirationKey; protected static readonly string DataKey; protected static readonly long NotPresent; - private static readonly FieldInfo RedisDatabaseField; - private static readonly MethodInfo ConnectMethod; - private static readonly MethodInfo ConnectAsyncMethod; - private static readonly MethodInfo MapMetadataMethod; - private static readonly MethodInfo GetAbsoluteExpirationMethod; - private static readonly MethodInfo GetExpirationInSecondsMethod; + private readonly static FieldInfo SetScriptField; + private readonly static FieldInfo RedisDatabaseField; + private readonly static MethodInfo ConnectMethod; + private readonly static MethodInfo ConnectAsyncMethod; + private readonly static MethodInfo MapMetadataMethod; + private readonly static MethodInfo GetAbsoluteExpirationMethod; + private readonly static MethodInfo GetExpirationInSecondsMethod; protected IDatabase RedisDatabase => GetRedisDatabase(); private IDatabase _redisDatabase; @@ -36,9 +36,11 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems static AbpRedisCache() { var type = typeof(RedisCache); - + RedisDatabaseField = type.GetField("_cache", BindingFlags.Instance | BindingFlags.NonPublic); + SetScriptField = type.GetField("_setScript", BindingFlags.Instance | BindingFlags.NonPublic); + ConnectMethod = type.GetMethod("Connect", BindingFlags.Instance | BindingFlags.NonPublic); ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic); @@ -51,9 +53,6 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems GetExpirationInSecondsMethod = type.GetMethod("GetExpirationInSeconds", BindingFlags.Static | BindingFlags.NonPublic); - SetScript = type.GetField("SetScript", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) - .ToString(); - AbsoluteExpirationKey = type.GetField("AbsoluteExpirationKey", BindingFlags.Static | BindingFlags.NonPublic) ?.GetValue(null).ToString(); @@ -83,14 +82,14 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems ConnectMethod.Invoke(this, Array.Empty()); } - protected virtual Task ConnectAsync(CancellationToken token = default) + protected virtual async Task ConnectAsync(CancellationToken token = default) { if (GetRedisDatabase() != null) { - return Task.CompletedTask; + return; } - return (Task)ConnectAsyncMethod.Invoke(this, new object[] { token }); + await (Task)ConnectAsyncMethod.Invoke(this, new object[] { token }); } public byte[][] GetMany( @@ -283,7 +282,7 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems for (var i = 0; i < itemArray.Length; i++) { - tasks[i] = RedisDatabase.ScriptEvaluateAsync(SetScript, new RedisKey[] { Instance + itemArray[i].Key }, + tasks[i] = RedisDatabase.ScriptEvaluateAsync(GetSetScript(), new RedisKey[] { Instance + itemArray[i].Key }, new RedisValue[] { absoluteExpiration?.Ticks ?? NotPresent, @@ -333,4 +332,9 @@ public class AbpRedisCache : RedisCache, ICacheSupportsMultipleItems return _redisDatabase; } + + private string GetSetScript() + { + return SetScriptField?.GetValue(this).ToString(); + } } diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs index c51ec76fc1..a72a369655 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs @@ -21,26 +21,115 @@ namespace Volo.Abp.Caching; /// /// The type of cache item being cached. public class DistributedCache : - DistributedCache, IDistributedCache where TCacheItem : class { - public DistributedCache( - IOptions distributedCacheOption, - IDistributedCache cache, - ICancellationTokenProvider cancellationTokenProvider, - IDistributedCacheSerializer serializer, - IDistributedCacheKeyNormalizer keyNormalizer, - IServiceScopeFactory serviceScopeFactory, - IUnitOfWorkManager unitOfWorkManager) : base( - distributedCacheOption: distributedCacheOption, - cache: cache, - cancellationTokenProvider: cancellationTokenProvider, - serializer: serializer, - keyNormalizer: keyNormalizer, - serviceScopeFactory: serviceScopeFactory, - unitOfWorkManager: unitOfWorkManager) + public IDistributedCache InternalCache { get; } + + public DistributedCache(IDistributedCache internalCache) + { + InternalCache = internalCache; + } + + public TCacheItem Get(string key, bool? hideErrors = null, bool considerUow = false) + { + return InternalCache.Get(key, hideErrors, considerUow); + } + + public KeyValuePair[] GetMany(IEnumerable keys, bool? hideErrors = null, bool considerUow = false) + { + return InternalCache.GetMany(keys, hideErrors, considerUow); + } + + public Task[]> GetManyAsync(IEnumerable keys, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.GetManyAsync(keys, hideErrors, considerUow, token); + } + + public Task GetAsync(string key, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.GetAsync(key, hideErrors, considerUow, token); + } + + public TCacheItem GetOrAdd(string key, Func factory, Func optionsFactory = null, bool? hideErrors = null, bool considerUow = false) + { + return InternalCache.GetOrAdd(key, factory, optionsFactory, hideErrors, considerUow); + } + + public Task GetOrAddAsync(string key, Func> factory, Func optionsFactory = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.GetOrAddAsync(key, factory, optionsFactory, hideErrors, considerUow, token); + } + + public KeyValuePair[] GetOrAddMany(IEnumerable keys, Func, List>> factory, Func optionsFactory = null, bool? hideErrors = null, bool considerUow = false) + { + return InternalCache.GetOrAddMany(keys, factory, optionsFactory, hideErrors, considerUow); + } + + public Task[]> GetOrAddManyAsync(IEnumerable keys, Func, Task>>> factory, Func optionsFactory = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.GetOrAddManyAsync(keys, factory, optionsFactory, hideErrors, considerUow, token); + } + + public void Set(string key, TCacheItem value, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false) + { + InternalCache.Set(key, value, options, hideErrors, considerUow); + } + + public Task SetAsync(string key, TCacheItem value, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.SetAsync(key, value, options, hideErrors, considerUow, token); + } + + public void SetMany(IEnumerable> items, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false) + { + InternalCache.SetMany(items, options, hideErrors, considerUow); + } + + public Task SetManyAsync(IEnumerable> items, DistributedCacheEntryOptions options = null, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.SetManyAsync(items, options, hideErrors, considerUow, token); + } + + public void Refresh(string key, bool? hideErrors = null) + { + InternalCache.Refresh(key, hideErrors); + } + + public Task RefreshAsync(string key, bool? hideErrors = null, CancellationToken token = default) + { + return InternalCache.RefreshAsync(key, hideErrors, token); + } + + public void RefreshMany(IEnumerable keys, bool? hideErrors = null) + { + InternalCache.RefreshMany(keys, hideErrors); + } + + public Task RefreshManyAsync(IEnumerable keys, bool? hideErrors = null, CancellationToken token = default) + { + return InternalCache.RefreshManyAsync(keys, hideErrors, token); + } + + public void Remove(string key, bool? hideErrors = null, bool considerUow = false) + { + InternalCache.Remove(key, hideErrors, considerUow); + } + + public Task RemoveAsync(string key, bool? hideErrors = null, bool considerUow = false, CancellationToken token = default) + { + return InternalCache.RemoveAsync(key, hideErrors, considerUow, token); + } + + public void RemoveMany(IEnumerable keys, bool? hideErrors = null, bool considerUow = false) + { + InternalCache.RemoveMany(keys, hideErrors, considerUow); + } + + public Task RemoveManyAsync(IEnumerable keys, bool? hideErrors = null, bool considerUow = false, + CancellationToken token = default) { + return InternalCache.RemoveManyAsync(keys, hideErrors, considerUow, token); } } diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs index 21a2842e15..ab3ca560a8 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs @@ -14,6 +14,7 @@ namespace Volo.Abp.Caching; public interface IDistributedCache : IDistributedCache where TCacheItem : class { + IDistributedCache InternalCache { get; } } /// diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliOptions.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliOptions.cs index 62a7e59d8e..3068016f33 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliOptions.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/AbpCliOptions.cs @@ -16,6 +16,8 @@ public class AbpCliOptions /// Default value: "CLI". /// public string ToolName { get; set; } = "CLI"; + + public bool AlwaysHideExternalCommandOutput { get; set; } public AbpCliOptions() { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs index c3ce0afb54..cc198e877b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs @@ -74,9 +74,9 @@ public class AuthService : IAuthService, ITransientDependency { var configuration = new IdentityClientConfiguration( CliUrls.AccountAbpIo, - "role email abpio abpio_www abpio_commercial offline_access", + "abpio offline_access", "abp-cli", - "1q2w3e*", + null, OidcConstants.GrantTypes.Password, userName, password @@ -96,9 +96,9 @@ public class AuthService : IAuthService, ITransientDependency { var configuration = new IdentityClientConfiguration( CliUrls.AccountAbpIo, - "role email abpio abpio_www abpio_commercial openid offline_access", + "abpio offline_access", "abp-cli", - "1q2w3e*", + null, OidcConstants.GrantTypes.DeviceCode ); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index bf8e2e3028..7874fddb86 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -1,4 +1,5 @@ using System.Text; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Cli.ServiceProxying; using Volo.Abp.DependencyInjection; @@ -13,7 +14,7 @@ public class GenerateProxyCommand : ProxyCommandBase public GenerateProxyCommand( IOptions serviceProxyOptions, - IHybridServiceScopeFactory serviceScopeFactory) + IServiceScopeFactory serviceScopeFactory) : base(serviceProxyOptions, serviceScopeFactory) { } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index 646d8d4c08..813900ba18 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -333,14 +333,14 @@ public abstract class ProjectCreationCommandBase var tieredYesNo = tiered ? "yes" : "no"; var url = $"https://{urlPrefix}.abp.io/project-created-success?ui={uiFramework:g}&db={databaseProvider:g}&tiered={tieredYesNo}"; - CmdHelper.OpenWebPage(url); + CmdHelper.Open(url); } protected void OpenMicroserviceDocumentPage() { var url = "https://docs.abp.io/en/commercial/latest/startup-templates/microservice/index"; - CmdHelper.OpenWebPage(url); + CmdHelper.Open(url); } protected bool GetCreateSolutionFolderPreference(CommandLineArgs commandLineArgs) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs index 22311bb986..67c61b2a28 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs @@ -2,6 +2,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; @@ -19,11 +20,11 @@ public abstract class ProxyCommandBase : IConsoleCommand, ITransientDependenc protected AbpCliServiceProxyOptions ServiceProxyOptions { get; } - protected IHybridServiceScopeFactory ServiceScopeFactory { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } public ProxyCommandBase( IOptions serviceProxyOptions, - IHybridServiceScopeFactory serviceScopeFactory) + IServiceScopeFactory serviceScopeFactory) { ServiceScopeFactory = serviceScopeFactory; ServiceProxyOptions = serviceProxyOptions.Value; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs index d89c19c892..3372584f1a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs @@ -1,4 +1,5 @@ using System.Text; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Cli.ServiceProxying; using Volo.Abp.DependencyInjection; @@ -13,7 +14,7 @@ public class RemoveProxyCommand : ProxyCommandBase public RemoveProxyCommand( IOptions serviceProxyOptions, - IHybridServiceScopeFactory serviceScopeFactory) + IServiceScopeFactory serviceScopeFactory) : base(serviceProxyOptions, serviceScopeFactory) { } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index 7f2831351a..ed90d16cfd 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -153,7 +153,7 @@ public class SolutionModuleAdder : ITransientDependency var documentationLink = module.GetFirstDocumentationLinkOrNull(); if (documentationLink != null) { - CmdHelper.OpenWebPage(documentationLink); + CmdHelper.Open(documentationLink); } return module; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs index c6325a4681..32c1acf5be 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/CmdHelper.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Cli.Utils; @@ -10,27 +11,39 @@ public class CmdHelper : ICmdHelper, ITransientDependency { private const int SuccessfulExitCode = 0; - public void OpenWebPage(string url) + protected AbpCliOptions CliOptions { get; } + + public CmdHelper(IOptionsSnapshot cliOptions) + { + CliOptions = cliOptions.Value; + } + + public void Open(string pathOrUrl) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - url = url.Replace("&", "^&"); - Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); + pathOrUrl = pathOrUrl.Replace("&", "^&"); + Process.Start(new ProcessStartInfo("cmd", $"/c start {pathOrUrl}") { CreateNoWindow = true }); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - Process.Start("xdg-open", url); + Process.Start("xdg-open", pathOrUrl); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - Process.Start("open", url); + Process.Start("open", pathOrUrl); } } - public void Run(string file, string arguments) { var procStartInfo = new ProcessStartInfo(file, arguments); + + if (CliOptions.AlwaysHideExternalCommandOutput) + { + HideNewCommandWindow(procStartInfo); + } + Process.Start(procStartInfo)?.WaitForExit(); } @@ -46,6 +59,11 @@ public class CmdHelper : ICmdHelper, ITransientDependency GetArguments(command) ); + if (CliOptions.AlwaysHideExternalCommandOutput) + { + HideNewCommandWindow(procStartInfo); + } + if (!string.IsNullOrEmpty(workingDirectory)) { procStartInfo.WorkingDirectory = workingDirectory; @@ -66,10 +84,14 @@ public class CmdHelper : ICmdHelper, ITransientDependency GetArguments(command) ); + if (CliOptions.AlwaysHideExternalCommandOutput) + { + HideNewCommandWindow(procStartInfo); + } + if (!string.IsNullOrEmpty(workingDirectory)) { procStartInfo.WorkingDirectory = workingDirectory; - procStartInfo.CreateNoWindow = false; } return Process.Start(procStartInfo); @@ -98,6 +120,7 @@ public class CmdHelper : ICmdHelper, ITransientDependency Arguments = GetArguments(command), UseShellExecute = false, CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardOutput = true, RedirectStandardError = true }; @@ -137,6 +160,11 @@ public class CmdHelper : ICmdHelper, ITransientDependency { procStartInfo.WorkingDirectory = workingDirectory; } + + if (CliOptions.AlwaysHideExternalCommandOutput) + { + HideNewCommandWindow(procStartInfo); + } Process.Start(procStartInfo); Environment.Exit(0); @@ -178,4 +206,10 @@ public class CmdHelper : ICmdHelper, ITransientDependency $"Framework: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription} | " + $"Process Architecture{System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture}"); } + + private void HideNewCommandWindow(ProcessStartInfo procStartInfo) + { + procStartInfo.WindowStyle = ProcessWindowStyle.Hidden; + procStartInfo.CreateNoWindow = true; + } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs index f96697b1cc..2f71bda7b5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ICmdHelper.cs @@ -4,7 +4,7 @@ namespace Volo.Abp.Cli.Utils; public interface ICmdHelper { - void OpenWebPage(string url); + void Open(string pathOrUrl); void Run(string file, string arguments); diff --git a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs index f922f2b7da..f9f2ca23ad 100644 --- a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs +++ b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/AbpConfigurationBuilderOptions.cs @@ -21,6 +21,16 @@ public class AbpConfigurationBuilderOptions /// public string FileName { get; set; } = "appsettings"; + /// + /// Whether the file is optional, Default value: true. + /// + public bool Optional { get; set; } = true; + + /// + /// Whether the configuration should be reloaded if the file changes, Default value: true. + /// + public bool ReloadOnChange { get; set; } = true; + /// /// Environment name. Generally used "Development", "Staging" or "Production". /// diff --git a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs index a4dfa48db8..28ea8326ac 100644 --- a/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs +++ b/framework/src/Volo.Abp.Core/Microsoft/Extensions/Configuration/ConfigurationHelper.cs @@ -9,7 +9,7 @@ public static class ConfigurationHelper AbpConfigurationBuilderOptions options = null, Action builderAction = null) { - options = options ?? new AbpConfigurationBuilderOptions(); + options ??= new AbpConfigurationBuilderOptions(); if (options.BasePath.IsNullOrEmpty()) { @@ -18,11 +18,11 @@ public static class ConfigurationHelper var builder = new ConfigurationBuilder() .SetBasePath(options.BasePath) - .AddJsonFile(options.FileName + ".json", optional: true, reloadOnChange: true); + .AddJsonFile(options.FileName + ".json", optional: options.Optional, reloadOnChange: options.ReloadOnChange); if (!options.EnvironmentName.IsNullOrEmpty()) { - builder = builder.AddJsonFile($"{options.FileName}.{options.EnvironmentName}.json", optional: true, reloadOnChange: true); + builder = builder.AddJsonFile($"{options.FileName}.{options.EnvironmentName}.json", optional: options.Optional, reloadOnChange: options.ReloadOnChange); } if (options.EnvironmentName == "Development") diff --git a/framework/src/Volo.Abp.Core/Microsoft/Extensions/DependencyInjection/ServiceCollectionApplicationExtensions.cs b/framework/src/Volo.Abp.Core/Microsoft/Extensions/DependencyInjection/ServiceCollectionApplicationExtensions.cs index ce4af2befa..72ce661ed5 100644 --- a/framework/src/Volo.Abp.Core/Microsoft/Extensions/DependencyInjection/ServiceCollectionApplicationExtensions.cs +++ b/framework/src/Volo.Abp.Core/Microsoft/Extensions/DependencyInjection/ServiceCollectionApplicationExtensions.cs @@ -39,4 +39,10 @@ public static class ServiceCollectionApplicationExtensions { return await AbpApplicationFactory.CreateAsync(startupModuleType, services, optionsAction); } + + [CanBeNull] + public static string GetApplicationName(this IServiceCollection services) + { + return services.GetSingletonInstance().ApplicationName; + } } diff --git a/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs b/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs index 2d19fa8bc2..24ece0e52e 100644 --- a/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs +++ b/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Globalization; using System.Linq; using System.Reflection; +using System.Runtime.CompilerServices; namespace System; @@ -17,6 +18,7 @@ public static class AbpObjectExtensions /// Type to be casted /// Object to cast /// Casted object + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T As(this object obj) where T : class { diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs index 741f6f0586..87ddf14c1b 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs @@ -23,6 +23,8 @@ public abstract class AbpApplicationBase : IAbpApplication public IServiceCollection Services { get; } public IReadOnlyList Modules { get; } + + public string ApplicationName { get; } private bool _configuredServices; @@ -41,8 +43,11 @@ public abstract class AbpApplicationBase : IAbpApplication var options = new AbpApplicationCreationOptions(services); optionsAction?.Invoke(options); + + ApplicationName = options.ApplicationName; services.AddSingleton(this); + services.AddSingleton(this); services.AddSingleton(this); services.AddCoreServices(); diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationCreationOptions.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationCreationOptions.cs index d18e43275b..24a1bf8ee6 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationCreationOptions.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationCreationOptions.cs @@ -20,6 +20,9 @@ public class AbpApplicationCreationOptions public AbpConfigurationBuilderOptions Configuration { get; } public bool SkipConfigureServices { get; set; } + + [CanBeNull] + public string ApplicationName { get; set; } public AbpApplicationCreationOptions([NotNull] IServiceCollection services) { diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs index 245ce6fb06..5f09157fcc 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationWithInternalServiceProvider.cs @@ -60,6 +60,6 @@ internal class AbpApplicationWithInternalServiceProvider : AbpApplicationBase, I public override void Dispose() { base.Dispose(); - ServiceScope.Dispose(); + ServiceScope?.Dispose(); } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DefaultServiceScopeFactory.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DefaultServiceScopeFactory.cs deleted file mode 100644 index befcf7951e..0000000000 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DefaultServiceScopeFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace Volo.Abp.DependencyInjection; - -[ExposeServices( - typeof(IHybridServiceScopeFactory), - typeof(DefaultServiceScopeFactory) - )] -public class DefaultServiceScopeFactory : IHybridServiceScopeFactory, ITransientDependency -{ - protected IServiceScopeFactory Factory { get; } - - public DefaultServiceScopeFactory(IServiceScopeFactory factory) - { - Factory = factory; - } - - public IServiceScope CreateScope() - { - return Factory.CreateScope(); - } -} diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DisablePropertyInjectionAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DisablePropertyInjectionAttribute.cs new file mode 100644 index 0000000000..fad0d7334a --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/DisablePropertyInjectionAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace Volo.Abp.DependencyInjection; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] +public class DisablePropertyInjectionAttribute : Attribute +{ + +} diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IHybridServiceScopeFactory.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IHybridServiceScopeFactory.cs deleted file mode 100644 index 62c3707352..0000000000 --- a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IHybridServiceScopeFactory.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace Volo.Abp.DependencyInjection; - -public interface IHybridServiceScopeFactory : IServiceScopeFactory -{ - -} diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IRootServiceProviderAccessor.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IRootServiceProviderAccessor.cs new file mode 100644 index 0000000000..8a3c1d09a5 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/IRootServiceProviderAccessor.cs @@ -0,0 +1,14 @@ +using System; + +namespace Volo.Abp.DependencyInjection; + +/// +/// The root service provider of the application. +/// Be careful to use the root service provider since there is no way +/// to release/dispose objects resolved from the root service provider. +/// So, always create a new scope if you need to resolve any service. +/// +public interface IRootServiceProvider : IServiceProvider +{ + +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/RootServiceProvider.cs b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/RootServiceProvider.cs new file mode 100644 index 0000000000..cbb6fb8984 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/RootServiceProvider.cs @@ -0,0 +1,19 @@ +using System; + +namespace Volo.Abp.DependencyInjection; + +[ExposeServices(typeof(IRootServiceProvider))] +public class RootServiceProvider : IRootServiceProvider, ISingletonDependency +{ + protected IServiceProvider ServiceProvider { get; } + + public RootServiceProvider(IObjectAccessor objectAccessor) + { + ServiceProvider = objectAccessor.Value; + } + + public virtual object GetService(Type serviceType) + { + return ServiceProvider.GetService(serviceType); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/IAbpApplication.cs b/framework/src/Volo.Abp.Core/Volo/Abp/IAbpApplication.cs index 2fb66b735f..35542ee91f 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/IAbpApplication.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/IAbpApplication.cs @@ -5,7 +5,10 @@ using Volo.Abp.Modularity; namespace Volo.Abp; -public interface IAbpApplication : IModuleContainer, IDisposable +public interface IAbpApplication : + IModuleContainer, + IApplicationNameAccessor, + IDisposable { /// /// Type of the startup (entrance) module of the application. @@ -23,7 +26,7 @@ public interface IAbpApplication : IModuleContainer, IDisposable /// This can not be used before initialize the application. /// IServiceProvider ServiceProvider { get; } - + /// /// Calls the Pre/Post/ConfigureServicesAsync methods of the modules. /// If you use this method, you must have set the @@ -40,4 +43,4 @@ public interface IAbpApplication : IModuleContainer, IDisposable /// Used to gracefully shutdown the application and all modules. /// void Shutdown(); -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/IApplicationNameAccessor.cs b/framework/src/Volo.Abp.Core/Volo/Abp/IApplicationNameAccessor.cs new file mode 100644 index 0000000000..0047fcbcdf --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/IApplicationNameAccessor.cs @@ -0,0 +1,11 @@ +namespace Volo.Abp; + +public interface IApplicationNameAccessor +{ + /// + /// Name of the application. + /// This is useful for systems with multiple applications, to distinguish + /// resources of the applications located together. + /// + string ApplicationName { get; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/IRemoteService.cs b/framework/src/Volo.Abp.Core/Volo/Abp/IRemoteService.cs index f17a0619dc..613781629c 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/IRemoteService.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/IRemoteService.cs @@ -1,5 +1,5 @@ namespace Volo.Abp; -public interface IRemoteService //TODO: Can we move this to another package? +public interface IRemoteService { } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs b/framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs index 1d7ba66d81..704dd3ba11 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/ISoftDelete.cs @@ -9,7 +9,7 @@ public interface ISoftDelete { /// - /// Used to mark an Entity as 'Deleted'. + /// Used to mark an Entity as 'Deleted'. /// - bool IsDeleted { get; set; } + bool IsDeleted { get; } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/IntegrationServiceAttribute.cs b/framework/src/Volo.Abp.Core/Volo/Abp/IntegrationServiceAttribute.cs new file mode 100644 index 0000000000..016a7a49c7 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/IntegrationServiceAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace Volo.Abp; + +[AttributeUsage(AttributeTargets.Class)] +public class IntegrationServiceAttribute : Attribute +{ + +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs index dded0d794e..74a62116a4 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Localization/CultureHelper.cs @@ -1,5 +1,6 @@ using System; using System.Globalization; +using System.Linq; using JetBrains.Annotations; namespace Volo.Abp.Localization; @@ -59,4 +60,45 @@ public static class CultureHelper { return new CultureInfo(cultureName).Parent.Name; } + + public static bool IsCompatibleCulture( + string sourceCultureName, + string targetCultureName) + { + if (sourceCultureName == targetCultureName) + { + return true; + } + + if (sourceCultureName.StartsWith("zh") && targetCultureName.StartsWith("zh")) + { + var culture = new CultureInfo(targetCultureName); + do + { + if (culture.Name == sourceCultureName) + { + return true; + } + + culture = new CultureInfo(culture.Name).Parent; + } while (!culture.Equals(CultureInfo.InvariantCulture)); + } + + if (sourceCultureName.Contains("-")) + { + return false; + } + + if (!targetCultureName.Contains("-")) + { + return false; + } + + if (sourceCultureName == GetBaseCultureName(targetCultureName)) + { + return true; + } + + return false; + } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateChecker.cs b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateChecker.cs index f1a2e40425..e919b981a6 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateChecker.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateChecker.cs @@ -6,4 +6,4 @@ public interface ISimpleStateChecker where TState : IHasSimpleStateCheckers { Task IsEnabledAsync(SimpleStateCheckerContext context); -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializer.cs b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializer.cs new file mode 100644 index 0000000000..ffbed53cf7 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializer.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Nodes; + +namespace Volo.Abp.SimpleStateChecking; + +public interface ISimpleStateCheckerSerializer +{ + public string Serialize(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers; + + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializerContributor.cs b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializerContributor.cs new file mode 100644 index 0000000000..d65c90eee6 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/ISimpleStateCheckerSerializerContributor.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Nodes; +using JetBrains.Annotations; + +namespace Volo.Abp.SimpleStateChecking; + +public interface ISimpleStateCheckerSerializerContributor +{ + [CanBeNull] + public string SerializeToJson(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers; + + [CanBeNull] + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers; +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializer.cs b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializer.cs new file mode 100644 index 0000000000..d5d931ffae --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializer.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using System.Text.Json.Nodes; +using JetBrains.Annotations; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.SimpleStateChecking; + +public class SimpleStateCheckerSerializer : + ISimpleStateCheckerSerializer, + ISingletonDependency +{ + private readonly IEnumerable _contributors; + + public SimpleStateCheckerSerializer(IEnumerable contributors) + { + _contributors = contributors; + } + + [CanBeNull] + public string Serialize(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers + { + foreach (var contributor in _contributors) + { + var result = contributor.SerializeToJson(checker); + if (result != null) + { + return result; + } + } + + return null; + } + + [CanBeNull] + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers + { + foreach (var contributor in _contributors) + { + var result = contributor.Deserialize(jsonObject, state); + if (result != null) + { + return result; + } + } + + return null; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializerExtensions.cs b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializerExtensions.cs new file mode 100644 index 0000000000..3594261741 --- /dev/null +++ b/framework/src/Volo.Abp.Core/Volo/Abp/SimpleStateChecking/SimpleStateCheckerSerializerExtensions.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json.Nodes; + +namespace Volo.Abp.SimpleStateChecking; + +public static class SimpleStateCheckerSerializerExtensions +{ + public static string Serialize( + this ISimpleStateCheckerSerializer serializer, + IList> stateCheckers) + where TState : IHasSimpleStateCheckers + { + switch (stateCheckers.Count) + { + case 0: + return null; + case 1: + var serializedChecker = serializer.Serialize(stateCheckers.Single()); + return serializedChecker != null + ? $"[{serializedChecker}]" + : null; + default: + var serializedCheckers = new List(stateCheckers.Count); + + foreach (var stateChecker in stateCheckers) + { + var serialized = serializer.Serialize(stateChecker); + if (serialized != null) + { + serializedCheckers.Add(serialized); + } + } + + return serializedCheckers.Any() + ? $"[{serializedCheckers.JoinAsString(",")}]" + : null; + } + } + + public static ISimpleStateChecker[] DeserializeArray( + this ISimpleStateCheckerSerializer serializer, + string value, + TState state) + where TState : IHasSimpleStateCheckers + { + if (value.IsNullOrWhiteSpace()) + { + return Array.Empty>(); + } + + var array = JsonNode.Parse(value) as JsonArray; + if (array == null || array.Count == 0) + { + return Array.Empty>(); + } + + if (array.Count == 1) + { + var jsonObject = array[0] as JsonObject; + if (jsonObject == null) + { + throw new AbpException("JSON value is not an array of objects: " + value); + } + + var checker = serializer.Deserialize(jsonObject, state); + if (checker == null) + { + return Array.Empty>(); + } + + return new[] { checker }; + } + + var checkers = new List>(); + + for (var i = 0; i < array.Count; i++) + { + if (array[i] is not JsonObject jsonObject) + { + throw new AbpException("JSON value is not an array of objects: " + value); + } + + checkers.Add(serializer.Deserialize(jsonObject, state)); + } + + return checkers.Where(x => x != null).ToArray(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/FodyWeavers.xml b/framework/src/Volo.Abp.Dapr/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/FodyWeavers.xsd b/framework/src/Volo.Abp.Dapr/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo.Abp.Dapr.csproj b/framework/src/Volo.Abp.Dapr/Volo.Abp.Dapr.csproj new file mode 100644 index 0000000000..d3a8651086 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo.Abp.Dapr.csproj @@ -0,0 +1,21 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs new file mode 100644 index 0000000000..ad284ce156 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using Dapr.Client; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Json.SystemTextJson; + +namespace Volo.Abp.Dapr; + +public class AbpDaprClientFactory : IAbpDaprClientFactory, ISingletonDependency +{ + protected AbpDaprOptions DaprOptions { get; } + protected JsonSerializerOptions JsonSerializerOptions { get; } + protected IDaprApiTokenProvider DaprApiTokenProvider { get; } + + public AbpDaprClientFactory( + IOptions options, + IOptions systemTextJsonSerializerOptions, + IDaprApiTokenProvider daprApiTokenProvider) + { + DaprApiTokenProvider = daprApiTokenProvider; + DaprOptions = options.Value; + JsonSerializerOptions = CreateJsonSerializerOptions(systemTextJsonSerializerOptions.Value); + } + + public virtual DaprClient Create(Action? builderAction = null) + { + var builder = new DaprClientBuilder() + .UseJsonSerializationOptions(JsonSerializerOptions); + + if (!DaprOptions.HttpEndpoint.IsNullOrWhiteSpace()) + { + builder.UseHttpEndpoint(DaprOptions.HttpEndpoint); + } + + if (!DaprOptions.GrpcEndpoint.IsNullOrWhiteSpace()) + { + builder.UseGrpcEndpoint(DaprOptions.GrpcEndpoint); + } + + var apiToken = DaprApiTokenProvider.GetDaprApiToken(); + if (!apiToken.IsNullOrWhiteSpace()) + { + builder.UseDaprApiToken(apiToken); + } + + builderAction?.Invoke(builder); + + return builder.Build(); + } + + public virtual HttpClient CreateHttpClient( + string? appId = null, + string? daprEndpoint = null, + string? daprApiToken = null) + { + if(daprEndpoint.IsNullOrWhiteSpace() && + !DaprOptions.HttpEndpoint.IsNullOrWhiteSpace()) + { + daprEndpoint = DaprOptions.HttpEndpoint; + } + + return DaprClient.CreateInvokeHttpClient( + appId, + daprEndpoint, + daprApiToken ?? DaprApiTokenProvider.GetDaprApiToken() + ); + } + + protected virtual JsonSerializerOptions CreateJsonSerializerOptions(AbpSystemTextJsonSerializerOptions systemTextJsonSerializerOptions) + { + return new JsonSerializerOptions(systemTextJsonSerializerOptions.JsonSerializerOptions); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprModule.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprModule.cs new file mode 100644 index 0000000000..276e96895d --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprModule.cs @@ -0,0 +1,65 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Json; +using Volo.Abp.Modularity; + +namespace Volo.Abp.Dapr; + +[DependsOn(typeof(AbpJsonModule))] +public class AbpDaprModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + + ConfigureDaprOptions(configuration); + + context.Services.TryAddSingleton( + serviceProvider => serviceProvider + .GetRequiredService() + .Create() + ); + } + + private void ConfigureDaprOptions(IConfiguration configuration) + { + Configure(configuration.GetSection("Dapr")); + Configure(options => + { + if (options.DaprApiToken.IsNullOrWhiteSpace()) + { + var confEnv = configuration["DAPR_API_TOKEN"]; + if (!confEnv.IsNullOrWhiteSpace()) + { + options.DaprApiToken = confEnv; + } + else + { + var env = Environment.GetEnvironmentVariable("DAPR_API_TOKEN"); + if (!env.IsNullOrWhiteSpace()) + { + options.DaprApiToken = env; + } + } + } + + if (options.AppApiToken.IsNullOrWhiteSpace()) + { + var confEnv = configuration["APP_API_TOKEN"]; + if (!confEnv.IsNullOrWhiteSpace()) + { + options.AppApiToken = confEnv; + } + else + { + var env = Environment.GetEnvironmentVariable("APP_API_TOKEN"); + if (!env.IsNullOrWhiteSpace()) + { + options.AppApiToken = env; + } + } + } + }); + } +} diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprOptions.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprOptions.cs new file mode 100644 index 0000000000..7ac19ad31c --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprOptions.cs @@ -0,0 +1,12 @@ +namespace Volo.Abp.Dapr; + +public class AbpDaprOptions +{ + public string HttpEndpoint { get; set; } + + public string GrpcEndpoint { get; set; } + + public string DaprApiToken { get; set; } + + public string AppApiToken { get; set; } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/DaprApiTokenProvider.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/DaprApiTokenProvider.cs new file mode 100644 index 0000000000..9fbed78204 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/DaprApiTokenProvider.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Dapr; + +public class DaprApiTokenProvider : IDaprApiTokenProvider, ISingletonDependency +{ + protected AbpDaprOptions Options { get; } + + public DaprApiTokenProvider(IOptions options) + { + Options = options.Value; + } + + public virtual string? GetDaprApiToken() + { + return Options.DaprApiToken; + } + + public virtual string? GetAppApiToken() + { + return Options.AppApiToken; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs new file mode 100644 index 0000000000..fc50a07d41 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs @@ -0,0 +1,14 @@ +using Dapr.Client; + +namespace Volo.Abp.Dapr; + +public interface IAbpDaprClientFactory +{ + DaprClient Create(Action? builderAction = null); + + HttpClient CreateHttpClient( + string? appId = null, + string? daprEndpoint = null, + string? daprApiToken = null + ); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprApiTokenProvider.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprApiTokenProvider.cs new file mode 100644 index 0000000000..89ea4d516d --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprApiTokenProvider.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.Dapr; + +public interface IDaprApiTokenProvider +{ + string? GetDaprApiToken(); + + string? GetAppApiToken(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprSerializer.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprSerializer.cs new file mode 100644 index 0000000000..7eec2c5c1c --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprSerializer.cs @@ -0,0 +1,16 @@ +namespace Volo.Abp.Dapr; + +public interface IDaprSerializer +{ + byte[] Serialize(object obj); + + object Deserialize(byte[] value, Type type); + + T Deserialize(byte[] value); + + string SerializeToString(object obj); + + object Deserialize(string value, Type type); + + T Deserialize(string value); +} diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/Utf8JsonDaprSerializer.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/Utf8JsonDaprSerializer.cs new file mode 100644 index 0000000000..ce9b4a8523 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/Utf8JsonDaprSerializer.cs @@ -0,0 +1,45 @@ +using System.Text; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Json; + +namespace Volo.Abp.Dapr; + +public class Utf8JsonDaprSerializer : IDaprSerializer, ITransientDependency +{ + private readonly IJsonSerializer _jsonSerializer; + + public Utf8JsonDaprSerializer(IJsonSerializer jsonSerializer) + { + _jsonSerializer = jsonSerializer; + } + + public byte[] Serialize(object obj) + { + return Encoding.UTF8.GetBytes(_jsonSerializer.Serialize(obj)); + } + + public object Deserialize(byte[] value, Type type) + { + return _jsonSerializer.Deserialize(type, Encoding.UTF8.GetString(value)); + } + + public T Deserialize(byte[] value) + { + return _jsonSerializer.Deserialize(Encoding.UTF8.GetString(value)); + } + + public string SerializeToString(object obj) + { + return _jsonSerializer.Serialize(obj); + } + + public object Deserialize(string value, Type type) + { + return _jsonSerializer.Deserialize(type, value); + } + + public T Deserialize(string value) + { + return _jsonSerializer.Deserialize(value); + } +} diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironment.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironment.cs new file mode 100644 index 0000000000..cdbdf13eb0 --- /dev/null +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironment.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.Data; + +public class AbpDataMigrationEnvironment +{ + +} diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironmentExtensions.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironmentExtensions.cs new file mode 100644 index 0000000000..796b547164 --- /dev/null +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataMigrationEnvironmentExtensions.cs @@ -0,0 +1,38 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Data; + +public static class AbpDataMigrationEnvironmentExtensions +{ + public static void AddDataMigrationEnvironment(this AbpApplicationCreationOptions options, AbpDataMigrationEnvironment environment = null) + { + options.Services.AddDataMigrationEnvironment(environment ?? new AbpDataMigrationEnvironment()); + } + + public static void AddDataMigrationEnvironment(this IServiceCollection services, AbpDataMigrationEnvironment environment = null) + { + services.AddObjectAccessor(environment ?? new AbpDataMigrationEnvironment()); + } + + public static AbpDataMigrationEnvironment GetDataMigrationEnvironment(this IServiceCollection services) + { + return services.GetObjectOrNull(); + } + + public static bool IsDataMigrationEnvironment(this IServiceCollection services) + { + return services.GetDataMigrationEnvironment() != null; + } + + public static AbpDataMigrationEnvironment GetDataMigrationEnvironment(this IServiceProvider serviceProvider) + { + return serviceProvider.GetService>()?.Value; + } + + public static bool IsDataMigrationEnvironment(this IServiceProvider serviceProvider) + { + return serviceProvider.GetDataMigrationEnvironment() != null; + } +} diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/hu.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/hu.json index 6ec29c05e5..abde74576e 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/hu.json +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/hu.json @@ -1,6 +1,6 @@ { - "culture": "hu", - "texts": { - "MaxResultCountExceededExceptionMessage": "{0} nem lehet több mint {1}! Csökkentse {2}.{3} a szerver oldalon, hogy több redeményt kapjon." - } + "culture": "hu", + "texts": { + "MaxResultCountExceededExceptionMessage": "{0} nem lehet több mint {1}! Csökkentse {2}.{3} a szerver oldalon, hogy több redeményt kapjon." + } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Services/IApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Services/IApplicationService.cs index 34fe187f81..ce59e46832 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Services/IApplicationService.cs +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Services/IApplicationService.cs @@ -3,8 +3,7 @@ /// /// This interface must be implemented by all application services to register and identify them by convention. /// -public interface IApplicationService : - IRemoteService +public interface IApplicationService : IRemoteService { -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs index 38a7efdb2e..bef608a6ff 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using Volo.Abp.Application.Services; +using Volo.Abp.Aspects; +using Volo.Abp.Auditing; using Volo.Abp.Authorization; using Volo.Abp.Domain; using Volo.Abp.Features; @@ -33,10 +35,12 @@ public class AbpDddApplicationModule : AbpModule { Configure(options => { - //TODO: Should we move related items to their own projects? - options.IgnoredInterfaces.AddIfNotContains(typeof(IRemoteService)); + options.IgnoredInterfaces.AddIfNotContains(typeof(IRemoteService)); options.IgnoredInterfaces.AddIfNotContains(typeof(IApplicationService)); options.IgnoredInterfaces.AddIfNotContains(typeof(IUnitOfWorkEnabled)); + options.IgnoredInterfaces.AddIfNotContains(typeof(IAuditingEnabled)); + options.IgnoredInterfaces.AddIfNotContains(typeof(IValidationEnabled)); + options.IgnoredInterfaces.AddIfNotContains(typeof(IGlobalFeatureCheckingEnabled)); }); } } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs index 03b2857ddc..b24e4b2900 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs @@ -41,9 +41,9 @@ public abstract class ApplicationService : [Obsolete("Use LazyServiceProvider instead.")] public IServiceProvider ServiceProvider { get; set; } - public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "Service" }; + public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "IntService", "IntegrationService", "Service" }; - public List AppliedCrossCuttingConcerns { get; } = new List(); + public List AppliedCrossCuttingConcerns { get; } = new(); protected IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService(); diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs index 8f9be2318f..20556f16ff 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs @@ -42,18 +42,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen Logger = NullLogger.Instance; } - public virtual void PublishEntityCreatingEvent(object entity) - { - TriggerEventWithEntity( - LocalEventBus, -#pragma warning disable 618 - typeof(EntityCreatingEventData<>), -#pragma warning restore 618 - entity, - entity - ); - } - public virtual void PublishEntityCreatedEvent(object entity) { TriggerEventWithEntity( @@ -89,18 +77,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen ); } - public virtual void PublishEntityUpdatingEvent(object entity) - { - TriggerEventWithEntity( - LocalEventBus, -#pragma warning disable 618 - typeof(EntityUpdatingEventData<>), -#pragma warning restore 618 - entity, - entity - ); - } - public virtual void PublishEntityUpdatedEvent(object entity) { TriggerEventWithEntity( @@ -125,18 +101,6 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen } } - public virtual void PublishEntityDeletingEvent(object entity) - { - TriggerEventWithEntity( - LocalEventBus, -#pragma warning disable 618 - typeof(EntityDeletingEventData<>), -#pragma warning restore 618 - entity, - entity - ); - } - public virtual void PublishEntityDeletedEvent(object entity) { TriggerEventWithEntity( diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangingEventData.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangingEventData.cs deleted file mode 100644 index ae24163966..0000000000 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangingEventData.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace Volo.Abp.Domain.Entities.Events; - -/// -/// Used to pass data for an event when an entity () is being changed (creating, updating or deleting). -/// See , and classes. -/// -/// Entity type -[Serializable] -[Obsolete("This event is no longer needed and identical to EntityChangedEventData. Please use EntityChangedEventData instead.")] -public class EntityChangingEventData : EntityEventData -{ - /// - /// Constructor. - /// - /// Changing entity in this event - public EntityChangingEventData(TEntity entity) - : base(entity) - { - - } -} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityCreatingEventData.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityCreatingEventData.cs deleted file mode 100644 index 914c8ca7c7..0000000000 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityCreatingEventData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Volo.Abp.Domain.Entities.Events; - -/// -/// This type of event is used to notify just before creation of an Entity. -/// -/// Entity type -[Serializable] -[Obsolete("This event is no longer needed and identical to EntityCreatedEventData. Please use EntityCreatedEventData instead.")] -public class EntityCreatingEventData : EntityChangingEventData -{ - /// - /// Constructor. - /// - /// The entity which is being created - public EntityCreatingEventData(TEntity entity) - : base(entity) - { - - } -} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityDeletingEventData.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityDeletingEventData.cs deleted file mode 100644 index af0d1218f7..0000000000 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityDeletingEventData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Volo.Abp.Domain.Entities.Events; - -/// -/// This type of event is used to notify just before deletion of an Entity. -/// -/// Entity type -[Serializable] -[Obsolete("This event is no longer needed and identical to EntityDeletedEventData. Please use EntityDeletedEventData instead.")] -public class EntityDeletingEventData : EntityChangingEventData -{ - /// - /// Constructor. - /// - /// The entity which is being deleted - public EntityDeletingEventData(TEntity entity) - : base(entity) - { - - } -} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityUpdatingEventData.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityUpdatingEventData.cs deleted file mode 100644 index 703304fefb..0000000000 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityUpdatingEventData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Volo.Abp.Domain.Entities.Events; - -/// -/// This type of event is used to notify just before update of an Entity. -/// -/// Entity type -[Serializable] -[Obsolete("This event is no longer needed and identical to EntityUpdatedEventData. Please use EntityUpdatedEventData instead.")] -public class EntityUpdatingEventData : EntityChangingEventData -{ - /// - /// Constructor. - /// - /// The entity which is being updated - public EntityUpdatingEventData(TEntity entity) - : base(entity) - { - - } -} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/IEntityChangeEventHelper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/IEntityChangeEventHelper.cs index db580a0682..aa63c7e3c9 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/IEntityChangeEventHelper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/IEntityChangeEventHelper.cs @@ -5,12 +5,9 @@ namespace Volo.Abp.Domain.Entities.Events; /// public interface IEntityChangeEventHelper { - void PublishEntityCreatingEvent(object entity); void PublishEntityCreatedEvent(object entity); - void PublishEntityUpdatingEvent(object entity); void PublishEntityUpdatedEvent(object entity); - void PublishEntityDeletingEvent(object entity); void PublishEntityDeletedEvent(object entity); } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/NullEntityChangeEventHelper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/NullEntityChangeEventHelper.cs index d428f84d6f..4d849f2f27 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/NullEntityChangeEventHelper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/NullEntityChangeEventHelper.cs @@ -14,26 +14,14 @@ public class NullEntityChangeEventHelper : IEntityChangeEventHelper { } - public void PublishEntityCreatingEvent(object entity) - { - } - public void PublishEntityCreatedEvent(object entity) { } - public void PublishEntityUpdatingEvent(object entity) - { - } - public void PublishEntityUpdatedEvent(object entity) { } - public void PublishEntityDeletingEvent(object entity) - { - } - public void PublishEntityDeletedEvent(object entity) { } diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/AbpDistributedLockOptions.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/AbpDistributedLockOptions.cs new file mode 100644 index 0000000000..8a885ae877 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/AbpDistributedLockOptions.cs @@ -0,0 +1,14 @@ +namespace Volo.Abp.DistributedLocking; + +public class AbpDistributedLockOptions +{ + /// + /// DistributedLock key prefix. + /// + public string KeyPrefix { get; set; } + + public AbpDistributedLockOptions() + { + KeyPrefix = ""; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/DistributedLockKeyNormalizer.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/DistributedLockKeyNormalizer.cs new file mode 100644 index 0000000000..bce237c5e3 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/DistributedLockKeyNormalizer.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.DistributedLocking; + +public class DistributedLockKeyNormalizer : IDistributedLockKeyNormalizer, ITransientDependency +{ + protected AbpDistributedLockOptions Options { get; } + + public DistributedLockKeyNormalizer(IOptions options) + { + Options = options.Value; + } + + public virtual string NormalizeKey(string name) + { + return $"{Options.KeyPrefix}{name}"; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs index 760021c90a..754ae807f8 100644 --- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs @@ -14,7 +14,7 @@ public interface IAbpDistributedLock /// Returns null if the lock could not be handled. /// /// The name of the lock - /// Timeout value + /// How long to wait before giving up on the acquisition attempt. Defaults to 0 /// Cancellation token [ItemCanBeNull] Task TryAcquireAsync( diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IDistributedLockKeyNormalizer.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IDistributedLockKeyNormalizer.cs new file mode 100644 index 0000000000..13f30cca28 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IDistributedLockKeyNormalizer.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.DistributedLocking; + +public interface IDistributedLockKeyNormalizer +{ + string NormalizeKey(string name); + +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs index 9eb7a76b9d..fdec4f1d3f 100644 --- a/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs +++ b/framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs @@ -9,15 +9,22 @@ namespace Volo.Abp.DistributedLocking; public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency { private readonly ConcurrentDictionary _localSyncObjects = new(); + protected IDistributedLockKeyNormalizer DistributedLockKeyNormalizer { get; } + public LocalAbpDistributedLock(IDistributedLockKeyNormalizer distributedLockKeyNormalizer) + { + DistributedLockKeyNormalizer = distributedLockKeyNormalizer; + } + public async Task TryAcquireAsync( string name, TimeSpan timeout = default, CancellationToken cancellationToken = default) { Check.NotNullOrWhiteSpace(name, nameof(name)); - - var semaphore = _localSyncObjects.GetOrAdd(name, _ => new SemaphoreSlim(1, 1)); + var key = DistributedLockKeyNormalizer.NormalizeKey(name); + + var semaphore = _localSyncObjects.GetOrAdd(key, _ => new SemaphoreSlim(1, 1)); if (!await semaphore.WaitAsync(timeout, cancellationToken)) { diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xml b/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xsd b/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo.Abp.DistributedLocking.Dapr.csproj b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo.Abp.DistributedLocking.Dapr.csproj new file mode 100644 index 0000000000..80cad677a3 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo.Abp.DistributedLocking.Dapr.csproj @@ -0,0 +1,18 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockDaprOptions.cs b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockDaprOptions.cs new file mode 100644 index 0000000000..7579796871 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockDaprOptions.cs @@ -0,0 +1,15 @@ +namespace Volo.Abp.DistributedLocking.Dapr; + +public class AbpDistributedLockDaprOptions +{ + public string StoreName { get; set; } + + public string? Owner { get; set; } + + public TimeSpan DefaultExpirationTimeout { get; set; } + + public AbpDistributedLockDaprOptions() + { + DefaultExpirationTimeout = TimeSpan.FromMinutes(2); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockingDaprModule.cs b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockingDaprModule.cs new file mode 100644 index 0000000000..c915cfe2f7 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockingDaprModule.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Dapr; +using Volo.Abp.Modularity; + +namespace Volo.Abp.DistributedLocking.Dapr; + +[DependsOn( + typeof(AbpDistributedLockingAbstractionsModule), + typeof(AbpDaprModule))] +public class AbpDistributedLockingDaprModule : AbpModule +{ +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs new file mode 100644 index 0000000000..ef99b52227 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs @@ -0,0 +1,46 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.Dapr; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.DistributedLocking.Dapr; + +[Dependency(ReplaceServices = true)] +public class DaprAbpDistributedLock : IAbpDistributedLock, ITransientDependency +{ + protected IAbpDaprClientFactory DaprClientFactory { get; } + protected AbpDistributedLockDaprOptions DistributedLockDaprOptions { get; } + protected IDistributedLockKeyNormalizer DistributedLockKeyNormalizer { get; } + + public DaprAbpDistributedLock( + IAbpDaprClientFactory daprClientFactory, + IOptions distributedLockDaprOptions, + IDistributedLockKeyNormalizer distributedLockKeyNormalizer) + { + DaprClientFactory = daprClientFactory; + DistributedLockKeyNormalizer = distributedLockKeyNormalizer; + DistributedLockDaprOptions = distributedLockDaprOptions.Value; + } + + public async Task TryAcquireAsync( + string name, + TimeSpan timeout = default, + CancellationToken cancellationToken = default) + { + name = DistributedLockKeyNormalizer.NormalizeKey(name); + + var daprClient = DaprClientFactory.Create(); + var lockResponse = await daprClient.Lock( + DistributedLockDaprOptions.StoreName, + name, + DistributedLockDaprOptions.Owner ?? Guid.NewGuid().ToString(), + (int)DistributedLockDaprOptions.DefaultExpirationTimeout.TotalSeconds, + cancellationToken); + + if (lockResponse == null || !lockResponse.Success) + { + return null; + } + + return new DaprAbpDistributedLockHandle(lockResponse); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLockHandle.cs b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLockHandle.cs new file mode 100644 index 0000000000..b10f0f3672 --- /dev/null +++ b/framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLockHandle.cs @@ -0,0 +1,18 @@ +using Dapr.Client; + +namespace Volo.Abp.DistributedLocking.Dapr; + +public class DaprAbpDistributedLockHandle : IAbpDistributedLockHandle +{ + protected TryLockResponse LockResponse { get; } + + public DaprAbpDistributedLockHandle(TryLockResponse lockResponse) + { + LockResponse = lockResponse; + } + + public async ValueTask DisposeAsync() + { + await LockResponse.DisposeAsync(); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj b/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj index fd9b992133..0abb5e699c 100644 --- a/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj +++ b/framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj @@ -16,6 +16,7 @@ + diff --git a/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/AbpDistributedLockingModule.cs b/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/AbpDistributedLockingModule.cs index 4c4abd3f32..eef5b396a2 100644 --- a/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/AbpDistributedLockingModule.cs +++ b/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/AbpDistributedLockingModule.cs @@ -1,11 +1,12 @@ using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.DistributedLocking; [DependsOn( - typeof(AbpDistributedLockingAbstractionsModule) + typeof(AbpDistributedLockingAbstractionsModule), + typeof(AbpThreadingModule) )] public class AbpDistributedLockingModule : AbpModule { - } diff --git a/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs b/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs index e78f1934c1..0defc5a75f 100644 --- a/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs +++ b/framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs @@ -3,6 +3,7 @@ using System.Threading; using System.Threading.Tasks; using Medallion.Threading; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace Volo.Abp.DistributedLocking; @@ -10,10 +11,18 @@ namespace Volo.Abp.DistributedLocking; public class MedallionAbpDistributedLock : IAbpDistributedLock, ITransientDependency { protected IDistributedLockProvider DistributedLockProvider { get; } + protected ICancellationTokenProvider CancellationTokenProvider { get; } + + protected IDistributedLockKeyNormalizer DistributedLockKeyNormalizer { get; } - public MedallionAbpDistributedLock(IDistributedLockProvider distributedLockProvider) + public MedallionAbpDistributedLock( + IDistributedLockProvider distributedLockProvider, + ICancellationTokenProvider cancellationTokenProvider, + IDistributedLockKeyNormalizer distributedLockKeyNormalizer) { DistributedLockProvider = distributedLockProvider; + CancellationTokenProvider = cancellationTokenProvider; + DistributedLockKeyNormalizer = distributedLockKeyNormalizer; } public async Task TryAcquireAsync( @@ -22,8 +31,16 @@ public class MedallionAbpDistributedLock : IAbpDistributedLock, ITransientDepend CancellationToken cancellationToken = default) { Check.NotNullOrWhiteSpace(name, nameof(name)); + var key = DistributedLockKeyNormalizer.NormalizeKey(name); + + CancellationTokenProvider.FallbackToProvider(cancellationToken); - var handle = await DistributedLockProvider.TryAcquireLockAsync(name, timeout, cancellationToken); + var handle = await DistributedLockProvider.TryAcquireLockAsync( + key, + timeout, + CancellationTokenProvider.FallbackToProvider(cancellationToken) + ); + if (handle == null) { return null; diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/hu.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/hu.json index f2dbce2961..e9eae5a82a 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/hu.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/hu.json @@ -1,25 +1,25 @@ { - "culture": "hu", - "texts": { - "DisplayName:Abp.Mailing.DefaultFromAddress": "Alapértlemezett feladó címe", - "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Feladó alapértelmezett megjelenő neve", - "DisplayName:Abp.Mailing.Smtp.Host": "Kiszolgáló", - "DisplayName:Abp.Mailing.Smtp.Port": "Port", - "DisplayName:Abp.Mailing.Smtp.UserName": "Felhasználónév", - "DisplayName:Abp.Mailing.Smtp.Password": "Jelszó", - "DisplayName:Abp.Mailing.Smtp.Domain": "Domain", - "DisplayName:Abp.Mailing.Smtp.EnableSsl": "SSL engedélyezése", - "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Használja az alapértelmezett hitelesítő adatokat", - "Description:Abp.Mailing.DefaultFromAddress": "Az alapértlemezett feladó címe", - "Description:Abp.Mailing.DefaultFromDisplayName": "A feladó alapértelmezett megjelenő neve", - "Description:Abp.Mailing.Smtp.Host": "Az SMTP kiszolgáló neve vagy IP címe.", - "Description:Abp.Mailing.Smtp.Port": "Az SMTP forgalomhoz használt port.", - "Description:Abp.Mailing.Smtp.UserName": "A hitelesítő adatokhoz társított felhasználói név..", - "Description:Abp.Mailing.Smtp.Password": "A hitelesítő adatokhoz társított felhasználói név jelszava.", - "Description:Abp.Mailing.Smtp.Domain": "A hitelesítő adatokat igazoló tartomány vagy számítógép neve.", - "Description:Abp.Mailing.Smtp.EnableSsl": "Engedélyezze, ha a levelező programja Secure Sockets Layer (SSL) protokollt használ a kapcsolat titkosításához.", - "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Alkalmazza, hogy a kérésekhez az alapértelmezett hitelesítést használja.", - "TextTemplate:StandardEmailTemplates.Layout": "Alapértelmezett e-mail elrendezési sablon", - "TextTemplate:StandardEmailTemplates.Message": "Egyszerű üzenet sablon az e-mailekhez" - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "DisplayName:Abp.Mailing.DefaultFromAddress": "Alapértlemezett feladó címe", + "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Feladó alapértelmezett megjelenő neve", + "DisplayName:Abp.Mailing.Smtp.Host": "Kiszolgáló", + "DisplayName:Abp.Mailing.Smtp.Port": "Port", + "DisplayName:Abp.Mailing.Smtp.UserName": "Felhasználónév", + "DisplayName:Abp.Mailing.Smtp.Password": "Jelszó", + "DisplayName:Abp.Mailing.Smtp.Domain": "Domain", + "DisplayName:Abp.Mailing.Smtp.EnableSsl": "SSL engedélyezése", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Használja az alapértelmezett hitelesítő adatokat", + "Description:Abp.Mailing.DefaultFromAddress": "Az alapértlemezett feladó címe", + "Description:Abp.Mailing.DefaultFromDisplayName": "A feladó alapértelmezett megjelenő neve", + "Description:Abp.Mailing.Smtp.Host": "Az SMTP kiszolgáló neve vagy IP címe.", + "Description:Abp.Mailing.Smtp.Port": "Az SMTP forgalomhoz használt port.", + "Description:Abp.Mailing.Smtp.UserName": "A hitelesítő adatokhoz társított felhasználói név..", + "Description:Abp.Mailing.Smtp.Password": "A hitelesítő adatokhoz társított felhasználói név jelszava.", + "Description:Abp.Mailing.Smtp.Domain": "A hitelesítő adatokat igazoló tartomány vagy számítógép neve.", + "Description:Abp.Mailing.Smtp.EnableSsl": "Engedélyezze, ha a levelező programja Secure Sockets Layer (SSL) protokollt használ a kapcsolat titkosításához.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Alkalmazza, hogy a kérésekhez az alapértelmezett hitelesítést használja.", + "TextTemplate:StandardEmailTemplates.Layout": "Alapértelmezett e-mail elrendezési sablon", + "TextTemplate:StandardEmailTemplates.Message": "Egyszerű üzenet sablon az e-mailekhez" + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json index b1f3878b88..c0d6227e48 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/pt-BR.json @@ -9,7 +9,7 @@ "DisplayName:Abp.Mailing.Smtp.Password": "Senha", "DisplayName:Abp.Mailing.Smtp.Domain": "Domínio", "DisplayName:Abp.Mailing.Smtp.EnableSsl": "Habilitar SSL", - "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Use credenciais padrão", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Usar credenciais padrão", "Description:Abp.Mailing.DefaultFromAddress": "O endereço de origem padrão", "Description:Abp.Mailing.DefaultFromDisplayName": "O nome de exibição padrão", "Description:Abp.Mailing.Smtp.Host": "O nome ou endereço IP do host usado para transações SMTP.", diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 1f55bce770..fd998510af 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -292,7 +292,6 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, { case EntityState.Added: ApplyAbpConceptsForAddedEntity(entry); - EntityChangeEventHelper.PublishEntityCreatingEvent(entry.Entity); EntityChangeEventHelper.PublishEntityCreatedEvent(entry.Entity); break; case EntityState.Modified: @@ -301,12 +300,10 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, { if (entry.Entity is ISoftDelete && entry.Entity.As().IsDeleted) { - EntityChangeEventHelper.PublishEntityDeletingEvent(entry.Entity); EntityChangeEventHelper.PublishEntityDeletedEvent(entry.Entity); } else { - EntityChangeEventHelper.PublishEntityUpdatingEvent(entry.Entity); EntityChangeEventHelper.PublishEntityUpdatedEvent(entry.Entity); } } @@ -314,7 +311,6 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, break; case EntityState.Deleted: ApplyAbpConceptsForDeletedEntity(entry); - EntityChangeEventHelper.PublishEntityDeletingEvent(entry.Entity); EntityChangeEventHelper.PublishEntityDeletedEvent(entry.Entity); break; } @@ -485,7 +481,7 @@ public abstract class AbpDbContext : DbContext, IAbpEfCoreDbContext, } entry.Reload(); - entry.Entity.As().IsDeleted = true; + ObjectHelper.TrySetProperty(entry.Entity.As(), x => x.IsDeleted, () => true); SetDeletionAuditProperties(entry); } diff --git a/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xml b/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xsd b/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.EventBus.Dapr/Volo.Abp.EventBus.Dapr.csproj b/framework/src/Volo.Abp.EventBus.Dapr/Volo.Abp.EventBus.Dapr.csproj new file mode 100644 index 0000000000..2bef3f9dc9 --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/Volo.Abp.EventBus.Dapr.csproj @@ -0,0 +1,18 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpDaprEventBusOptions.cs b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpDaprEventBusOptions.cs new file mode 100644 index 0000000000..d3ced52ba2 --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpDaprEventBusOptions.cs @@ -0,0 +1,11 @@ +namespace Volo.Abp.EventBus.Dapr; + +public class AbpDaprEventBusOptions +{ + public string PubSubName { get; set; } + + public AbpDaprEventBusOptions() + { + PubSubName = "pubsub"; + } +} diff --git a/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpEventBusDaprModule.cs b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpEventBusDaprModule.cs new file mode 100644 index 0000000000..5f6329a4bc --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/AbpEventBusDaprModule.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Dapr; +using Volo.Abp.Modularity; + +namespace Volo.Abp.EventBus.Dapr; + +[DependsOn( + typeof(AbpEventBusModule), + typeof(AbpDaprModule) + )] +public class AbpEventBusDaprModule : AbpModule +{ + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + context + .ServiceProvider + .GetRequiredService() + .Initialize(); + } +} diff --git a/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs new file mode 100644 index 0000000000..c8d47f6887 --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Dapr/Volo/Abp/EventBus/Dapr/DaprDistributedEventBus.cs @@ -0,0 +1,221 @@ +using System.Collections.Concurrent; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.Dapr; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Threading; +using Volo.Abp.Timing; +using Volo.Abp.Uow; + +namespace Volo.Abp.EventBus.Dapr; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IDistributedEventBus), typeof(DaprDistributedEventBus))] +public class DaprDistributedEventBus : DistributedEventBusBase, ISingletonDependency +{ + protected IDaprSerializer Serializer { get; } + protected AbpDaprEventBusOptions DaprEventBusOptions { get; } + protected IAbpDaprClientFactory DaprClientFactory { get; } + + protected ConcurrentDictionary> HandlerFactories { get; } + protected ConcurrentDictionary EventTypes { get; } + + public DaprDistributedEventBus( + IServiceScopeFactory serviceScopeFactory, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + IOptions abpDistributedEventBusOptions, + IGuidGenerator guidGenerator, + IClock clock, + IEventHandlerInvoker eventHandlerInvoker, + IDaprSerializer serializer, + IOptions daprEventBusOptions, + IAbpDaprClientFactory daprClientFactory) + : base(serviceScopeFactory, currentTenant, unitOfWorkManager, abpDistributedEventBusOptions, guidGenerator, clock, eventHandlerInvoker) + { + Serializer = serializer; + DaprEventBusOptions = daprEventBusOptions.Value; + DaprClientFactory = daprClientFactory; + + HandlerFactories = new ConcurrentDictionary>(); + EventTypes = new ConcurrentDictionary(); + } + + public void Initialize() + { + SubscribeHandlers(AbpDistributedEventBusOptions.Handlers); + } + + public override IDisposable Subscribe(Type eventType, IEventHandlerFactory factory) + { + var handlerFactories = GetOrCreateHandlerFactories(eventType); + + if (factory.IsInFactories(handlerFactories)) + { + return NullDisposable.Instance; + } + + handlerFactories.Add(factory); + + return new EventHandlerFactoryUnregistrar(this, eventType, factory); + } + + public override void Unsubscribe(Func action) + { + Check.NotNull(action, nameof(action)); + + GetOrCreateHandlerFactories(typeof(TEvent)) + .Locking(factories => + { + factories.RemoveAll( + factory => + { + var singleInstanceFactory = factory as SingleInstanceHandlerFactory; + if (singleInstanceFactory == null) + { + return false; + } + + var actionHandler = singleInstanceFactory.HandlerInstance as ActionEventHandler; + if (actionHandler == null) + { + return false; + } + + return actionHandler.Action == action; + }); + }); + } + + public override void Unsubscribe(Type eventType, IEventHandler handler) + { + GetOrCreateHandlerFactories(eventType) + .Locking(factories => + { + factories.RemoveAll( + factory => + factory is SingleInstanceHandlerFactory && + (factory as SingleInstanceHandlerFactory).HandlerInstance == handler + ); + }); + } + + public override void Unsubscribe(Type eventType, IEventHandlerFactory factory) + { + GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Remove(factory)); + } + + public override void UnsubscribeAll(Type eventType) + { + GetOrCreateHandlerFactories(eventType).Locking(factories => factories.Clear()); + } + + protected async override Task PublishToEventBusAsync(Type eventType, object eventData) + { + await PublishToDaprAsync(eventType, eventData); + } + + protected override void AddToUnitOfWork(IUnitOfWork unitOfWork, UnitOfWorkEventRecord eventRecord) + { + unitOfWork.AddOrReplaceDistributedEvent(eventRecord); + } + + protected override IEnumerable GetHandlerFactories(Type eventType) + { + var handlerFactoryList = new List(); + + foreach (var handlerFactory in HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) + { + handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerFactory.Key, handlerFactory.Value)); + } + + return handlerFactoryList.ToArray(); + } + + public async override Task PublishFromOutboxAsync(OutgoingEventInfo outgoingEvent, OutboxConfig outboxConfig) + { + await PublishToDaprAsync(outgoingEvent.EventName, Serializer.Deserialize(outgoingEvent.EventData, GetEventType(outgoingEvent.EventName))); + } + + public async override Task PublishManyFromOutboxAsync(IEnumerable outgoingEvents, OutboxConfig outboxConfig) + { + var outgoingEventArray = outgoingEvents.ToArray(); + + foreach (var outgoingEvent in outgoingEventArray) + { + await PublishToDaprAsync(outgoingEvent.EventName, Serializer.Deserialize(outgoingEvent.EventData, GetEventType(outgoingEvent.EventName))); + } + } + + public async override Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig) + { + var eventType = EventTypes.GetOrDefault(incomingEvent.EventName); + if (eventType == null) + { + return; + } + + var eventData = Serializer.Deserialize(incomingEvent.EventData, eventType); + var exceptions = new List(); + await TriggerHandlersAsync(eventType, eventData, exceptions, inboxConfig); + if (exceptions.Any()) + { + ThrowOriginalExceptions(eventType, exceptions); + } + } + + protected override byte[] Serialize(object eventData) + { + return Serializer.Serialize(eventData); + } + + private List GetOrCreateHandlerFactories(Type eventType) + { + return HandlerFactories.GetOrAdd( + eventType, + type => + { + var eventName = EventNameAttribute.GetNameOrDefault(type); + EventTypes[eventName] = type; + return new List(); + } + ); + } + + public Type GetEventType(string eventName) + { + return EventTypes.GetOrDefault(eventName); + } + + protected virtual async Task PublishToDaprAsync(Type eventType, object eventData) + { + await PublishToDaprAsync(EventNameAttribute.GetNameOrDefault(eventType), eventData); + } + + protected virtual async Task PublishToDaprAsync(string eventName, object eventData) + { + var client = DaprClientFactory.Create(); + await client.PublishEventAsync(pubsubName: DaprEventBusOptions.PubSubName, topicName: eventName, data: eventData); + } + + private static bool ShouldTriggerEventForHandler(Type targetEventType, Type handlerEventType) + { + //Should trigger same type + if (handlerEventType == targetEventType) + { + return true; + } + + //TODO: Support inheritance? But it does not support on subscription to RabbitMq! + //Should trigger for inherited types + if (handlerEventType.IsAssignableFrom(targetEventType)) + { + return true; + } + + return false; + } +} diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs index addbc49171..bac9bdf0c9 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/AbpRabbitMqEventBusOptions.cs @@ -13,6 +13,8 @@ public class AbpRabbitMqEventBusOptions public string ExchangeName { get; set; } public string ExchangeType { get; set; } + + public ushort? PrefetchCount { get; set; } public string GetExchangeTypeOrDefault() { diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs index c9ec49bc7e..7e352ca530 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs @@ -78,7 +78,8 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe AbpRabbitMqEventBusOptions.ClientName, durable: true, exclusive: false, - autoDelete: false + autoDelete: false, + prefetchCount: AbpRabbitMqEventBusOptions.PrefetchCount ), AbpRabbitMqEventBusOptions.ConnectionName ); diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/AbpFeatureOptions.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/AbpFeatureOptions.cs index 22c1067082..87ff7716db 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/AbpFeatureOptions.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/AbpFeatureOptions.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Collections; +using System.Collections.Generic; +using Volo.Abp.Collections; namespace Volo.Abp.Features; @@ -8,9 +9,16 @@ public class AbpFeatureOptions public ITypeList ValueProviders { get; } + public HashSet DeletedFeatures { get; } + + public HashSet DeletedFeatureGroups { get; } + public AbpFeatureOptions() { DefinitionProviders = new TypeList(); ValueProviders = new TypeList(); + + DeletedFeatures = new HashSet(); + DeletedFeatureGroups = new HashSet(); } } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs index 580881ce84..9554860078 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureChecker.cs @@ -37,7 +37,7 @@ public class FeatureChecker : FeatureCheckerBase public override async Task GetOrNullAsync(string name) { - var featureDefinition = FeatureDefinitionManager.Get(name); + var featureDefinition = await FeatureDefinitionManager.GetAsync(name); var providers = Enumerable .Reverse(Providers); diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs index 3123faefc2..5ea7377fd7 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinition.cs @@ -7,7 +7,7 @@ using Volo.Abp.Validation.StringValues; namespace Volo.Abp.Features; -public class FeatureDefinition +public class FeatureDefinition : ICanCreateChildFeature { /// /// Unique name of the feature. @@ -178,6 +178,17 @@ public class FeatureDefinition _children.Remove(featureToRemove); } + public FeatureDefinition CreateChildFeature(string name, + string defaultValue = null, + ILocalizableString displayName = null, + ILocalizableString description = null, + IStringValueType valueType = null, + bool isVisibleToClients = true, + bool isAvailableToHost = true) + { + return this.CreateChild(name, defaultValue, displayName, description, valueType, isVisibleToClients, isAvailableToHost); + } + public override string ToString() { return $"[{nameof(FeatureDefinition)}: {Name}]"; diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinitionManager.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinitionManager.cs index c39db18771..d0293d5859 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinitionManager.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureDefinitionManager.cs @@ -2,120 +2,70 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; +using System.Threading.Tasks; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Features; public class FeatureDefinitionManager : IFeatureDefinitionManager, ISingletonDependency { - protected IDictionary FeatureGroupDefinitions => _lazyFeatureGroupDefinitions.Value; - private readonly Lazy> _lazyFeatureGroupDefinitions; - - protected IDictionary FeatureDefinitions => _lazyFeatureDefinitions.Value; - private readonly Lazy> _lazyFeatureDefinitions; - - protected AbpFeatureOptions Options { get; } - - private readonly IServiceScopeFactory _serviceScopeFactory; + protected IStaticFeatureDefinitionStore StaticStore; + protected IDynamicFeatureDefinitionStore DynamicStore; public FeatureDefinitionManager( - IOptions options, - IServiceScopeFactory serviceScopeFactory) + IStaticFeatureDefinitionStore staticStore, + IDynamicFeatureDefinitionStore dynamicStore) { - _serviceScopeFactory = serviceScopeFactory; - Options = options.Value; - - _lazyFeatureDefinitions = new Lazy>( - CreateFeatureDefinitions, - isThreadSafe: true - ); - - _lazyFeatureGroupDefinitions = new Lazy>( - CreateFeatureGroupDefinitions, - isThreadSafe: true - ); + StaticStore = staticStore; + DynamicStore = dynamicStore; } - public virtual FeatureDefinition Get(string name) + public virtual async Task GetAsync(string name) { - Check.NotNull(name, nameof(name)); - - var feature = GetOrNull(name); - - if (feature == null) + var permission = await GetOrNullAsync(name); + if (permission == null) { throw new AbpException("Undefined feature: " + name); } - return feature; - } - - public virtual IReadOnlyList GetAll() - { - return FeatureDefinitions.Values.ToImmutableList(); - } - - public virtual FeatureDefinition GetOrNull(string name) - { - return FeatureDefinitions.GetOrDefault(name); - } - - public IReadOnlyList GetGroups() - { - return FeatureGroupDefinitions.Values.ToImmutableList(); + return permission; } - protected virtual Dictionary CreateFeatureDefinitions() + public virtual async Task GetOrNullAsync(string name) { - var features = new Dictionary(); - - foreach (var groupDefinition in FeatureGroupDefinitions.Values) - { - foreach (var feature in groupDefinition.Features) - { - AddFeatureToDictionaryRecursively(features, feature); - } - } + Check.NotNull(name, nameof(name)); - return features; + return await StaticStore.GetOrNullAsync(name) ?? + await DynamicStore.GetOrNullAsync(name); } - protected virtual void AddFeatureToDictionaryRecursively( - Dictionary features, - FeatureDefinition feature) + public virtual async Task> GetAllAsync() { - if (features.ContainsKey(feature.Name)) - { - throw new AbpException("Duplicate feature name: " + feature.Name); - } + var staticFeatures = await StaticStore.GetFeaturesAsync(); + var staticFeatureNames = staticFeatures + .Select(p => p.Name) + .ToImmutableHashSet(); - features[feature.Name] = feature; + var dynamicFeatures = await DynamicStore.GetFeaturesAsync(); - foreach (var child in feature.Children) - { - AddFeatureToDictionaryRecursively(features, child); - } + /* We prefer static features over dynamics */ + return staticFeatures.Concat( + dynamicFeatures.Where(d => !staticFeatureNames.Contains(d.Name)) + ).ToImmutableList(); } - protected virtual Dictionary CreateFeatureGroupDefinitions() + public virtual async Task> GetGroupsAsync() { - var context = new FeatureDefinitionContext(); + var staticGroups = await StaticStore.GetGroupsAsync(); + var staticGroupNames = staticGroups + .Select(p => p.Name) + .ToImmutableHashSet(); - using (var scope = _serviceScopeFactory.CreateScope()) - { - var providers = Options - .DefinitionProviders - .Select(p => scope.ServiceProvider.GetRequiredService(p) as IFeatureDefinitionProvider) - .ToList(); - - foreach (var provider in providers) - { - provider.Define(context); - } - } + var dynamicGroups = await DynamicStore.GetGroupsAsync(); - return context.Groups; + /* We prefer static groups over dynamics */ + return staticGroups.Concat( + dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name)) + ).ToImmutableList(); } } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs index cba2e06584..e584a95c50 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeatureGroupDefinition.cs @@ -5,7 +5,7 @@ using Volo.Abp.Validation.StringValues; namespace Volo.Abp.Features; -public class FeatureGroupDefinition +public class FeatureGroupDefinition : ICanCreateChildFeature { /// /// Unique name of the group. @@ -69,6 +69,16 @@ public class FeatureGroupDefinition return feature; } + public FeatureDefinition CreateChildFeature(string name, + string defaultValue = null, + ILocalizableString displayName = null, + ILocalizableString description = null, + IStringValueType valueType = null, + bool isVisibleToClients = true, + bool isAvailableToHost = true) + { + return AddFeature(name, defaultValue, displayName, description, valueType, isVisibleToClients); + } public virtual List GetFeaturesWithChildren() { var features = new List(); diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor.cs new file mode 100644 index 0000000000..58e2817139 --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor.cs @@ -0,0 +1,56 @@ +using System.Linq; +using System.Text.Json.Nodes; +using Volo.Abp.DependencyInjection; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.Features; + +public class FeaturesSimpleStateCheckerSerializerContributor : + ISimpleStateCheckerSerializerContributor, + ISingletonDependency +{ + public const string CheckerShortName = "F"; + + public string SerializeToJson(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers + { + if (checker is not RequireFeaturesSimpleStateChecker featuresSimpleStateChecker) + { + return null; + } + + var jsonObject = new JsonObject { + ["T"] = CheckerShortName, + ["A"] = featuresSimpleStateChecker.RequiresAll + }; + + var nameArray = new JsonArray(); + foreach (var featureName in featuresSimpleStateChecker.FeatureNames) + { + nameArray.Add(featureName); + } + + jsonObject["N"] = nameArray; + return jsonObject.ToJsonString(); + } + + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers + { + if (jsonObject["T"]?.ToString() != CheckerShortName) + { + return null; + } + + var nameArray = jsonObject["N"] as JsonArray; + if (nameArray == null) + { + throw new AbpException("'N' is not an array in the serialized state checker! JsonObject: " + jsonObject.ToJsonString()); + } + + return new RequireFeaturesSimpleStateChecker( + (bool?)jsonObject["A"] ?? false, + nameArray.Select(x => x.ToString()).ToArray() + ); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/ICanCreateChildFeature.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/ICanCreateChildFeature.cs new file mode 100644 index 0000000000..ecba11e31e --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/ICanCreateChildFeature.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Localization; +using Volo.Abp.Validation.StringValues; + +namespace Volo.Abp.Features; + +public interface ICanCreateChildFeature +{ + FeatureDefinition CreateChildFeature( + string name, + string defaultValue = null, + ILocalizableString displayName = null, + ILocalizableString description = null, + IStringValueType valueType = null, + bool isVisibleToClients = true, + bool isAvailableToHost = true); +} diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/IDynamicFeatureDefinitionStore.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IDynamicFeatureDefinitionStore.cs new file mode 100644 index 0000000000..90fe14a5e0 --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IDynamicFeatureDefinitionStore.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Volo.Abp.Features; + +public interface IDynamicFeatureDefinitionStore +{ + Task GetOrNullAsync(string name); + + Task> GetFeaturesAsync(); + + Task> GetGroupsAsync(); +} diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/IFeatureDefinitionManager.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IFeatureDefinitionManager.cs index ebef29b64a..f0201937df 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/IFeatureDefinitionManager.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IFeatureDefinitionManager.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading.Tasks; using JetBrains.Annotations; namespace Volo.Abp.Features; @@ -6,11 +7,11 @@ namespace Volo.Abp.Features; public interface IFeatureDefinitionManager { [NotNull] - FeatureDefinition Get([NotNull] string name); + Task GetAsync([NotNull] string name); - IReadOnlyList GetAll(); + Task> GetAllAsync(); - FeatureDefinition GetOrNull(string name); + Task GetOrNullAsync(string name); - IReadOnlyList GetGroups(); + Task> GetGroupsAsync(); } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/IStaticFeatureDefinitionStore.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IStaticFeatureDefinitionStore.cs new file mode 100644 index 0000000000..586747904e --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/IStaticFeatureDefinitionStore.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Volo.Abp.Features; + +public interface IStaticFeatureDefinitionStore +{ + Task GetOrNullAsync(string name); + + Task> GetFeaturesAsync(); + + Task> GetGroupsAsync(); +} diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/NullDynamicFeatureDefinitionStore.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/NullDynamicFeatureDefinitionStore.cs new file mode 100644 index 0000000000..63e7b476c4 --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/NullDynamicFeatureDefinitionStore.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Features; + +public class NullDynamicFeatureDefinitionStore : IDynamicFeatureDefinitionStore, ISingletonDependency +{ + private static readonly Task CachedFeatureResult = Task.FromResult((FeatureDefinition)null); + + private static readonly Task> CachedFeaturesResult = + Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); + + private static readonly Task> CachedGroupsResult = + Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); + + public Task GetOrNullAsync(string name) + { + return CachedFeatureResult; + } + + public Task> GetFeaturesAsync() + { + return CachedFeaturesResult; + } + + public Task> GetGroupsAsync() + { + return CachedGroupsResult; + } +} diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/RequireFeaturesSimpleStateChecker.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/RequireFeaturesSimpleStateChecker.cs index 1b437e623a..625d097441 100644 --- a/framework/src/Volo.Abp.Features/Volo/Abp/Features/RequireFeaturesSimpleStateChecker.cs +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/RequireFeaturesSimpleStateChecker.cs @@ -7,8 +7,8 @@ namespace Volo.Abp.Features; public class RequireFeaturesSimpleStateChecker : ISimpleStateChecker where TState : IHasSimpleStateCheckers { - private readonly string[] _featureNames; - private readonly bool _requiresAll; + public string[] FeatureNames { get; } + public bool RequiresAll { get; } public RequireFeaturesSimpleStateChecker(params string[] featureNames) : this(true, featureNames) @@ -19,13 +19,13 @@ public class RequireFeaturesSimpleStateChecker : ISimpleStateChecker IsEnabledAsync(SimpleStateCheckerContext context) { var featureChecker = context.ServiceProvider.GetRequiredService(); - return await featureChecker.IsEnabledAsync(_requiresAll, _featureNames); + return await featureChecker.IsEnabledAsync(RequiresAll, FeatureNames); } } diff --git a/framework/src/Volo.Abp.Features/Volo/Abp/Features/StaticFeatureDefinitionStore.cs b/framework/src/Volo.Abp.Features/Volo/Abp/Features/StaticFeatureDefinitionStore.cs new file mode 100644 index 0000000000..7d683d6caf --- /dev/null +++ b/framework/src/Volo.Abp.Features/Volo/Abp/Features/StaticFeatureDefinitionStore.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Features; + +public class StaticFeatureDefinitionStore: IStaticFeatureDefinitionStore, ISingletonDependency +{ + protected IDictionary FeatureGroupDefinitions => _lazyFeatureGroupDefinitions.Value; + private readonly Lazy> _lazyFeatureGroupDefinitions; + + protected IDictionary FeatureDefinitions => _lazyFeatureDefinitions.Value; + private readonly Lazy> _lazyFeatureDefinitions; + + protected AbpFeatureOptions Options { get; } + + private readonly IServiceProvider _serviceProvider; + + public StaticFeatureDefinitionStore( + IOptions options, + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + Options = options.Value; + + _lazyFeatureDefinitions = new Lazy>( + CreateFeatureDefinitions, + isThreadSafe: true + ); + + _lazyFeatureGroupDefinitions = new Lazy>( + CreateFeatureGroupDefinitions, + isThreadSafe: true + ); + } + + public virtual async Task GetAsync(string name) + { + Check.NotNull(name, nameof(name)); + + var feature = await GetOrNullAsync(name); + + if (feature == null) + { + throw new AbpException("Undefined feature: " + name); + } + + return feature; + } + + protected virtual Dictionary CreateFeatureDefinitions() + { + var features = new Dictionary(); + + foreach (var groupDefinition in FeatureGroupDefinitions.Values) + { + foreach (var feature in groupDefinition.Features) + { + AddFeatureToDictionaryRecursively(features, feature); + } + } + + return features; + } + + protected virtual void AddFeatureToDictionaryRecursively( + Dictionary features, + FeatureDefinition feature) + { + if (features.ContainsKey(feature.Name)) + { + throw new AbpException("Duplicate feature name: " + feature.Name); + } + + features[feature.Name] = feature; + + foreach (var child in feature.Children) + { + AddFeatureToDictionaryRecursively(features, child); + } + } + + protected virtual Dictionary CreateFeatureGroupDefinitions() + { + var context = new FeatureDefinitionContext(); + + using (var scope = _serviceProvider.CreateScope()) + { + var providers = Options + .DefinitionProviders + .Select(p => scope.ServiceProvider.GetRequiredService(p) as IFeatureDefinitionProvider) + .ToList(); + + foreach (var provider in providers) + { + provider.Define(context); + } + } + + return context.Groups; + } + + public virtual Task GetOrNullAsync(string name) + { + return Task.FromResult(FeatureDefinitions.GetOrDefault(name)); + } + + public virtual Task> GetFeaturesAsync() + { + return Task.FromResult>(FeatureDefinitions.Values.ToList()); + } + + public virtual Task> GetGroupsAsync() + { + return Task.FromResult>(FeatureGroupDefinitions.Values.ToList()); + } +} diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor.cs b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor.cs new file mode 100644 index 0000000000..d4abc25403 --- /dev/null +++ b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor.cs @@ -0,0 +1,56 @@ +using System.Linq; +using System.Text.Json.Nodes; +using Volo.Abp.DependencyInjection; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.GlobalFeatures; + +public class GlobalFeaturesSimpleStateCheckerSerializerContributor : + ISimpleStateCheckerSerializerContributor, + ISingletonDependency +{ + public const string CheckerShortName = "G"; + + public string SerializeToJson(ISimpleStateChecker checker) + where TState : IHasSimpleStateCheckers + { + if (checker is not RequireGlobalFeaturesSimpleStateChecker globalFeaturesSimpleStateChecker) + { + return null; + } + + var jsonObject = new JsonObject { + ["T"] = CheckerShortName, + ["A"] = globalFeaturesSimpleStateChecker.RequiresAll + }; + + var nameArray = new JsonArray(); + foreach (var globalFeatureName in globalFeaturesSimpleStateChecker.GlobalFeatureNames) + { + nameArray.Add(globalFeatureName); + } + + jsonObject["N"] = nameArray; + return jsonObject.ToJsonString(); + } + + public ISimpleStateChecker Deserialize(JsonObject jsonObject, TState state) + where TState : IHasSimpleStateCheckers + { + if (jsonObject["T"]?.ToString() != CheckerShortName) + { + return null; + } + + var nameArray = jsonObject["N"] as JsonArray; + if (nameArray == null) + { + throw new AbpException("'N' is not an array in the serialized state checker! JsonObject: " + jsonObject.ToJsonString()); + } + + return new RequireGlobalFeaturesSimpleStateChecker( + (bool?)jsonObject["A"] ?? false, + nameArray.Select(x => x.ToString()).ToArray() + ); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesSimpleStateChecker.cs b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesSimpleStateChecker.cs index 77fdaa0e1e..d37aba8397 100644 --- a/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesSimpleStateChecker.cs +++ b/framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/RequireGlobalFeaturesSimpleStateChecker.cs @@ -8,8 +8,8 @@ namespace Volo.Abp.GlobalFeatures; public class RequireGlobalFeaturesSimpleStateChecker : ISimpleStateChecker where TState : IHasSimpleStateCheckers { - private readonly string[] _globalFeatureNames; - private readonly bool _requiresAll; + public string[] GlobalFeatureNames { get; } + public bool RequiresAll { get; } public RequireGlobalFeaturesSimpleStateChecker(params string[] globalFeatureNames) : this(true, globalFeatureNames) @@ -20,23 +20,23 @@ public class RequireGlobalFeaturesSimpleStateChecker : ISimpleStateCheck { Check.NotNullOrEmpty(globalFeatureNames, nameof(globalFeatureNames)); - _requiresAll = requiresAll; - _globalFeatureNames = globalFeatureNames; + RequiresAll = requiresAll; + GlobalFeatureNames = globalFeatureNames; } public RequireGlobalFeaturesSimpleStateChecker(bool requiresAll, params Type[] globalFeatureNames) { Check.NotNullOrEmpty(globalFeatureNames, nameof(globalFeatureNames)); - _requiresAll = requiresAll; - _globalFeatureNames = globalFeatureNames.Select(GlobalFeatureNameAttribute.GetName).ToArray(); + RequiresAll = requiresAll; + GlobalFeatureNames = globalFeatureNames.Select(GlobalFeatureNameAttribute.GetName).ToArray(); } public Task IsEnabledAsync(SimpleStateCheckerContext context) { - var isEnabled = _requiresAll - ? _globalFeatureNames.All(x => GlobalFeatureManager.Instance.IsEnabled(x)) - : _globalFeatureNames.Any(x => GlobalFeatureManager.Instance.IsEnabled(x)); + var isEnabled = RequiresAll + ? GlobalFeatureNames.All(x => GlobalFeatureManager.Instance.IsEnabled(x)) + : GlobalFeatureNames.Any(x => GlobalFeatureManager.Instance.IsEnabled(x)); return Task.FromResult(isEnabled); } diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xml b/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xsd b/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.Dapr/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/Volo.Abp.Http.Client.Dapr.csproj b/framework/src/Volo.Abp.Http.Client.Dapr/Volo.Abp.Http.Client.Dapr.csproj new file mode 100644 index 0000000000..909fb156c8 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.Dapr/Volo.Abp.Http.Client.Dapr.csproj @@ -0,0 +1,18 @@ + + + + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpHttpClientDaprModule.cs b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpHttpClientDaprModule.cs new file mode 100644 index 0000000000..18a509d3ff --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpHttpClientDaprModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Dapr; +using Volo.Abp.Modularity; + +namespace Volo.Abp.Http.Client.Dapr; + +[DependsOn( + typeof(AbpHttpClientModule), + typeof(AbpDaprModule) +)] +public class AbpHttpClientDaprModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((_, clientBuilder) => + { + clientBuilder.AddHttpMessageHandler(); + }); + }); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs new file mode 100644 index 0000000000..e13c6dbb04 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs @@ -0,0 +1,17 @@ +using Dapr.Client; +using Microsoft.Extensions.Options; +using Volo.Abp.Dapr; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Http.Client.Dapr; + +public class AbpInvocationHandler : InvocationHandler, ITransientDependency +{ + public AbpInvocationHandler(IOptions daprOptions) + { + if (!daprOptions.Value.HttpEndpoint.IsNullOrWhiteSpace()) + { + DaprEndpoint = daprOptions.Value.HttpEndpoint; + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionHttpClientProxyExtensions.cs b/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionHttpClientProxyExtensions.cs index 4ccac104cd..57233ac972 100644 --- a/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionHttpClientProxyExtensions.cs +++ b/framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionHttpClientProxyExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Reflection; using Castle.DynamicProxy; using JetBrains.Annotations; @@ -196,6 +197,16 @@ public static class ServiceCollectionHttpClientProxyExtensions { clientBuildAction(remoteServiceConfigurationName, provider, client); } + }).ConfigurePrimaryHttpMessageHandler((provider) => + { + var handler = new HttpClientHandler { UseCookies = false }; + + foreach (var handlerAction in preOptions.ProxyClientHandlerActions) + { + handlerAction(remoteServiceConfigurationName, provider, handler); + } + + return handler; }); foreach (var clientBuildAction in preOptions.ProxyClientBuildActions) @@ -212,7 +223,7 @@ public static class ServiceCollectionHttpClientProxyExtensions } /// - /// Checks wether the type is suitable to use with the proxying. + /// Checks whether the type is suitable to use with the proxying. /// Currently the type is checked statically against some fixed conditions. /// /// Type to check diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs index 240f35fe0a..b2ffae98a5 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientBuilderOptions.cs @@ -12,11 +12,14 @@ public class AbpHttpClientBuilderOptions internal HashSet ConfiguredProxyClients { get; } public List> ProxyClientActions { get; } + + public List> ProxyClientHandlerActions { get; } public AbpHttpClientBuilderOptions() { ProxyClientBuildActions = new List>(); ConfiguredProxyClients = new HashSet(); ProxyClientActions = new List>(); + ProxyClientHandlerActions = new List>(); } } diff --git a/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/Localization/hu.json b/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/Localization/hu.json index f5e023cc77..67d6783a0b 100644 --- a/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/Localization/hu.json +++ b/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/Localization/hu.json @@ -1,17 +1,17 @@ { - "culture": "hu", - "texts": { - "DisplayName:Abp.Ldap.ServerHost": "Szerver host", - "Description:Abp.Ldap.ServerHost": "Az LDAP ksizolgáló szerver hostneve vagy IP címe", - "DisplayName:Abp.Ldap.ServerPort": "Szerver port", - "Description:Abp.Ldap.ServerPort": "LDAP kommunikáció portja", - "DisplayName:Abp.Ldap.BaseDc": "Bázis tartomány-komponens", - "Description:Abp.Ldap.BaseDc": "Bázis tartomány-komponens", - "DisplayName:Abp.Ldap.Domain": "Tartomány", - "Description:Abp.Ldap.Domain": "Tartomány", - "DisplayName:Abp.Ldap.UserName": "Felhasználónév", - "Description:Abp.Ldap.UserName": "Felhasználónév", - "DisplayName:Abp.Ldap.Password": "Jelszó", - "Description:Abp.Ldap.Password": "Jelszó" - } + "culture": "hu", + "texts": { + "DisplayName:Abp.Ldap.ServerHost": "Szerver host", + "Description:Abp.Ldap.ServerHost": "Az LDAP ksizolgáló szerver hostneve vagy IP címe", + "DisplayName:Abp.Ldap.ServerPort": "Szerver port", + "Description:Abp.Ldap.ServerPort": "LDAP kommunikáció portja", + "DisplayName:Abp.Ldap.BaseDc": "Bázis tartomány-komponens", + "Description:Abp.Ldap.BaseDc": "Bázis tartomány-komponens", + "DisplayName:Abp.Ldap.Domain": "Tartomány", + "Description:Abp.Ldap.Domain": "Tartomány", + "DisplayName:Abp.Ldap.UserName": "Felhasználónév", + "Description:Abp.Ldap.UserName": "Felhasználónév", + "DisplayName:Abp.Ldap.Password": "Jelszó", + "Description:Abp.Ldap.Password": "Jelszó" } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/AbpStringLocalizerFactoryExtensions.cs b/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/AbpStringLocalizerFactoryExtensions.cs index 896fdb6fa0..8aa2515a54 100644 --- a/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/AbpStringLocalizerFactoryExtensions.cs +++ b/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/AbpStringLocalizerFactoryExtensions.cs @@ -1,10 +1,66 @@ -namespace Microsoft.Extensions.Localization; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp; + +namespace Microsoft.Extensions.Localization; public static class AbpStringLocalizerFactoryExtensions { + [CanBeNull] public static IStringLocalizer CreateDefaultOrNull(this IStringLocalizerFactory localizerFactory) { - return (localizerFactory as IAbpStringLocalizerFactoryWithDefaultResourceSupport) + return (localizerFactory as IAbpStringLocalizerFactory) ?.CreateDefaultOrNull(); } + + [CanBeNull] + public static IStringLocalizer CreateByResourceNameOrNull( + this IStringLocalizerFactory localizerFactory, + string resourceName) + { + return (localizerFactory as IAbpStringLocalizerFactory) + ?.CreateByResourceNameOrNull(resourceName); + } + + [NotNull] + public static IStringLocalizer CreateByResourceName( + this IStringLocalizerFactory localizerFactory, + string resourceName) + { + var localizer = localizerFactory.CreateByResourceNameOrNull(resourceName); + if (localizer == null) + { + throw new AbpException("Couldn't find a localizer with given resource name: " + resourceName); + } + + return localizer; + } + + [ItemCanBeNull] + public static async Task CreateByResourceNameOrNullAsync( + this IStringLocalizerFactory localizerFactory, + string resourceName) + { + var abpLocalizerFactory = localizerFactory as IAbpStringLocalizerFactory; + if (abpLocalizerFactory == null) + { + return null; + } + + return await abpLocalizerFactory.CreateByResourceNameOrNullAsync(resourceName); + } + + [NotNull] + public async static Task CreateByResourceNameAsync( + this IStringLocalizerFactory localizerFactory, + string resourceName) + { + var localizer = await localizerFactory.CreateByResourceNameOrNullAsync(resourceName); + if (localizer == null) + { + throw new AbpException("Couldn't find a localizer with given resource name: " + resourceName); + } + + return localizer; + } } diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactory.cs b/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactory.cs new file mode 100644 index 0000000000..8f6699a13d --- /dev/null +++ b/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactory.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using JetBrains.Annotations; + +namespace Microsoft.Extensions.Localization; + +public interface IAbpStringLocalizerFactory +{ + [CanBeNull] + IStringLocalizer CreateDefaultOrNull(); + + [CanBeNull] + IStringLocalizer CreateByResourceNameOrNull([NotNull] string resourceName); + + [ItemCanBeNull] + Task CreateByResourceNameOrNullAsync([NotNull] string resourceName); +} diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactoryWithDefaultResourceSupport.cs b/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactoryWithDefaultResourceSupport.cs deleted file mode 100644 index 0ab20aec4b..0000000000 --- a/framework/src/Volo.Abp.Localization.Abstractions/Microsoft/Extensions/Localization/IAbpStringLocalizerFactoryWithDefaultResourceSupport.cs +++ /dev/null @@ -1,9 +0,0 @@ -using JetBrains.Annotations; - -namespace Microsoft.Extensions.Localization; - -public interface IAbpStringLocalizerFactoryWithDefaultResourceSupport -{ - [CanBeNull] - IStringLocalizer CreateDefaultOrNull(); -} diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/IAsyncLocalizableString.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/IAsyncLocalizableString.cs new file mode 100644 index 0000000000..b8389d546f --- /dev/null +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/IAsyncLocalizableString.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Localization; + +namespace Volo.Abp.Localization; + +public interface IAsyncLocalizableString +{ + Task LocalizeAsync(IStringLocalizerFactory stringLocalizerFactory); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs index 2aecd696ac..d04e61a257 100644 --- a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs @@ -5,4 +5,4 @@ namespace Volo.Abp.Localization; public interface ILocalizableString { LocalizedString Localize(IStringLocalizerFactory stringLocalizerFactory); -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableString.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableString.cs index 61494d609e..a98f207a55 100644 --- a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableString.cs +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableString.cs @@ -1,30 +1,134 @@ using System; +using System.Threading.Tasks; using JetBrains.Annotations; using Microsoft.Extensions.Localization; namespace Volo.Abp.Localization; -public class LocalizableString : ILocalizableString +public class LocalizableString : ILocalizableString, IAsyncLocalizableString { + [CanBeNull] + public string ResourceName { get; } + [CanBeNull] public Type ResourceType { get; } [NotNull] public string Name { get; } - public LocalizableString(Type resourceType, [NotNull] string name) + public LocalizableString([CanBeNull] Type resourceType, [NotNull] string name) { Name = Check.NotNullOrEmpty(name, nameof(name)); ResourceType = resourceType; + + if (resourceType != null) + { + ResourceName = LocalizationResourceNameAttribute.GetName(resourceType); + } + } + + public LocalizableString([NotNull] string name, [CanBeNull] string resourceName = null) + { + Name = Check.NotNullOrEmpty(name, nameof(name)); + ResourceName = resourceName; } public LocalizedString Localize(IStringLocalizerFactory stringLocalizerFactory) { - return stringLocalizerFactory.Create(ResourceType)[Name]; + var localizer = CreateStringLocalizerOrNull(stringLocalizerFactory); + if (localizer == null) + { + return new LocalizedString(Name, Name, resourceNotFound: true); + } + + var result = localizer[Name]; + + if (result.ResourceNotFound && ResourceName != null) + { + /* Search in the default resource if not found in the provided resource */ + localizer = stringLocalizerFactory.CreateDefaultOrNull(); + if (localizer != null) + { + result = localizer[Name]; + } + } + + return result; + } + + public async Task LocalizeAsync(IStringLocalizerFactory stringLocalizerFactory) + { + var localizer = await CreateStringLocalizerOrNullAsync(stringLocalizerFactory); + if (localizer == null) + { + throw new AbpException($"Set {nameof(ResourceName)} or configure the default localization resource type (in the AbpLocalizationOptions)!"); + } + + var result = localizer[Name]; + + if (result.ResourceNotFound && ResourceName != null) + { + /* Search in the default resource if not found in the provided resource */ + localizer = stringLocalizerFactory.CreateDefaultOrNull(); + if (localizer != null) + { + result = localizer[Name]; + } + } + + return result; + } + + private IStringLocalizer CreateStringLocalizerOrNull(IStringLocalizerFactory stringLocalizerFactory) + { + if (ResourceType != null) + { + return stringLocalizerFactory.Create(ResourceType); + } + + if (ResourceName != null) + { + var localizerByName = stringLocalizerFactory.CreateByResourceNameOrNull(ResourceName); + if (localizerByName != null) + { + return localizerByName; + } + } + + return stringLocalizerFactory.CreateDefaultOrNull(); + } + + private async Task CreateStringLocalizerOrNullAsync(IStringLocalizerFactory stringLocalizerFactory) + { + if (ResourceType != null) + { + return stringLocalizerFactory.Create(ResourceType); + } + + if (ResourceName != null) + { + var localizerByName = await stringLocalizerFactory.CreateByResourceNameOrNullAsync(ResourceName); + if (localizerByName != null) + { + return localizerByName; + } + } + + return stringLocalizerFactory.CreateDefaultOrNull(); } public static LocalizableString Create([NotNull] string name) { - return new LocalizableString(typeof(TResource), name); + return Create(typeof(TResource), name); + } + + public static LocalizableString Create(Type resourceType,[NotNull] string name) + { + return new LocalizableString(resourceType, name); + } + + public static LocalizableString Create([NotNull] string name, [CanBeNull] string resourceName = null) + { + return new LocalizableString(name, resourceName); } } diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableStringExtensions.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableStringExtensions.cs new file mode 100644 index 0000000000..b7cff0819f --- /dev/null +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/LocalizableStringExtensions.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Localization; + +namespace Volo.Abp.Localization; + +public static class LocalizableStringExtensions +{ + public static async Task LocalizeAsync( + this ILocalizableString localizableString, + IStringLocalizerFactory stringLocalizerFactory) + { + if (localizableString is IAsyncLocalizableString asyncLocalizableString) + { + return await asyncLocalizableString.LocalizeAsync(stringLocalizerFactory); + } + + return localizableString.Localize(stringLocalizerFactory); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 64352257f3..53e71d1c38 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -22,6 +22,8 @@ + + diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs index 61621c2479..cf5c1ebb82 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpDictionaryBasedStringLocalizer.cs @@ -4,13 +4,14 @@ using System.Collections.Immutable; using System.Globalization; using System.Linq; using System.Resources; +using System.Threading.Tasks; using Microsoft.Extensions.Localization; namespace Volo.Abp.Localization; -public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocalizerSupportsInheritance +public class AbpDictionaryBasedStringLocalizer : IAbpStringLocalizer { - public LocalizationResource Resource { get; } + public LocalizationResourceBase Resource { get; } public List BaseLocalizers { get; } @@ -20,7 +21,10 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali public virtual LocalizedString this[string name, params object[] arguments] => GetLocalizedStringFormatted(name, arguments); - public AbpDictionaryBasedStringLocalizer(LocalizationResource resource, List baseLocalizers, AbpLocalizationOptions abpLocalizationOptions) + public AbpDictionaryBasedStringLocalizer( + LocalizationResourceBase resource, + List baseLocalizers, + AbpLocalizationOptions abpLocalizationOptions) { Resource = resource; BaseLocalizers = baseLocalizers; @@ -34,16 +38,46 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali includeParentCultures ); } + + public async Task> GetAllStringsAsync(bool includeParentCultures) + { + return await GetAllStringsAsync( + CultureInfo.CurrentUICulture.Name, + includeParentCultures + ); + } - public IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers) + public IEnumerable GetAllStrings( + bool includeParentCultures, + bool includeBaseLocalizers, + bool includeDynamicContributors) { return GetAllStrings( CultureInfo.CurrentUICulture.Name, includeParentCultures, - includeBaseLocalizers + includeBaseLocalizers, + includeDynamicContributors + ); + } + + public async Task> GetAllStringsAsync( + bool includeParentCultures, + bool includeBaseLocalizers, + bool includeDynamicContributors) + { + return await GetAllStringsAsync( + CultureInfo.CurrentUICulture.Name, + includeParentCultures, + includeBaseLocalizers, + includeDynamicContributors ); } + public Task> GetSupportedCulturesAsync() + { + return Resource.Contributors.GetSupportedCulturesAsync(); + } + protected virtual LocalizedString GetLocalizedStringFormatted(string name, params object[] arguments) { return GetLocalizedStringFormatted(name, CultureInfo.CurrentUICulture.Name, arguments); @@ -84,7 +118,10 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali return value; } - protected virtual LocalizedString GetLocalizedStringOrNull(string name, string cultureName, bool tryDefaults = true) + protected virtual LocalizedString GetLocalizedStringOrNull( + string name, + string cultureName, + bool tryDefaults = true) { //Try to get from original dictionary (with country code) var strOriginal = Resource.Contributors.GetOrNull(cultureName, name); @@ -131,7 +168,67 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali protected virtual IReadOnlyList GetAllStrings( string cultureName, bool includeParentCultures = true, - bool includeBaseLocalizers = true) + bool includeBaseLocalizers = true, + bool includeDynamicContributors = true) + { + //TODO: Can be optimized (example: if it's already default dictionary, skip overriding) + + var allStrings = new Dictionary(); + + if (includeBaseLocalizers) + { + foreach (var baseLocalizer in BaseLocalizers.Select(l => l)) + { + using (CultureHelper.Use(CultureInfo.GetCultureInfo(cultureName))) + { + //TODO: Try/catch is a workaround here! + try + { + var baseLocalizedString = baseLocalizer.GetAllStrings( + includeParentCultures, + includeBaseLocalizers, // Always true, I know! + includeDynamicContributors + ); + + foreach (var localizedString in baseLocalizedString) + { + allStrings[localizedString.Name] = localizedString; + } + } + catch (MissingManifestResourceException) + { + + } + } + } + } + + if (includeParentCultures) + { + //Fill all strings from default culture + if (!Resource.DefaultCultureName.IsNullOrEmpty()) + { + Resource.Contributors.Fill(Resource.DefaultCultureName, allStrings, includeDynamicContributors); + } + + //Overwrite all strings from the language based on country culture + if (cultureName.Contains("-")) + { + Resource.Contributors.Fill(CultureHelper.GetBaseCultureName(cultureName), allStrings, includeDynamicContributors); + } + } + + //Overwrite all strings from the original culture + Resource.Contributors.Fill(cultureName, allStrings, includeDynamicContributors); + + return allStrings.Values.ToImmutableList(); + } + + protected virtual async Task> GetAllStringsAsync( + string cultureName, + bool includeParentCultures = true, + bool includeBaseLocalizers = true, + bool includeDynamicContributors = true) { //TODO: Can be optimized (example: if it's already default dictionary, skip overriding) @@ -146,7 +243,12 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali //TODO: Try/catch is a workaround here! try { - var baseLocalizedString = baseLocalizer.GetAllStrings(includeParentCultures); + var baseLocalizedString = await baseLocalizer.GetAllStringsAsync( + includeParentCultures, + includeBaseLocalizers, // Always true, I know! + includeDynamicContributors + ); + foreach (var localizedString in baseLocalizedString) { allStrings[localizedString.Name] = localizedString; @@ -165,23 +267,35 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali //Fill all strings from default culture if (!Resource.DefaultCultureName.IsNullOrEmpty()) { - Resource.Contributors.Fill(Resource.DefaultCultureName, allStrings); + await Resource.Contributors.FillAsync( + Resource.DefaultCultureName, + allStrings, + includeDynamicContributors + ); } //Overwrite all strings from the language based on country culture if (cultureName.Contains("-")) { - Resource.Contributors.Fill(CultureHelper.GetBaseCultureName(cultureName), allStrings); + await Resource.Contributors.FillAsync( + CultureHelper.GetBaseCultureName(cultureName), + allStrings, + includeDynamicContributors + ); } } //Overwrite all strings from the original culture - Resource.Contributors.Fill(cultureName, allStrings); + await Resource.Contributors.FillAsync( + cultureName, + allStrings, + includeDynamicContributors + ); return allStrings.Values.ToImmutableList(); } - public class CultureWrapperStringLocalizer : IStringLocalizer, IStringLocalizerSupportsInheritance + public class CultureWrapperStringLocalizer : IAbpStringLocalizer { private readonly string _cultureName; private readonly AbpDictionaryBasedStringLocalizer _innerLocalizer; @@ -201,9 +315,28 @@ public class AbpDictionaryBasedStringLocalizer : IStringLocalizer, IStringLocali return _innerLocalizer.GetAllStrings(_cultureName, includeParentCultures); } - public IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers) + public IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers, bool includeDynamicContributors) + { + return _innerLocalizer.GetAllStrings(_cultureName, includeParentCultures, includeBaseLocalizers, includeDynamicContributors); + } + + public Task> GetAllStringsAsync(bool includeParentCultures) + { + return _innerLocalizer.GetAllStringsAsync(includeParentCultures); + } + + public Task> GetAllStringsAsync(bool includeParentCultures, bool includeBaseLocalizers, bool includeDynamicContributors) + { + return _innerLocalizer.GetAllStringsAsync( + includeParentCultures, + includeBaseLocalizers, + includeDynamicContributors + ); + } + + public Task> GetSupportedCulturesAsync() { - return _innerLocalizer.GetAllStrings(_cultureName, includeParentCultures, includeBaseLocalizers); + return _innerLocalizer.GetSupportedCulturesAsync(); } } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs index 4ce8c32f88..85be669593 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs @@ -1,6 +1,7 @@ using Volo.Abp.Localization.Resources.AbpLocalization; using Volo.Abp.Modularity; using Volo.Abp.Settings; +using Volo.Abp.Threading; using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Localization; @@ -8,7 +9,8 @@ namespace Volo.Abp.Localization; [DependsOn( typeof(AbpVirtualFileSystemModule), typeof(AbpSettingsModule), - typeof(AbpLocalizationAbstractionsModule) + typeof(AbpLocalizationAbstractionsModule), + typeof(AbpThreadingModule) )] public class AbpLocalizationModule : AbpModule { diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs index 8201043c6e..9b3bb2c201 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerExtensions.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Reflection; +using System.Threading.Tasks; using JetBrains.Annotations; using Microsoft.Extensions.Localization; using Volo.Abp.DynamicProxy; @@ -39,14 +41,16 @@ public static class AbpStringLocalizerExtensions public static IEnumerable GetAllStrings( this IStringLocalizer stringLocalizer, bool includeParentCultures, - bool includeBaseLocalizers) + bool includeBaseLocalizers, + bool includeDynamicContributors) { - var internalLocalizer = (ProxyHelper.UnProxy(stringLocalizer) as IStringLocalizer).GetInternalLocalizer(); - if (internalLocalizer is IStringLocalizerSupportsInheritance stringLocalizerSupportsInheritance) + var internalLocalizer = ((IStringLocalizer)ProxyHelper.UnProxy(stringLocalizer)).GetInternalLocalizer(); + if (internalLocalizer is IAbpStringLocalizer abpStringLocalizer) { - return stringLocalizerSupportsInheritance.GetAllStrings( + return abpStringLocalizer.GetAllStrings( includeParentCultures, - includeBaseLocalizers + includeBaseLocalizers, + includeDynamicContributors ); } @@ -54,4 +58,59 @@ public static class AbpStringLocalizerExtensions includeParentCultures ); } + + public static async Task> GetAllStringsAsync( + this IStringLocalizer stringLocalizer, + bool includeParentCultures, + bool includeBaseLocalizers, + bool includeDynamicContributors) + { + var internalLocalizer = ((IStringLocalizer)ProxyHelper.UnProxy(stringLocalizer)).GetInternalLocalizer(); + if (internalLocalizer is IAbpStringLocalizer abpStringLocalizer) + { + return await abpStringLocalizer.GetAllStringsAsync( + includeParentCultures, + includeBaseLocalizers, + includeDynamicContributors + ); + } + + return stringLocalizer.GetAllStrings( + includeParentCultures + ); + } + + public static async Task> GetSupportedCulturesAsync(this IStringLocalizer localizer) + { + var internalLocalizer = ((IStringLocalizer)ProxyHelper.UnProxy(localizer)).GetInternalLocalizer(); + if (internalLocalizer is IAbpStringLocalizer abpStringLocalizer) + { + return await abpStringLocalizer.GetSupportedCulturesAsync(); + } + + return Array.Empty(); + } + + public static Task> GetAllStringsAsync( + this IStringLocalizer localizer) + { + return localizer.GetAllStringsAsync(includeParentCultures: true); + } + + public static Task> GetAllStringsAsync( + this IStringLocalizer localizer, + bool includeParentCultures) + { + Check.NotNull(localizer, nameof(localizer)); + + var internalLocalizer = ((IStringLocalizer)ProxyHelper.UnProxy(localizer)).GetInternalLocalizer(); + if (internalLocalizer is IAbpStringLocalizer abpStringLocalizer) + { + return abpStringLocalizer.GetAllStringsAsync(includeParentCultures: includeParentCultures); + } + + return Task.FromResult( + localizer.GetAllStrings(includeParentCultures: true) + ); + } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs index 3f47fd779d..b89a54abd9 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpStringLocalizerFactory.cs @@ -2,60 +2,182 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; +using Volo.Abp.Localization.External; +using Volo.Abp.Threading; namespace Volo.Abp.Localization; -public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLocalizerFactoryWithDefaultResourceSupport +public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLocalizerFactory { protected internal AbpLocalizationOptions AbpLocalizationOptions { get; } protected ResourceManagerStringLocalizerFactory InnerFactory { get; } protected IServiceProvider ServiceProvider { get; } - protected ConcurrentDictionary LocalizerCache { get; } + protected IExternalLocalizationStore ExternalLocalizationStore { get; } + protected ConcurrentDictionary LocalizerCache { get; } + protected SemaphoreSlim LocalizerCacheSemaphore { get; } = new(1, 1); - //TODO: It's better to use decorator pattern for IStringLocalizerFactory instead of getting ResourceManagerStringLocalizerFactory as a dependency. public AbpStringLocalizerFactory( ResourceManagerStringLocalizerFactory innerFactory, IOptions abpLocalizationOptions, - IServiceProvider serviceProvider) + IServiceProvider serviceProvider, + IExternalLocalizationStore externalLocalizationStore) { InnerFactory = innerFactory; ServiceProvider = serviceProvider; + ExternalLocalizationStore = externalLocalizationStore; AbpLocalizationOptions = abpLocalizationOptions.Value; - LocalizerCache = new ConcurrentDictionary(); + LocalizerCache = new ConcurrentDictionary(); } public virtual IStringLocalizer Create(Type resourceType) { - var resource = AbpLocalizationOptions.Resources.GetOrDefault(resourceType); + return Create(resourceType, lockCache: true); + } + + private IStringLocalizer Create(Type resourceType, bool lockCache) + { + var resource = AbpLocalizationOptions.Resources.GetOrNull(resourceType); if (resource == null) { return InnerFactory.Create(resourceType); } - if (LocalizerCache.TryGetValue(resourceType, out var cacheItem)) + return CreateInternal(resource.ResourceName, resource, lockCache); + } + + public IStringLocalizer CreateByResourceNameOrNull(string resourceName) + { + return CreateByResourceNameOrNullInternal(resourceName, lockCache: true); + } + + private IStringLocalizer CreateByResourceNameOrNullInternal( + string resourceName, + bool lockCache) + { + var resource = AbpLocalizationOptions.Resources.GetOrDefault(resourceName); + if (resource == null) + { + resource = ExternalLocalizationStore.GetResourceOrNull(resourceName); + if (resource == null) + { + return null; + } + } + + return CreateInternal(resourceName, resource, lockCache); + } + + public Task CreateByResourceNameOrNullAsync(string resourceName) + { + return CreateByResourceNameOrNullInternalAsync(resourceName, lockCache: true); + } + + private async Task CreateByResourceNameOrNullInternalAsync( + string resourceName, + bool lockCache) + { + var resource = AbpLocalizationOptions.Resources.GetOrDefault(resourceName); + if (resource == null) + { + resource = await ExternalLocalizationStore.GetResourceOrNullAsync(resourceName); + if (resource == null) + { + return null; + } + } + + return await CreateInternalAsync(resourceName, resource, lockCache); + } + + private IStringLocalizer CreateInternal( + string resourceName, + LocalizationResourceBase resource, + bool lockCache) + { + if (LocalizerCache.TryGetValue(resourceName, out var cacheItem)) { return cacheItem.Localizer; } - lock (LocalizerCache) + IStringLocalizer GetOrCreateLocalizer() { + // Double check + if (LocalizerCache.TryGetValue(resourceName, out var cacheItem2)) + { + return cacheItem2.Localizer; + } + return LocalizerCache.GetOrAdd( - resourceType, + resourceName, _ => CreateStringLocalizerCacheItem(resource) ).Localizer; } + + if (lockCache) + { + using (LocalizerCacheSemaphore.Lock()) + { + return GetOrCreateLocalizer(); + } + } + else + { + return GetOrCreateLocalizer(); + } } + + private async Task CreateInternalAsync( + string resourceName, + LocalizationResourceBase resource, + bool lockCache) + { + if (LocalizerCache.TryGetValue(resourceName, out var cacheItem)) + { + return cacheItem.Localizer; + } - private StringLocalizerCacheItem CreateStringLocalizerCacheItem(LocalizationResource resource) + async Task GetOrCreateLocalizerAsync() + { + // Double check + if (LocalizerCache.TryGetValue(resourceName, out var cacheItem2)) + { + return cacheItem2.Localizer; + } + + var newCacheItem = await CreateStringLocalizerCacheItemAsync(resource); + LocalizerCache[resourceName] = newCacheItem; + return newCacheItem.Localizer; + } + + if (lockCache) + { + using (await LocalizerCacheSemaphore.LockAsync()) + { + return await GetOrCreateLocalizerAsync(); + } + } + else + { + return await GetOrCreateLocalizerAsync(); + } + } + + private StringLocalizerCacheItem CreateStringLocalizerCacheItem(LocalizationResourceBase resource) { - foreach (var globalContributor in AbpLocalizationOptions.GlobalContributors) + foreach (var globalContributorType in AbpLocalizationOptions.GlobalContributors) { - resource.Contributors.Add((ILocalizationResourceContributor)Activator.CreateInstance(globalContributor)); + resource.Contributors.Add( + Activator + .CreateInstance(globalContributorType) + .As() + ); } var context = new LocalizationResourceInitializationContext(resource, ServiceProvider); @@ -68,7 +190,49 @@ public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLoca return new StringLocalizerCacheItem( new AbpDictionaryBasedStringLocalizer( resource, - resource.BaseResourceTypes.Select(Create).ToList(), + resource + .BaseResourceNames + .Select(x => CreateByResourceNameOrNullInternal(x, lockCache: false)) + .Where(x => x != null) + .ToList(), + AbpLocalizationOptions + ) + ); + } + + private async Task CreateStringLocalizerCacheItemAsync(LocalizationResourceBase resource) + { + foreach (var globalContributorType in AbpLocalizationOptions.GlobalContributors) + { + resource.Contributors.Add( + Activator + .CreateInstance(globalContributorType) + .As() + ); + } + + var context = new LocalizationResourceInitializationContext(resource, ServiceProvider); + + foreach (var contributor in resource.Contributors) + { + contributor.Initialize(context); + } + + var baseLocalizers = new List(); + + foreach (var baseResourceName in resource.BaseResourceNames) + { + var baseLocalizer = await CreateByResourceNameOrNullInternalAsync(baseResourceName, lockCache: false); + if (baseLocalizer != null) + { + baseLocalizers.Add(baseLocalizer); + } + } + + return new StringLocalizerCacheItem( + new AbpDictionaryBasedStringLocalizer( + resource, + baseLocalizers, AbpLocalizationOptions ) ); @@ -76,8 +240,6 @@ public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLoca public virtual IStringLocalizer Create(string baseName, string location) { - //TODO: Investigate when this is called? - return InnerFactory.Create(baseName, location); } @@ -106,4 +268,4 @@ public class AbpStringLocalizerFactory : IStringLocalizerFactory, IAbpStringLoca return Create(AbpLocalizationOptions.DefaultResourceType); } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/IExternalLocalizationStore.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/IExternalLocalizationStore.cs new file mode 100644 index 0000000000..cd48bb1bd9 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/IExternalLocalizationStore.cs @@ -0,0 +1,17 @@ +using System.Threading.Tasks; +using JetBrains.Annotations; + +namespace Volo.Abp.Localization.External; + +public interface IExternalLocalizationStore +{ + [CanBeNull] + LocalizationResourceBase GetResourceOrNull([NotNull] string resourceName); + + [ItemCanBeNull] + Task GetResourceOrNullAsync([NotNull] string resourceName); + + Task GetResourceNamesAsync(); + + Task GetResourcesAsync(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/NullExternalLocalizationStore.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/NullExternalLocalizationStore.cs new file mode 100644 index 0000000000..508f947981 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/External/NullExternalLocalizationStore.cs @@ -0,0 +1,28 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Localization.External; + +public class NullExternalLocalizationStore : IExternalLocalizationStore, ISingletonDependency +{ + public LocalizationResourceBase GetResourceOrNull(string resourceName) + { + return null; + } + + public Task GetResourceOrNullAsync(string resourceName) + { + return Task.FromResult(null); + } + + public Task GetResourceNamesAsync() + { + return Task.FromResult(Array.Empty()); + } + + public Task GetResourcesAsync() + { + return Task.FromResult(Array.Empty()); + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IAbpStringLocalizer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IAbpStringLocalizer.cs new file mode 100644 index 0000000000..59fbbcb7b4 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IAbpStringLocalizer.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Extensions.Localization; + +namespace Volo.Abp.Localization; + +public interface IAbpStringLocalizer : IStringLocalizer +{ + IEnumerable GetAllStrings( + bool includeParentCultures, + bool includeBaseLocalizers, + bool includeDynamicContributors + ); + + Task> GetAllStringsAsync( + bool includeParentCultures + ); + + Task> GetAllStringsAsync( + bool includeParentCultures, + bool includeBaseLocalizers, + bool includeDynamicContributors + ); + + Task> GetSupportedCulturesAsync(); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizableStringSerializer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizableStringSerializer.cs new file mode 100644 index 0000000000..6f7a487b6c --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizableStringSerializer.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.Localization; + +public interface ILocalizableStringSerializer +{ + string Serialize(ILocalizableString localizableString); + + ILocalizableString Deserialize(string value); +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizationResourceContributor.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizationResourceContributor.cs index bfccb660a0..2a79d20821 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizationResourceContributor.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizationResourceContributor.cs @@ -1,13 +1,20 @@ using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.Extensions.Localization; namespace Volo.Abp.Localization; public interface ILocalizationResourceContributor { + bool IsDynamic { get; } + void Initialize(LocalizationResourceInitializationContext context); LocalizedString GetOrNull(string cultureName, string name); void Fill(string cultureName, Dictionary dictionary); + + Task FillAsync(string cultureName, Dictionary dictionary); + + Task> GetSupportedCulturesAsync(); } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs deleted file mode 100644 index cf0bff3631..0000000000 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/IStringLocalizerSupportsInheritance.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; -using Microsoft.Extensions.Localization; - -namespace Volo.Abp.Localization; - -public interface IStringLocalizerSupportsInheritance -{ - IEnumerable GetAllStrings(bool includeParentCultures, bool includeBaseLocalizers); -} diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizableStringSerializer.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizableStringSerializer.cs new file mode 100644 index 0000000000..5006d62ea8 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizableStringSerializer.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Localization; + +public class LocalizableStringSerializer : ILocalizableStringSerializer, ITransientDependency +{ + protected AbpLocalizationOptions LocalizationOptions { get; } + + public LocalizableStringSerializer(IOptions localizationOptions) + { + LocalizationOptions = localizationOptions.Value; + } + + public virtual string Serialize(ILocalizableString localizableString) + { + if (localizableString == null) + { + return null; + } + + if (localizableString is LocalizableString realLocalizableString) + { + return $"L:{realLocalizableString.ResourceName},{realLocalizableString.Name}"; + } + + if (localizableString is FixedLocalizableString fixedLocalizableString) + { + return $"F:{fixedLocalizableString.Value}"; + } + + throw new AbpException($"Unknown {nameof(ILocalizableString)} type: {localizableString.GetType().FullName}"); + } + + public virtual ILocalizableString Deserialize(string value) + { + if (value.IsNullOrEmpty() || + value.Length < 3 || + value[1] != ':') + { + return new FixedLocalizableString(value); + } + + var type = value[0]; + switch (type) + { + case 'F': + return new FixedLocalizableString(value.Substring(2)); + case 'L': + var commaPosition = value.IndexOf(',', 2); + if (commaPosition == -1) + { + throw new AbpException("Invalid LocalizableString value: " + value); + } + + var resourceName = value.Substring(2, commaPosition - 2); + var name = value.Substring(commaPosition + 1); + if (name.IsNullOrWhiteSpace()) + { + throw new AbpException("Invalid LocalizableString value: " + value); + } + + return LocalizableString.Create(name, resourceName); + default: + return new FixedLocalizableString(value); + } + } +} diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResource.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResource.cs index a2202dc959..7a55f1f8a3 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResource.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResource.cs @@ -5,39 +5,21 @@ using JetBrains.Annotations; namespace Volo.Abp.Localization; -public class LocalizationResource +public class LocalizationResource : LocalizationResourceBase { [NotNull] public Type ResourceType { get; } - [NotNull] - public string ResourceName => LocalizationResourceNameAttribute.GetName(ResourceType); - - [CanBeNull] - public string DefaultCultureName { get; set; } - - [NotNull] - public LocalizationResourceContributorList Contributors { get; } - - [NotNull] - public List BaseResourceTypes { get; } - public LocalizationResource( [NotNull] Type resourceType, [CanBeNull] string defaultCultureName = null, [CanBeNull] ILocalizationResourceContributor initialContributor = null) + : base( + LocalizationResourceNameAttribute.GetName(resourceType), + defaultCultureName, + initialContributor) { ResourceType = Check.NotNull(resourceType, nameof(resourceType)); - DefaultCultureName = defaultCultureName; - - BaseResourceTypes = new List(); - Contributors = new LocalizationResourceContributorList(); - - if (initialContributor != null) - { - Contributors.Add(initialContributor); - } - AddBaseResourceTypes(); } @@ -51,8 +33,8 @@ public class LocalizationResource { foreach (var baseResourceType in descriptor.GetInheritedResourceTypes()) { - BaseResourceTypes.AddIfNotContains(baseResourceType); + BaseResourceNames.AddIfNotContains(LocalizationResourceNameAttribute.GetName(baseResourceType)); } } } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceBase.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceBase.cs new file mode 100644 index 0000000000..a7ec4fb93b --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceBase.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using JetBrains.Annotations; + +namespace Volo.Abp.Localization; + +public abstract class LocalizationResourceBase +{ + [NotNull] + public string ResourceName { get; } + + public List BaseResourceNames { get; } + + [CanBeNull] + public string DefaultCultureName { get; set; } + + [NotNull] + public LocalizationResourceContributorList Contributors { get; } + + public LocalizationResourceBase( + [NotNull] string resourceName, + [CanBeNull] string defaultCultureName = null, + [CanBeNull] ILocalizationResourceContributor initialContributor = null) + { + ResourceName = Check.NotNullOrWhiteSpace(resourceName, nameof(resourceName)); + DefaultCultureName = defaultCultureName; + + Contributors = new LocalizationResourceContributorList(); + BaseResourceNames = new(); + + if (initialContributor != null) + { + Contributors.Add(initialContributor); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceContributorList.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceContributorList.cs index d52fe78943..6df15920da 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceContributorList.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceContributorList.cs @@ -1,15 +1,24 @@ using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Microsoft.Extensions.Localization; namespace Volo.Abp.Localization; public class LocalizationResourceContributorList : List { - public LocalizedString GetOrNull(string cultureName, string name) + public LocalizedString GetOrNull( + string cultureName, + string name, + bool includeDynamicContributors = true) { foreach (var contributor in this.Select(x => x).Reverse()) { + if (!includeDynamicContributors && contributor.IsDynamic) + { + continue; + } + var localString = contributor.GetOrNull(cultureName, name); if (localString != null) { @@ -20,11 +29,47 @@ public class LocalizationResourceContributorList : List dictionary) + public void Fill( + string cultureName, + Dictionary dictionary, + bool includeDynamicContributors = true) { foreach (var contributor in this) { + if (!includeDynamicContributors && contributor.IsDynamic) + { + continue; + } + contributor.Fill(cultureName, dictionary); } } + + public async Task FillAsync( + string cultureName, + Dictionary dictionary, + bool includeDynamicContributors = true) + { + foreach (var contributor in this) + { + if (!includeDynamicContributors && contributor.IsDynamic) + { + continue; + } + + await contributor.FillAsync(cultureName, dictionary); + } + } + + internal async Task> GetSupportedCulturesAsync() + { + var cultures = new List(); + + foreach (var contributor in this) + { + cultures.AddRange(await contributor.GetSupportedCulturesAsync()); + } + + return cultures; + } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceDictionary.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceDictionary.cs index e394e01202..4a88eac199 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceDictionary.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceDictionary.cs @@ -4,8 +4,10 @@ using JetBrains.Annotations; namespace Volo.Abp.Localization; -public class LocalizationResourceDictionary : Dictionary +public class LocalizationResourceDictionary : Dictionary { + private readonly Dictionary _resourcesByTypes = new(); + public LocalizationResource Add([CanBeNull] string defaultCultureName = null) { return Add(typeof(TResouce), defaultCultureName); @@ -13,19 +15,41 @@ public class LocalizationResourceDictionary : Dictionary() + public LocalizationResourceBase Get() { var resourceType = typeof(TResource); - var resource = this.GetOrDefault(resourceType); + var resource = _resourcesByTypes.GetOrDefault(resourceType); if (resource == null) { throw new AbpException("Can not find a resource with given type: " + resourceType.AssemblyQualifiedName); @@ -33,4 +57,36 @@ public class LocalizationResourceDictionary : Dictionary( + [NotNull] this TLocalizationResource localizationResource, [NotNull] string virtualPath) + where TLocalizationResource : LocalizationResourceBase { Check.NotNull(localizationResource, nameof(localizationResource)); Check.NotNull(virtualPath, nameof(virtualPath)); @@ -21,16 +22,35 @@ public static class LocalizationResourceExtensions return localizationResource; } - public static LocalizationResource AddBaseTypes( - [NotNull] this LocalizationResource localizationResource, + public static TLocalizationResource AddBaseTypes( + [NotNull] this TLocalizationResource localizationResource, [NotNull] params Type[] types) + where TLocalizationResource : LocalizationResourceBase { Check.NotNull(localizationResource, nameof(localizationResource)); Check.NotNull(types, nameof(types)); foreach (var type in types) { - localizationResource.BaseResourceTypes.AddIfNotContains(type); + localizationResource + .BaseResourceNames + .AddIfNotContains(LocalizationResourceNameAttribute.GetName(type)); + } + + return localizationResource; + } + + public static TLocalizationResource AddBaseResources( + [NotNull] this TLocalizationResource localizationResource, + [NotNull] params string[] baseResourceNames) + where TLocalizationResource : LocalizationResourceBase + { + Check.NotNull(localizationResource, nameof(localizationResource)); + Check.NotNull(baseResourceNames, nameof(baseResourceNames)); + + foreach (var baseResourceName in baseResourceNames) + { + localizationResource.BaseResourceNames.AddIfNotContains(baseResourceName); } return localizationResource; diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceInitializationContext.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceInitializationContext.cs index 845938efb2..7f26466877 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceInitializationContext.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceInitializationContext.cs @@ -4,11 +4,11 @@ namespace Volo.Abp.Localization; public class LocalizationResourceInitializationContext { - public LocalizationResource Resource { get; } + public LocalizationResourceBase Resource { get; } public IServiceProvider ServiceProvider { get; } - public LocalizationResourceInitializationContext(LocalizationResource resource, IServiceProvider serviceProvider) + public LocalizationResourceInitializationContext(LocalizationResourceBase resource, IServiceProvider serviceProvider) { Resource = resource; ServiceProvider = serviceProvider; diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/NonTypedLocalizationResource.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/NonTypedLocalizationResource.cs new file mode 100644 index 0000000000..2a8300d522 --- /dev/null +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/NonTypedLocalizationResource.cs @@ -0,0 +1,17 @@ +using JetBrains.Annotations; + +namespace Volo.Abp.Localization; + +public class NonTypedLocalizationResource : LocalizationResourceBase +{ + public NonTypedLocalizationResource( + [NotNull] string resourceName, + [CanBeNull] string defaultCultureName = null, + [CanBeNull] ILocalizationResourceContributor initialContributor = null + ) : base( + resourceName, + defaultCultureName, + initialContributor) + { + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/hu.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/hu.json index d355c69ee3..3e5cf52cca 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/hu.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpLocalization/hu.json @@ -1,7 +1,7 @@ { - "culture": "hu", - "texts": { - "DisplayName:Abp.Localization.DefaultLanguage": "Alapértelmezett nyelv", - "Description:Abp.Localization.DefaultLanguage": "Az alkalmazás alapértelmezett nyelve." - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "DisplayName:Abp.Localization.DefaultLanguage": "Alapértelmezett nyelv", + "Description:Abp.Localization.DefaultLanguage": "Az alkalmazás alapértelmezett nyelve." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs index 1ac41dba06..15b45efaff 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/VirtualFiles/VirtualFileLocalizationResourceContributorBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Localization; @@ -11,6 +12,8 @@ namespace Volo.Abp.Localization.VirtualFiles; public abstract class VirtualFileLocalizationResourceContributorBase : ILocalizationResourceContributor { + public bool IsDynamic => false; + private readonly string _virtualPath; private IVirtualFileProvider _virtualFileProvider; private Dictionary _dictionaries; @@ -37,6 +40,17 @@ public abstract class VirtualFileLocalizationResourceContributorBase : ILocaliza GetDictionaries().GetOrDefault(cultureName)?.Fill(dictionary); } + public Task FillAsync(string cultureName, Dictionary dictionary) + { + Fill(cultureName, dictionary); + return Task.CompletedTask; + } + + public Task> GetSupportedCulturesAsync() + { + return Task.FromResult((IEnumerable)GetDictionaries().Keys); + } + private Dictionary GetDictionaries() { var dictionaries = _dictionaries; diff --git a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs index 4180121a9f..61bb9745e2 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDbRepository.cs @@ -159,19 +159,16 @@ public class MemoryDbRepository : RepositoryBase : RepositoryBase x.IsDeleted, () => true); (await GetCollectionAsync()).Update(entity); } else diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 0485dd74bc..e128c8dee8 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -294,7 +294,7 @@ public class MongoDbRepository if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && !IsHardDeleted(entity)) { - ((ISoftDelete)entity).IsDeleted = true; + ObjectHelper.TrySetProperty(((ISoftDelete)entity), x => x.IsDeleted, () => true); ApplyAbpConceptsForDeletedEntity(entity); ReplaceOneResult result; @@ -365,8 +365,7 @@ public class MongoDbRepository { if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)) && !IsHardDeleted(entity)) { - ((ISoftDelete)entity).IsDeleted = true; - + ObjectHelper.TrySetProperty(((ISoftDelete)entity), x => x.IsDeleted, () => true); softDeletedEntities.Add(entity, SetNewConcurrencyStamp(entity)); } else @@ -598,13 +597,11 @@ public class MongoDbRepository private void TriggerEntityCreateEvents(TEntity entity) { - EntityChangeEventHelper.PublishEntityCreatingEvent(entity); EntityChangeEventHelper.PublishEntityCreatedEvent(entity); } protected virtual void TriggerEntityUpdateEvents(TEntity entity) { - EntityChangeEventHelper.PublishEntityUpdatingEvent(entity); EntityChangeEventHelper.PublishEntityUpdatedEvent(entity); } @@ -617,7 +614,6 @@ public class MongoDbRepository protected virtual void TriggerEntityDeleteEvents(TEntity entity) { - EntityChangeEventHelper.PublishEntityDeletingEvent(entity); EntityChangeEventHelper.PublishEntityDeletedEvent(entity); } diff --git a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancySides.cs b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancySides.cs index bf094c6bc3..0b848554bb 100644 --- a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancySides.cs +++ b/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenancySides.cs @@ -6,7 +6,7 @@ namespace Volo.Abp.MultiTenancy; /// Represents sides in a multi tenancy application. /// [Flags] -public enum MultiTenancySides +public enum MultiTenancySides : byte { /// /// Tenant side. diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionaryExtensions.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionaryExtensions.cs index b97b0056e9..d5de504afc 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionaryExtensions.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/ExtraPropertyDictionaryExtensions.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; namespace Volo.Abp.Data; @@ -26,4 +27,28 @@ public static class ExtraPropertyDictionaryExtensions extraPropertyDictionary[key] = Enum.Parse(enumType, extraPropertyDictionary[key].ToString(), ignoreCase: true); return extraPropertyDictionary[key]; } -} + + public static bool HasSameItems( + [NotNull] this ExtraPropertyDictionary dictionary, + [NotNull] ExtraPropertyDictionary otherDictionary) + { + Check.NotNull(dictionary, nameof(dictionary)); + Check.NotNull(otherDictionary, nameof(otherDictionary)); + + if (dictionary.Count != otherDictionary.Count) + { + return false; + } + + foreach (var key in dictionary.Keys) + { + if (!otherDictionary.ContainsKey(key) || + dictionary[key]?.ToString() != otherDictionary[key]?.ToString()) + { + return false; + } + } + + return true; + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/HasExtraPropertiesExtensions.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/HasExtraPropertiesExtensions.cs index 0bd64d55f1..db543bb67f 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/HasExtraPropertiesExtensions.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/Data/HasExtraPropertiesExtensions.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Linq; +using JetBrains.Annotations; using Volo.Abp.ObjectExtending; using Volo.Abp.Reflection; @@ -121,4 +122,14 @@ public static class HasExtraPropertiesExtensions source.RemoveProperty(property.Name); } } + + public static bool HasSameExtraProperties( + [NotNull] this IHasExtraProperties source, + [NotNull] IHasExtraProperties other) + { + Check.NotNull(source, nameof(source)); + Check.NotNull(other, nameof(other)); + + return source.ExtraProperties.HasSameItems(other.ExtraProperties); + } } diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyConfigurationExtensions.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyConfigurationExtensions.cs index 8b9dca76be..085e486756 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyConfigurationExtensions.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/Modularity/ExtensionPropertyConfigurationExtensions.cs @@ -8,20 +8,18 @@ public static class ExtensionPropertyConfigurationExtensions public static string GetLocalizationResourceNameOrNull( this ExtensionPropertyConfiguration property) { - var resourceType = property.GetLocalizationResourceTypeOrNull(); - if (resourceType == null) + if (property.DisplayName is LocalizableString localizableString) { - return null; + return localizableString.ResourceName; } - return LocalizationResourceNameAttribute.GetName(resourceType); + return null; } public static Type GetLocalizationResourceTypeOrNull( this ExtensionPropertyConfiguration property) { - if (property.DisplayName != null && - property.DisplayName is LocalizableString localizableString) + if (property.DisplayName is LocalizableString localizableString) { return localizableString.ResourceType; } diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/QueueDeclareConfiguration.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/QueueDeclareConfiguration.cs index 36f638668c..4b03c788c6 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/QueueDeclareConfiguration.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/QueueDeclareConfiguration.cs @@ -13,6 +13,8 @@ public class QueueDeclareConfiguration public bool Exclusive { get; set; } public bool AutoDelete { get; set; } + + public ushort? PrefetchCount { get; set; } public IDictionary Arguments { get; } @@ -20,13 +22,15 @@ public class QueueDeclareConfiguration [NotNull] string queueName, bool durable = true, bool exclusive = false, - bool autoDelete = false) + bool autoDelete = false, + ushort? prefetchCount = null) { QueueName = queueName; Durable = durable; Exclusive = exclusive; AutoDelete = autoDelete; Arguments = new Dictionary(); + PrefetchCount = prefetchCount; } public virtual QueueDeclareOk Declare(IModel channel) diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs index 8ce184295a..5c45b6aefc 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/RabbitMqMessageConsumer.cs @@ -165,9 +165,14 @@ public class RabbitMqMessageConsumer : IRabbitMqMessageConsumer, ITransientDepen arguments: Queue.Arguments ); + if (Queue.PrefetchCount.HasValue) + { + Channel.BasicQos(0, Queue.PrefetchCount.Value, false); + } + var consumer = new AsyncEventingBasicConsumer(Channel); consumer.Received += HandleIncomingMessageAsync; - + Channel.BasicConsume( queue: Queue.QueueName, autoAck: false, diff --git a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/NullCancellationTokenProvider.cs b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/NullCancellationTokenProvider.cs index 8f8113ba0d..2da06632cd 100644 --- a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/NullCancellationTokenProvider.cs +++ b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/NullCancellationTokenProvider.cs @@ -4,7 +4,7 @@ namespace Volo.Abp.Threading; public class NullCancellationTokenProvider : CancellationTokenProviderBase { - public static NullCancellationTokenProvider Instance { get; } = new NullCancellationTokenProvider(); + public static NullCancellationTokenProvider Instance { get; } = new(); public override CancellationToken Token => OverrideValue?.CancellationToken ?? CancellationToken.None; diff --git a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/hu.json b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/hu.json index 7902d093a8..42701a7537 100644 --- a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/hu.json +++ b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/Localization/hu.json @@ -1,8 +1,7 @@ { - "culture": "hu", - "texts": { - "DisplayName:Abp.Timing.Timezone": "Időzóna", - "Description:Abp.Timing.Timezone": "Alkalmazás időzónája" - } + "culture": "hu", + "texts": { + "DisplayName:Abp.Timing.Timezone": "Időzóna", + "Description:Abp.Timing.Timezone": "Alkalmazás időzónája" } - \ No newline at end of file +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/hu.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/hu.json index c391e23db2..ec8b2dd2ec 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/hu.json +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/hu.json @@ -1,6 +1,6 @@ { - "culture": "hu", - "texts": { - "Menu:Administration": "Adminisztráció" - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "Menu:Administration": "Adminisztráció" + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs index d325708175..aa933c6e09 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/MenuManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; @@ -13,11 +14,11 @@ namespace Volo.Abp.UI.Navigation; public class MenuManager : IMenuManager, ITransientDependency { protected AbpNavigationOptions Options { get; } - protected IHybridServiceScopeFactory ServiceScopeFactory { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } protected ISimpleStateCheckerManager SimpleStateCheckerManager { get; } public MenuManager( IOptions options, - IHybridServiceScopeFactory serviceScopeFactory, + IServiceScopeFactory serviceScopeFactory, ISimpleStateCheckerManager simpleStateCheckerManager) { Options = options.Value; diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json index 7e667c1bbc..4717b1fe9b 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ar.json @@ -11,7 +11,7 @@ "Close": "أغلق", "Save": "حفظ", "SavingWithThreeDot": "حفظ...", - "Actions": "أجراءات", + "Actions": "الإجراءات", "Delete": "حذف", "SuccessfullyDeleted": "تم الحذف بنجاح", "Edit": "تعديل", @@ -50,4 +50,4 @@ "ItemWillBeDeletedMessage": "سوف يتم حذف هذا البند!", "ManageYourAccount": "إدارة حسابك" } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json index aa915a704f..03855ec698 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/pt-BR.json @@ -1,10 +1,10 @@ { "culture": "pt-BR", "texts": { - "Languages": "línguas", + "Languages": "Idiomas", "AreYouSure": "Você tem certeza?", "Cancel": "Cancelar", - "Clear": "Claro", + "Clear": "Limpar", "Yes": "Sim", "No": "Não", "Ok": "OK", @@ -16,7 +16,7 @@ "SuccessfullyDeleted": "Excluído com sucesso", "Edit": "Editar", "Refresh": "Atualizar", - "Language": "Língua", + "Language": "Idioma", "LoadMore": "Carregar mais", "ProcessingWithThreeDot": "Processando...", "LoadingWithThreeDot": "Carregando...", diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ro-RO.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ro-RO.json index 94e56a66f3..7064064671 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ro-RO.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/ro-RO.json @@ -31,14 +31,14 @@ "PagerPrevious": "Anterior", "PagerFirst": "Primul", "PagerLast": "Ultimul", - "PagerInfo": "Afişate _START_ to _END_ of _TOTAL_ înregistrări", - "PagerInfo{0}{1}{2}": "Afişate {0} to {1} of {2} înregistrări", - "PagerInfoEmpty": "Afişate 0 to 0 of 0 înregistrări", + "PagerInfo": "Afişate de la _START_ la _END_ din _TOTAL_ înregistrări", + "PagerInfo{0}{1}{2}": "Afişate de la {0} la {1} din {2} înregistrări", + "PagerInfoEmpty": "Afişate 0 din 0 înregistrări", "PagerInfoFiltered": "(filtrate de la _MAX_ înregistrări totale)", "NoDataAvailableInDatatable": "Nicio informaţie disponibilă", "Total": "total", "Selected": "selectate", - "PagerShowMenuEntries": "Arată _MENU_ intrări", + "PagerShowMenuEntries": "Afişează _MENU_ intrări", "DatatableActionDropdownDefaultText": "Acţiuni", "ChangePassword": "Schimbă parola", "PersonalInfo": "Profilul meu", @@ -50,4 +50,4 @@ "ItemWillBeDeletedMessage": "Acest articol va fi şters!", "ManageYourAccount": "Administraţi-vă contul" } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs similarity index 89% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs index 68851c1860..d5ba4aa239 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/AbpLayoutHookOptions.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/AbpLayoutHookOptions.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class AbpLayoutHookOptions { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs similarity index 84% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs index e2bb26dac5..db4ca39466 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookInfo.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookInfo.cs @@ -1,11 +1,11 @@ using System; -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class LayoutHookInfo { /// - /// ViewComponent type. + /// Component type. /// public Type ComponentType { get; } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs similarity index 79% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs index fbc73d8dad..107ad6990a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHookViewModel.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public class LayoutHookViewModel { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs similarity index 88% rename from framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs rename to framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs index 588872c46b..fafab40161 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Components/LayoutHook/LayoutHooks.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHooks.cs @@ -1,4 +1,4 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +namespace Volo.Abp.Ui.LayoutHooks; public static class LayoutHooks { diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/hu.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/hu.json index b956b72f96..3db0f6f5c0 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/hu.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/hu.json @@ -1,34 +1,36 @@ { - "culture": "hu", - "texts": { - "'{0}' and '{1}' do not match.": "'{0}' és '{1}' nem egyforma.", - "The {0} field is not a valid credit card number.": "A {0} érvényes bankkártya szám.", - "{0} is not valid.": "{0} nem érvényes.", - "The {0} field is not a valid e-mail address.": "A {0} nem érvényes email cím.", - "The {0} field only accepts files with the following extensions: {1}": "A {0} mező csak olyan fileokat tartalmazhat melynek kiterjesztése ezek: {1}", - "The field {0} must be a string or array type with a maximum length of '{1}'.": "A {0} mező szöveg vagy felsorolás típusú lehet '{1}' maximum hosszal.", - "The field {0} must be a string or array type with a minimum length of '{1}'.": "A {0} mező szöveg vagy felsorolás típusú lehet '{1}' minimum hosszal.", - "The {0} field is not a valid phone number.": "A {0} nem érvényes telefonszám.", - "The field {0} must be between {1} and {2}.": "A {0} értéke {1} és {2} között kell legyen.", - "The field {0} must match the regular expression '{1}'.": "A {0} nem megfelelő a szükséges formátumnak.", - "The {0} field is required.": "A {0} kötelező.", - "The field {0} must be a string with a maximum length of {1}.": "A {0} szövegnek kell lennie maximum {1} hosszan.", - "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "A {0} mezőnek szöveget kell tartalmaznia minimum {2} és maximum {1} hosszan.", - "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "A {0} mező nem érvényes fully-qualified http, https, vagy ftp URL cím.", - "The field {0} is invalid.": "A {0} mező nem érvényes.", - "ThisFieldIsNotAValidCreditCardNumber.": "A mező nem érvényes bankkártya számot tartalmaz.", - "ThisFieldIsNotValid.": "A mező nem érvényes.", - "ThisFieldIsNotAValidEmailAddress.": "A mező nem érvényes email cím.", - "ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "A mező csak fileneveket fogad a következő kiterjesztésekkel: {0}", - "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "A mezőnek szöveg vagy felsorolás tpusúnak kell lennie maximum '{0}' hosszal.", - "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "A mezőnek szöveg vagy felsorolás tpusúnak kell lennie minimum '{0}' hosszal.", - "ThisFieldIsNotAValidPhoneNumber.": "A mező nem érvényes telefonszám.", - "ThisFieldMustBeBetween{0}And{1}": "A mező értéke {0} és {1} között kell lennie.", - "ThisFieldMustMatchTheRegularExpression{0}": "A mezőnek meg kell felelnie a következő reguláris kifejezésnek '{0}'.", - "ThisFieldIsRequired.": "A mező szükséges.", - "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "A mezőnek szöveg tpusúnak kell lennie maximum {0} hosszal.", - "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "A mezőnek szöveget kell tartalmaznia minimum {1} és maximum {0} hosszan.", - "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "A mező nem érvényes fully-qualified http, https, vagy ftp URL cím.", - "ThisFieldIsInvalid.": "A mező nem érvényes." - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "'{0}' and '{1}' do not match.": "'{0}' és '{1}' nem egyforma.", + "The {0} field is not a valid credit card number.": "A {0} érvényes bankkártya szám.", + "{0} is not valid.": "{0} nem érvényes.", + "The {0} field is not a valid e-mail address.": "A {0} nem érvényes email cím.", + "The {0} field only accepts files with the following extensions: {1}": "A {0} mező csak olyan fileokat tartalmazhat melynek kiterjesztése ezek: {1}", + "The field {0} must be a string or array type with a maximum length of '{1}'.": "A {0} mező szöveg vagy felsorolás típusú lehet '{1}' maximum hosszal.", + "The field {0} must be a string or array type with a minimum length of '{1}'.": "A {0} mező szöveg vagy felsorolás típusú lehet '{1}' minimum hosszal.", + "The {0} field is not a valid phone number.": "A {0} nem érvényes telefonszám.", + "The field {0} must be between {1} and {2}.": "A {0} értéke {1} és {2} között kell legyen.", + "The field {0} must match the regular expression '{1}'.": "A {0} nem megfelelő a szükséges formátumnak.", + "The {0} field is required.": "A {0} kötelező.", + "The field {0} must be a string with a maximum length of {1}.": "A {0} szövegnek kell lennie maximum {1} hosszan.", + "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "A {0} mezőnek szöveget kell tartalmaznia minimum {2} és maximum {1} hosszan.", + "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "A {0} mező nem érvényes fully-qualified http, https, vagy ftp URL cím.", + "The field {0} is invalid.": "A {0} mező nem érvényes.", + "ThisFieldIsNotAValidCreditCardNumber.": "A mező nem érvényes bankkártya számot tartalmaz.", + "ThisFieldIsNotValid.": "A mező nem érvényes.", + "ThisFieldIsNotAValidEmailAddress.": "A mező nem érvényes email cím.", + "ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "A mező csak fileneveket fogad a következő kiterjesztésekkel: {0}", + "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "A mezőnek szöveg vagy felsorolás tpusúnak kell lennie maximum '{0}' hosszal.", + "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "A mezőnek szöveg vagy felsorolás tpusúnak kell lennie minimum '{0}' hosszal.", + "ThisFieldIsNotAValidPhoneNumber.": "A mező nem érvényes telefonszám.", + "ThisFieldMustBeBetween{0}And{1}": "A mező értéke {0} és {1} között kell lennie.", + "ThisFieldMustBeGreaterThanOrEqual{0}": "Ennek a mezőnek nagyobbnak vagy egyenlőnek kell lennie, mint {0}.", + "ThisFieldMustBeLessOrEqual{0}": "Ennek a mezőnek kisebbnek vagy egyenlőnek kell lennie, mint {0}.", + "ThisFieldMustMatchTheRegularExpression{0}": "A mezőnek meg kell felelnie a következő reguláris kifejezésnek '{0}'.", + "ThisFieldIsRequired.": "A mező szükséges.", + "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "A mezőnek szöveg tpusúnak kell lennie maximum {0} hosszal.", + "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "A mezőnek szöveget kell tartalmaznia minimum {1} és maximum {0} hosszan.", + "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "A mező nem érvényes fully-qualified http, https, vagy ftp URL cím.", + "ThisFieldIsInvalid.": "A mező nem érvényes." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json index 4adbd81e80..1168a19317 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/pt-BR.json @@ -24,6 +24,8 @@ "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo deve ser do tipo palavra ou matriz com comprimento mínimo de '{0}'.", "ThisFieldIsNotAValidPhoneNumber.": "Número de telefone inválido.", "ThisFieldMustBeBetween{0}And{1}": "Este campo deve estar entre {0} e {1}.", + "ThisFieldMustBeGreaterThanOrEqual{0}": "Este campo deve ser maior ou igual a {0}.", + "ThisFieldMustBeLessOrEqual{0}": "Este campo deve ser menor ou igual a {0}.", "ThisFieldMustMatchTheRegularExpression{0}": "Este campo deve ser compatível com a expressão regular: '{0}'.", "ThisFieldIsRequired.": "Campo Obrigatório.", "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Campo com no máximo {0} caracteres.", diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.PlugIn/Volo.Abp.AspNetCore.Mvc.PlugIn.csproj b/framework/test/Volo.Abp.AspNetCore.Mvc.PlugIn/Volo.Abp.AspNetCore.Mvc.PlugIn.csproj index 91ca2b1312..d917afa97f 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.PlugIn/Volo.Abp.AspNetCore.Mvc.PlugIn.csproj +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.PlugIn/Volo.Abp.AspNetCore.Mvc.PlugIn.csproj @@ -4,6 +4,7 @@ net6.0 Library true + true diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs index 5d3cb09749..56fc8a583a 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/ApplicationConfigurationBuilder_Tests.cs @@ -12,7 +12,7 @@ public class ApplicationConfigurationBuilder_Tests : AspNetCoreMvcTestBase { var applicationConfigurationBuilder = GetRequiredService(); - var config = await applicationConfigurationBuilder.GetAsync(); + var config = await applicationConfigurationBuilder.GetAsync(new ApplicationConfigurationRequestOptions()); config.Auth.ShouldNotBeNull(); config.Localization.ShouldNotBeNull(); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController.cs new file mode 100644 index 0000000000..6e14e04d32 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Volo.Abp.AspNetCore.Mvc.Auditing; + +[Route("integration-api/audit-test")] +[IntegrationService] +public class AuditIntegrationServiceTestController : AbpController +{ + [HttpGet] + public IActionResult Get() + { + return Ok(); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController_Tests.cs new file mode 100644 index 0000000000..129035f406 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditIntegrationServiceTestController_Tests.cs @@ -0,0 +1,58 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; +using NSubstitute; +using Shouldly; +using Volo.Abp.Auditing; +using Xunit; + +namespace Volo.Abp.AspNetCore.Mvc.Auditing; + +public class AuditIntegrationServiceTestController_Tests : AspNetCoreMvcTestBase +{ + private readonly AbpAuditingOptions _options; + private IAuditingStore _auditingStore; + + public AuditIntegrationServiceTestController_Tests() + { + _options = ServiceProvider.GetRequiredService>().Value; + _auditingStore = ServiceProvider.GetRequiredService(); + } + + protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services) + { + _auditingStore = Substitute.For(); + services.Replace(ServiceDescriptor.Singleton(_auditingStore)); + base.ConfigureServices(context, services); + } + + [Fact] + public async Task Should_Write_Audit_Log_For_Controllers_With_IntegrationService_Attribute_If_IsEnabledForIntegrationServices() + { + _options.IsEnabledForGetRequests = true; + _options.IsEnabledForIntegrationServices = true; + await GetResponseAsync("/integration-api/audit-test/"); + await _auditingStore + .Received() + .SaveAsync( + Arg.Is( + x => x.Actions.Any( + a => + a.MethodName == nameof(AuditIntegrationServiceTestController.Get) && + a.ServiceName == typeof(AuditIntegrationServiceTestController).FullName + ) + ) + ); + } + + [Fact] + public async Task Should_Not_Write_Audit_Log_For_Controllers_With_IntegrationService_Attribute() + { + _options.IsEnabledForGetRequests = true; + await GetResponseAsync("/integration-api/audit-test/"); + await _auditingStore.DidNotReceive().SaveAsync(Arg.Any()); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs index d36b5a5723..886df9a0ac 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs @@ -1,5 +1,4 @@ -using System; -using System.Linq; +using System.Linq; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleIntegrationService_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleIntegrationService_Tests.cs new file mode 100644 index 0000000000..850eb12862 --- /dev/null +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/PeopleIntegrationService_Tests.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace Volo.Abp.AspNetCore.Mvc; + +public class PeopleIntegrationService_Tests : AspNetCoreMvcTestBase +{ + [Fact] + public async Task GetValueAsync() + { + var result = await GetResponseAsStringAsync("/integration-api/app/people/value"); + result.ShouldBe("42"); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingOptions_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingOptions_Tests.cs new file mode 100644 index 0000000000..6853046241 --- /dev/null +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingOptions_Tests.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.Options; +using Shouldly; +using Xunit; + +namespace Volo.Abp.Auditing; + +public class AbpAuditingOptions_Tests : AbpAuditingTestBase +{ + private const string ApplicationName = "TEST_APP_NAME"; + + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + base.SetAbpApplicationCreationOptions(options); + options.ApplicationName = ApplicationName; + } + + [Fact] + public void Should_Set_Application_Name_From_Global_Application_Name_By_Default() + { + var options = GetRequiredService>().Value; + options.ApplicationName.ShouldBe(ApplicationName); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs index e40fdd8b59..49d92d2776 100644 --- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs +++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs @@ -55,6 +55,16 @@ public class Auditing_Tests : AbpAuditingTestBase await _auditingStore.Received().SaveAsync(Arg.Any()); } + + [Fact] + public async Task Should_Not_Write_AuditLog_For_Classes_With_IntegrationService_Attribute() + { + var myAuditedObject1 = GetRequiredService(); + + await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 }); + + await _auditingStore.DidNotReceive().SaveAsync(Arg.Any()); + } public interface IMyAuditedObject : ITransientDependency, IAuditingEnabled { @@ -72,6 +82,20 @@ public class Auditing_Tests : AbpAuditingTestBase }); } } + + /* Integration services should not be audited by default */ + [IntegrationService] + public class MyNotAuditedIntegrationService1 : IMyAuditedObject + { + public virtual Task DoItAsync(InputObject inputObject) + { + return Task.FromResult(new ResultObject + { + Value1 = inputObject.Value1 + "-result", + Value2 = inputObject.Value2 + 1 + }); + } + } public class ResultObject { diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AuthenticatedSimpleStateCheckerSerializerContributor_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AuthenticatedSimpleStateCheckerSerializerContributor_Tests.cs new file mode 100644 index 0000000000..0d84d167de --- /dev/null +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AuthenticatedSimpleStateCheckerSerializerContributor_Tests.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Text.Json.Nodes; +using Shouldly; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.SimpleStateChecking; +using Xunit; + +namespace Volo.Abp.Authorization; + +public class AuthenticatedSimpleStateCheckerSerializerContributor_Tests +{ + [Fact] + public void Should_Serialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new AuthenticatedSimpleStateCheckerSerializerContributor(); + + var result = serializer.SerializeToJson( + new RequireAuthenticatedSimpleStateChecker() + ); + + result.ShouldBe("{\"T\":\"A\"}"); + } + + [Fact] + public void Should_Deserialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new AuthenticatedSimpleStateCheckerSerializerContributor(); + + var jsonObject = (JsonObject)JsonNode.Parse("{\"T\":\"A\"}"); + var checker = serializer.Deserialize(jsonObject, new MyState()); + + checker.ShouldBeOfType>(); + var globalFeaturesSimpleStateChecker = checker as RequireAuthenticatedSimpleStateChecker; + globalFeaturesSimpleStateChecker.ShouldNotBeNull(); + } + + private class MyState : IHasSimpleStateCheckers + { + public List> StateCheckers { get; } = new(); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs index 42f6d3ce4a..a32939fa53 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/Authorization_Tests.cs @@ -67,9 +67,9 @@ public class Authorization_Tests : AuthorizationTestBase } [Fact] - public void Should_Permission_Definition_GetGroup() + public async Task Should_Permission_Definition_GetGroup() { - _permissionDefinitionManager.GetGroups().Count.ShouldBe(1); + (await _permissionDefinitionManager.GetGroupsAsync()).Count.ShouldBe(1); } [Fact] diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/PermissionStateProvider_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/PermissionStateProvider_Tests.cs index b0be00fe01..50805d4b58 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/PermissionStateProvider_Tests.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/PermissionStateProvider_Tests.cs @@ -29,7 +29,8 @@ public class SpecifyPermissionStateProvider : PermissionStateProvider_Tests [Fact] public async Task PermissionState_Test() { - var myPermission1 = PermissionDefinitionManager.Get("MyPermission1"); + var myPermission1 = await PermissionDefinitionManager.GetOrNullAsync("MyPermission1"); + myPermission1.ShouldNotBeNull(); myPermission1.StateCheckers.ShouldContain(x => x.GetType() == typeof(TestRequireEditionPermissionSimpleStateChecker)); (await StateCheckerManager.IsEnabledAsync(myPermission1)).ShouldBeFalse(); @@ -54,7 +55,8 @@ public class GlobalPermissionStateProvider : PermissionStateProvider_Tests [Fact] public async Task Global_PermissionState_Test() { - var myPermission2 = PermissionDefinitionManager.Get("MyPermission2"); + var myPermission2 = await PermissionDefinitionManager.GetOrNullAsync("MyPermission2"); + myPermission2.ShouldNotBeNull(); (await StateCheckerManager.IsEnabledAsync(myPermission2)).ShouldBeFalse(); diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/StaticPermissionDefinitionStore_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/StaticPermissionDefinitionStore_Tests.cs new file mode 100644 index 0000000000..d3a484c32f --- /dev/null +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/StaticPermissionDefinitionStore_Tests.cs @@ -0,0 +1,47 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Authorization.Permissions; +using Xunit; + +namespace Volo.Abp.Authorization; + +public class StaticPermissionDefinitionStore_Tests : AuthorizationTestBase +{ + private readonly IStaticPermissionDefinitionStore _store; + + public StaticPermissionDefinitionStore_Tests() + { + _store = GetRequiredService(); + } + + [Fact] + public async Task GetOrNullAsync() + { + var permission = await _store.GetOrNullAsync("MyPermission1"); + permission.ShouldNotBeNull(); + permission.Name.ShouldBe("MyPermission1"); + permission.StateCheckers.ShouldContain(x => x.GetType() == typeof(TestRequireEditionPermissionSimpleStateChecker)); + + permission = await _store.GetOrNullAsync("NotExists"); + permission.ShouldBeNull(); + } + + [Fact] + public async Task GetPermissionsAsync() + { + var permissions = await _store.GetPermissionsAsync(); + permissions.ShouldContain(x => x.Name == "MyAuthorizedService1"); + permissions.ShouldContain(x => x.Name == "MyPermission1"); + permissions.ShouldContain(x => x.Name == "MyPermission2"); + permissions.ShouldContain(x => x.Name == "MyPermission3"); + permissions.ShouldContain(x => x.Name == "MyPermission4"); + permissions.ShouldContain(x => x.Name == "MyPermission5"); + } + + [Fact] + public async Task GetGroupsAsync() + { + var groups = await _store.GetGroupsAsync(); + groups.ShouldNotContain(x => x.Name == "TestGetGroup"); + } +} diff --git a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs index 12c8a16833..513423a781 100644 --- a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs +++ b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs @@ -34,7 +34,19 @@ public class DistributedCache_ConfigureOptions_Test : AbpIntegratedTest { var cache1 = GetRequiredService>(); var cache2 = GetRequiredService>(); - + + cache1.InternalCache.ShouldBe(cache2); + await cache1.SetAsync("john", new PersonCacheItem("John Doe")); var item1 = await cache1.GetAsync("john"); diff --git a/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs index 5d77c6a00e..52f07620fb 100644 --- a/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs @@ -47,19 +47,36 @@ public abstract class DependencyInjection_Standard_Tests : AbpIntegratedTest().ProperyInjectedService.ShouldNotBeNull(); + GetRequiredService().PropertyInjectedService.ShouldNotBeNull(); } [Fact] public void Should_Inject_Services_As_Properties_For_Generic_Classes() { - GetRequiredService>().ProperyInjectedService.ShouldNotBeNull(); + GetRequiredService>().PropertyInjectedService.ShouldNotBeNull(); } [Fact] public void Should_Inject_Services_As_Properties_For_Generic_Concrete_Classes() { - GetRequiredService().ProperyInjectedService.ShouldNotBeNull(); + GetRequiredService().PropertyInjectedService.ShouldNotBeNull(); + } + + [Fact] + public void Should_Not_Inject_Services_As_Properties_When_Class_With_DisablePropertyInjection() + { + GetRequiredService().PropertyInjectedService.ShouldBeNull(); + GetRequiredService>().PropertyInjectedService.ShouldBeNull(); + } + + [Fact] + public void Should_Not_Inject_Services_As_Properties_When_Property_With_DisablePropertyInjection() + { + GetRequiredService().PropertyInjectedService.ShouldNotBeNull(); + GetRequiredService().DisablePropertyInjectionService.ShouldBeNull(); + + GetRequiredService>().PropertyInjectedService.ShouldNotBeNull(); + GetRequiredService>().DisablePropertyInjectionService.ShouldBeNull(); } [Fact] @@ -145,18 +162,19 @@ public abstract class DependencyInjection_Standard_Tests : AbpIntegratedTest(); context.Services.AddType(); context.Services.AddTransient(typeof(GenericServiceWithPropertyInject<>)); - context.Services.AddTransient(typeof(ConcreteGenericServiceWithPropertyInject)); + context.Services.AddTransient(typeof(GenericServiceWithDisablePropertyInjectionOnClass<>)); + context.Services.AddTransient(typeof(GenericServiceWithDisablePropertyInjectionOnProperty<>)); } } public class ServiceWithPropertyInject : ITransientDependency { - public MyEmptyTransientService ProperyInjectedService { get; set; } + public MyEmptyTransientService PropertyInjectedService { get; set; } } public class GenericServiceWithPropertyInject : ITransientDependency { - public MyEmptyTransientService ProperyInjectedService { get; set; } + public MyEmptyTransientService PropertyInjectedService { get; set; } public T Value { get; set; } } @@ -165,4 +183,36 @@ public abstract class DependencyInjection_Standard_Tests : AbpIntegratedTest : ITransientDependency + { + public MyEmptyTransientService PropertyInjectedService { get; set; } + + public T Value { get; set; } + } + + public class GenericServiceWithDisablePropertyInjectionOnProperty : ITransientDependency + { + public MyEmptyTransientService PropertyInjectedService { get; set; } + + [DisablePropertyInjection] + public MyEmptyTransientService DisablePropertyInjectionService { get; set; } + + public T Value { get; set; } + } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/AbpApplication_Initialize_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/AbpApplication_Initialize_Tests.cs index f69d94ce61..9eff208198 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/AbpApplication_Initialize_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/AbpApplication_Initialize_Tests.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; +using Volo.Abp.DependencyInjection; using Volo.Abp.Modularity; using Volo.Abp.Modularity.PlugIns; using Xunit; @@ -142,4 +143,40 @@ public class AbpApplication_Initialize_Tests plugInModule.OnApplicationShutdownIsCalled.ShouldBeTrue(); } } + + [Fact] + public void Should_Set_And_Get_ApplicationName() + { + const string applicationName = "MyApplication"; + + using (var application = AbpApplicationFactory.Create(options => + { + options.ApplicationName = applicationName; + })) + { + application.ApplicationName.ShouldBe(applicationName); + application.Services.GetApplicationName().ShouldBe(applicationName); + + application.Initialize(); + + application.ServiceProvider + .GetRequiredService() + .ApplicationName + .ShouldBe(applicationName); + } + } + + [Fact] + public async Task Should_Resolve_Root_Service_Provider() + { + using (var application = await AbpApplicationFactory.CreateAsync()) + { + await application.InitializeAsync(); + + application + .ServiceProvider + .GetRequiredService() + .ShouldNotBeNull(); + } + } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/HybridServiceScopeFactory_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/HybridServiceScopeFactory_Tests.cs deleted file mode 100644 index 6a3f059ba8..0000000000 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/DependencyInjection/HybridServiceScopeFactory_Tests.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Shouldly; -using Volo.Abp.Modularity; -using Xunit; - -namespace Volo.Abp.DependencyInjection; - -public class HybridServiceScopeFactory_Tests -{ - [Fact] - public async Task Should_Use_Default_ServiceScopeFactory_By_Default_Async() - { - using (var application = await AbpApplicationFactory.CreateAsync()) - { - application.Services.AddType(typeof(MyServiceAsync)); - - await application.InitializeAsync(); - - var serviceScopeFactory = application.ServiceProvider.GetRequiredService(); - - using (var scope = serviceScopeFactory.CreateScope()) - { - scope.ServiceProvider.GetRequiredService(); - } - - MyServiceAsync.DisposeCount.ShouldBe(1); - } - } - - [Fact] - public void Should_Use_Default_ServiceScopeFactory_By_Default() - { - using (var application = AbpApplicationFactory.Create()) - { - application.Services.AddType(typeof(MyService)); - - application.Initialize(); - - var serviceScopeFactory = application.ServiceProvider.GetRequiredService(); - - using (var scope = serviceScopeFactory.CreateScope()) - { - scope.ServiceProvider.GetRequiredService(); - } - - MyService.DisposeCount.ShouldBe(1); - } - } - - private class MyServiceAsync : ITransientDependency, IDisposable - { - public static int DisposeCount { get; private set; } - - public void Dispose() - { - ++DisposeCount; - } - } - - private class MyService : ITransientDependency, IDisposable - { - public static int DisposeCount { get; private set; } - - public void Dispose() - { - ++DisposeCount; - } - } -} diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Localization/CultureHelper_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Localization/CultureHelper_Tests.cs new file mode 100644 index 0000000000..d55df57800 --- /dev/null +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Localization/CultureHelper_Tests.cs @@ -0,0 +1,36 @@ +using Shouldly; +using Xunit; + +namespace Volo.Abp.Localization; + +public class CultureHelper_Tests +{ + [Fact] + public void IsCompatibleCulture() + { + CultureHelper.IsCompatibleCulture("tr", "tr").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("tr", "tr-TR").ShouldBeTrue(); + + CultureHelper.IsCompatibleCulture("en", "tr").ShouldBeFalse(); + CultureHelper.IsCompatibleCulture("en", "tr-TR").ShouldBeFalse(); + + CultureHelper.IsCompatibleCulture("en-US", "en").ShouldBeFalse(); + CultureHelper.IsCompatibleCulture("en-US", "en-GB").ShouldBeFalse(); + + CultureHelper.IsCompatibleCulture("zh", "zh-CN").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-HK").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-MO").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-SG").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-TW").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-Hans").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh", "zh-Hant").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh-Hans", "zh-CN").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh-Hans", "zh-SG").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh-Hant", "zh-HK").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh-Hant", "zh-MO").ShouldBeTrue(); + CultureHelper.IsCompatibleCulture("zh-Hant", "zh-TW").ShouldBeTrue(); + + CultureHelper.IsCompatibleCulture("zh-Hans", "zh-HK").ShouldBeFalse(); + CultureHelper.IsCompatibleCulture("zh-Hant", "zh-SG").ShouldBeFalse(); + } +} diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureDefinitionManager_Tests.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureDefinitionManager_Tests.cs index 246ffe537d..5e3cb96741 100644 --- a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureDefinitionManager_Tests.cs +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeatureDefinitionManager_Tests.cs @@ -1,4 +1,5 @@ -using Shouldly; +using System.Threading.Tasks; +using Shouldly; using Xunit; namespace Volo.Abp.Features; @@ -13,22 +14,22 @@ public class FeatureDefinitionManager_Tests : FeatureTestBase } [Fact] - public void Should_Get_Defined_Features() + public async Task Should_Get_Defined_Features() { - _featureDefinitionManager.GetOrNull("BooleanTestFeature1").ShouldNotBeNull(); - _featureDefinitionManager.Get("BooleanTestFeature1").Name.ShouldBe("BooleanTestFeature1"); + await _featureDefinitionManager.GetOrNullAsync("BooleanTestFeature1").ShouldNotBeNull(); + (await _featureDefinitionManager.GetAsync("BooleanTestFeature1")).Name.ShouldBe("BooleanTestFeature1"); - _featureDefinitionManager.GetOrNull("IntegerTestFeature1").ShouldNotBeNull(); - _featureDefinitionManager.Get("IntegerTestFeature1").Name.ShouldBe("IntegerTestFeature1"); + await _featureDefinitionManager.GetOrNullAsync("IntegerTestFeature1").ShouldNotBeNull(); + (await _featureDefinitionManager.GetAsync("IntegerTestFeature1")).Name.ShouldBe("IntegerTestFeature1"); } [Fact] - public void Should_Not_Get_Undefined_Features() + public async Task Should_Not_Get_Undefined_Features() { - _featureDefinitionManager.GetOrNull("UndefinedFeature").ShouldBeNull(); - Assert.Throws(() => + (await _featureDefinitionManager.GetOrNullAsync("UndefinedFeature")).ShouldBeNull(); + await Assert.ThrowsAsync(async () => { - _featureDefinitionManager.Get("UndefinedFeature"); + await _featureDefinitionManager.GetAsync("UndefinedFeature"); }); } } diff --git a/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor_Tests.cs b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor_Tests.cs new file mode 100644 index 0000000000..9791ac44bc --- /dev/null +++ b/framework/test/Volo.Abp.Features.Tests/Volo/Abp/Features/FeaturesSimpleStateCheckerSerializerContributor_Tests.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Text.Json.Nodes; +using Shouldly; +using Volo.Abp.SimpleStateChecking; +using Xunit; + +namespace Volo.Abp.Features; + +public class FeaturesSimpleStateCheckerSerializerContributor_Tests +{ + [Fact] + public void Should_Serialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new FeaturesSimpleStateCheckerSerializerContributor(); + + var result = serializer.SerializeToJson( + new RequireFeaturesSimpleStateChecker( + "FeatureA", + "FeatureB" + ) + ); + + result.ShouldBe("{\"T\":\"F\",\"A\":true,\"N\":[\"FeatureA\",\"FeatureB\"]}"); + } + + [Fact] + public void Should_Deserialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new FeaturesSimpleStateCheckerSerializerContributor(); + + var jsonObject = (JsonObject)JsonNode.Parse("{\"T\":\"F\",\"A\":true,\"N\":[\"FeatureA\",\"FeatureB\"]}"); + var checker = serializer.Deserialize(jsonObject, new MyState()); + + checker.ShouldBeOfType>(); + var globalFeaturesSimpleStateChecker = checker as RequireFeaturesSimpleStateChecker; + globalFeaturesSimpleStateChecker.ShouldNotBeNull(); + globalFeaturesSimpleStateChecker.RequiresAll.ShouldBeTrue(); + globalFeaturesSimpleStateChecker.FeatureNames[0].ShouldBe("FeatureA"); + globalFeaturesSimpleStateChecker.FeatureNames[1].ShouldBe("FeatureB"); + } + + private class MyState : IHasSimpleStateCheckers + { + public List> StateCheckers { get; } = new(); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor_Tests.cs b/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor_Tests.cs new file mode 100644 index 0000000000..e0425775dc --- /dev/null +++ b/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeaturesSimpleStateCheckerSerializerContributor_Tests.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Text.Json.Nodes; +using Shouldly; +using Volo.Abp.SimpleStateChecking; +using Xunit; + +namespace Volo.Abp.GlobalFeatures; + +public class GlobalFeaturesSimpleStateCheckerSerializerContributor_Tests +{ + [Fact] + public void Should_Serialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new GlobalFeaturesSimpleStateCheckerSerializerContributor(); + + var result = serializer.SerializeToJson( + new RequireGlobalFeaturesSimpleStateChecker( + "FeatureA", + "FeatureB" + ) + ); + + result.ShouldBe("{\"T\":\"G\",\"A\":true,\"N\":[\"FeatureA\",\"FeatureB\"]}"); + } + + [Fact] + public void Should_Deserialize_RequireGlobalFeaturesSimpleStateChecker() + { + var serializer = new GlobalFeaturesSimpleStateCheckerSerializerContributor(); + + var jsonObject = (JsonObject)JsonNode.Parse("{\"T\":\"G\",\"A\":true,\"N\":[\"FeatureA\",\"FeatureB\"]}"); + var checker = serializer.Deserialize(jsonObject, new MyState()); + + checker.ShouldBeOfType>(); + var globalFeaturesSimpleStateChecker = checker as RequireGlobalFeaturesSimpleStateChecker; + globalFeaturesSimpleStateChecker.ShouldNotBeNull(); + globalFeaturesSimpleStateChecker.RequiresAll.ShouldBeTrue(); + globalFeaturesSimpleStateChecker.GlobalFeatureNames[0].ShouldBe("FeatureA"); + globalFeaturesSimpleStateChecker.GlobalFeatureNames[1].ShouldBe("FeatureB"); + } + + private class MyState : IHasSimpleStateCheckers + { + public List> StateCheckers { get; } = new(); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalizationTestModule.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalizationTestModule.cs new file mode 100644 index 0000000000..7e01a1c42c --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalizationTestModule.cs @@ -0,0 +1,39 @@ +using Volo.Abp.Localization.TestResources.Base.Validation; +using Volo.Abp.Localization.TestResources.Source; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.Localization; + +[DependsOn(typeof(AbpTestBaseModule))] +[DependsOn(typeof(AbpLocalizationModule))] +public class AbpLocalizationTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/Validation"); + + options.Resources + .Add("LocalizationTestCountryNames") + .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/CountryNames"); + + options.Resources + .Add("en") + .AddVirtualJson("/Volo/Abp/Localization/TestResources/Source") + .AddBaseResources("LocalizationTestCountryNames"); + + options.Resources + .Get() + .AddVirtualJson("/Volo/Abp/Localization/TestResources/SourceExt"); + }); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs index 6c4bdfff08..ee0e929e32 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs @@ -1,18 +1,15 @@ using System.Globalization; using System.Linq; +using System.Threading.Tasks; using Microsoft.Extensions.Localization; using Shouldly; -using Volo.Abp.Localization.TestResources.Base.CountryNames; -using Volo.Abp.Localization.TestResources.Base.Validation; using Volo.Abp.Localization.TestResources.Source; -using Volo.Abp.Modularity; using Volo.Abp.Testing; -using Volo.Abp.VirtualFileSystem; using Xunit; namespace Volo.Abp.Localization; -public class AbpLocalization_Tests : AbpIntegratedTest +public class AbpLocalization_Tests : AbpIntegratedTest { private readonly IStringLocalizer _localizer; private readonly IStringLocalizerFactory _localizerFactory; @@ -76,7 +73,6 @@ public class AbpLocalization_Tests : AbpIntegratedTest ls.Name == "USA"); } - } [Fact] @@ -275,7 +269,6 @@ public class AbpLocalization_Tests : AbpIntegratedTest(options => - { - options.FileSets.AddEmbedded(); - }); - - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/Validation"); - - options.Resources - .Add("en") - .AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/CountryNames"); - - options.Resources - .Add("en") - .AddVirtualJson("/Volo/Abp/Localization/TestResources/Source"); - - options.Resources - .Get() - .AddVirtualJson("/Volo/Abp/Localization/TestResources/SourceExt"); - }); - } + var cultures = await _localizer.GetSupportedCulturesAsync(); + cultures.Count().ShouldBeGreaterThan(0); } -} +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpStringLocalizerFactory_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpStringLocalizerFactory_Tests.cs new file mode 100644 index 0000000000..8cb0fcb833 --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpStringLocalizerFactory_Tests.cs @@ -0,0 +1,62 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Localization; +using Shouldly; +using Volo.Abp.DynamicProxy; +using Volo.Abp.Testing; +using Xunit; + +namespace Volo.Abp.Localization; + +public class AbpStringLocalizerFactory_Tests : AbpIntegratedTest +{ + private readonly IStringLocalizerFactory _factory; + + public AbpStringLocalizerFactory_Tests() + { + _factory = GetRequiredService(); + } + + [Fact] + public void Factory_Type_Should_Be_AbpStringLocalizerFactory() + { + ProxyHelper.UnProxy(_factory).ShouldBeOfType(); + } + + [Fact] + public void Should_Create_Resource_By_Name() + { + using (CultureHelper.Use("en")) + { + var localizer = _factory.CreateByResourceNameOrNull("Test"); + localizer.ShouldNotBeNull(); + localizer["CarPlural"].Value.ShouldBe("Cars"); + } + } + + [Fact] + public async Task Should_Create_Resource_By_Name_Async() + { + using (CultureHelper.Use("en")) + { + var localizer = await _factory.CreateByResourceNameOrNullAsync("Test"); + localizer.ShouldNotBeNull(); + localizer["CarPlural"].Value.ShouldBe("Cars"); + } + } + + [Fact] + public void Should_Throw_Exception_For_Unknown_Resource_Names() + { + Assert.Throws( + () => _factory.CreateByResourceName("UnknownResourceName") + ); + } + + [Fact] + public async Task Should_Throw_Exception_For_Unknown_Resource_Names_Async() + { + await Assert.ThrowsAsync( + async () => await _factory.CreateByResourceNameAsync("UnknownResourceName") + ); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/LocalizableStringSerializer_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/LocalizableStringSerializer_Tests.cs new file mode 100644 index 0000000000..9261d19dbc --- /dev/null +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/LocalizableStringSerializer_Tests.cs @@ -0,0 +1,75 @@ +using Shouldly; +using Volo.Abp.Localization.TestResources.Source; +using Volo.Abp.Testing; +using Xunit; + +namespace Volo.Abp.Localization; + +public class LocalizableStringSerializer_Tests : AbpIntegratedTest +{ + private readonly ILocalizableStringSerializer _serializer; + + public LocalizableStringSerializer_Tests() + { + _serializer = GetRequiredService(); + } + + [Fact] + public void Serialize_FixedLocalizableString() + { + _serializer + .Serialize(new FixedLocalizableString("")) + .ShouldBe("F:"); + + _serializer + .Serialize(new FixedLocalizableString("Hello World")) + .ShouldBe("F:Hello World"); + } + + [Fact] + public void Serialize_LocalizableString() + { + _serializer + .Serialize(new LocalizableString(typeof(LocalizationTestResource),"Car")) + .ShouldBe("L:Test,Car"); + } + + [Fact] + public void Deserialize_FixedLocalizableString() + { + _serializer + .Deserialize("") + .ShouldBeOfType() + .Value.ShouldBe(""); + + _serializer + .Deserialize("Hello") + .ShouldBeOfType() + .Value.ShouldBe("Hello"); + + _serializer + .Deserialize("F:Hello") + .ShouldBeOfType() + .Value.ShouldBe("Hello"); + } + + [Fact] + public void Deserialize_LocalizableString() + { + var localizableString = _serializer + .Deserialize("L:Test,Car") + .ShouldBeOfType(); + localizableString.ResourceName.ShouldBe("Test"); + localizableString.Name.ShouldBe("Car"); + + Assert.Throws(() => + { + _serializer.Deserialize("L:Test"); + }); + + Assert.Throws(() => + { + _serializer.Deserialize("L:Test, "); + }); + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/LocalizationTestCountryNamesResource.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/LocalizationTestCountryNamesResource.cs deleted file mode 100644 index a70436cbc7..0000000000 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/LocalizationTestCountryNamesResource.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Volo.Abp.Localization.TestResources.Base.CountryNames; - -public sealed class LocalizationTestCountryNamesResource -{ - -} diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs index 772acd78d3..95a1bbd32f 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/LocalizationTestResource.cs @@ -1,12 +1,11 @@ -using Volo.Abp.Localization.TestResources.Base.CountryNames; -using Volo.Abp.Localization.TestResources.Base.Validation; +using Volo.Abp.Localization.TestResources.Base.Validation; namespace Volo.Abp.Localization.TestResources.Source; [InheritResource( - typeof(LocalizationTestValidationResource), - typeof(LocalizationTestCountryNamesResource) + typeof(LocalizationTestValidationResource) )] +[LocalizationResourceName("Test")] public sealed class LocalizationTestResource { diff --git a/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj b/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj index 0664ad2b7b..5a6382eb80 100644 --- a/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj +++ b/framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj @@ -5,6 +5,7 @@ net6.0 + true diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleIntegrationService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleIntegrationService.cs new file mode 100644 index 0000000000..7e4c76daaa --- /dev/null +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IPeopleIntegrationService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Volo.Abp.TestApp.Application; + +public interface IPeopleIntegrationService : IApplicationService +{ + Task GetValueAsync(); +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleIntegrationService.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleIntegrationService.cs new file mode 100644 index 0000000000..4501fdb16f --- /dev/null +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/PeopleIntegrationService.cs @@ -0,0 +1,13 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Volo.Abp.TestApp.Application; + +[IntegrationService] +public class PeopleIntegrationService : ApplicationService, IPeopleIntegrationService +{ + public async Task GetValueAsync() + { + return "42"; + } +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs index a94c722faf..12b3fa01c0 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/EntityChangeEvents_Tests.cs @@ -32,37 +32,18 @@ public abstract class EntityChangeEvents_Tests : TestAppTestBase { var personName = Guid.NewGuid().ToString("N"); - var creatingEventTriggered = false; var createdEventTriggered = false; var createdEtoTriggered = false; using (var uow = GetRequiredService().Begin()) { -#pragma warning disable 618 - LocalEventBus.Subscribe>(data => -#pragma warning restore 618 - { - creatingEventTriggered.ShouldBeFalse(); - createdEventTriggered.ShouldBeFalse(); - - creatingEventTriggered = true; - - data.Entity.Name.ShouldBe(personName); - - /* Want to change age from 15 to 18 */ - data.Entity.Age.ShouldBe(15); - data.Entity.Age = 18; - return Task.CompletedTask; - }); - LocalEventBus.Subscribe>(data => { - creatingEventTriggered.ShouldBeTrue(); createdEventTriggered.ShouldBeFalse(); createdEventTriggered = true; - data.Entity.Age.ShouldBe(18); + data.Entity.Age.ShouldBe(15); data.Entity.Name.ShouldBe(personName); return Task.CompletedTask; @@ -81,8 +62,7 @@ public abstract class EntityChangeEvents_Tests : TestAppTestBase await uow.CompleteAsync(); } - - creatingEventTriggered.ShouldBeTrue(); + createdEventTriggered.ShouldBeTrue(); createdEtoTriggered.ShouldBeTrue(); } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HasExtraPropertiesExtensions_Tests.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HasExtraPropertiesExtensions_Tests.cs index 95e222e2c7..4ad99fee1e 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HasExtraPropertiesExtensions_Tests.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Testing/HasExtraPropertiesExtensions_Tests.cs @@ -45,4 +45,25 @@ public class HasExtraPropertiesExtensions_Tests city.SetProperty("DateTime?", DateTime.MinValue); city.GetProperty("DateTime?").ShouldBe(DateTime.MinValue); } + + [Fact] + public void HasSameExtraProperties_Tests() + { + var adana = new City(Guid.NewGuid(), "Adana"); + adana.SetProperty("IsHot", true); + + var antalya = new City(Guid.NewGuid(), "Antalya"); + antalya.SetProperty("IsHot", true); + + adana.HasSameExtraProperties(antalya).ShouldBeTrue(); + + adana.SetProperty("IsHot", false); + adana.HasSameExtraProperties(antalya).ShouldBeFalse(); + + adana.SetProperty("IsHot", true); + adana.HasSameExtraProperties(antalya).ShouldBeTrue(); + + adana.SetProperty("Population", 3_000_000); + adana.HasSameExtraProperties(antalya).ShouldBeFalse(); + } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/hu.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/hu.json index 77fbc0823f..655ac74c10 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/hu.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/hu.json @@ -1,6 +1,7 @@ { "culture": "hu", "texts": { + "Menu:Account": "Fiók", "UserName": "Felhasználónév", "EmailAddress": "Email cím", "UserNameOrEmailAddress": "Felhasználónév és email cím", diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/ro-RO.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/ro-RO.json index c753009bb0..149ad71d95 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/ro-RO.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/ro-RO.json @@ -27,7 +27,7 @@ "DisplayName:UserName": "Nume de utilizator", "DisplayName:Email": "Email", "DisplayName:Name": "Nume", - "DisplayName:Surname": "Surname", + "DisplayName:Surname": "Nume de familie", "DisplayName:Password": "Parolă", "DisplayName:EmailAddress": "Adresa de email", "DisplayName:PhoneNumber": "Număr de telefon", diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj index ce65a161ce..a28148f0b7 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo.Abp.AuditLogging.Domain.Shared.csproj @@ -5,11 +5,22 @@ netstandard2.0 + true + + + + + + + + + + diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AbpAuditLoggingDomainSharedModule.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AbpAuditLoggingDomainSharedModule.cs index 8ab6756ebe..46f1337118 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AbpAuditLoggingDomainSharedModule.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AbpAuditLoggingDomainSharedModule.cs @@ -1,16 +1,27 @@ using Volo.Abp.AuditLogging.Localization; using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.AuditLogging; +[DependsOn(typeof(AbpValidationModule))] public class AbpAuditLoggingDomainSharedModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + Configure(options => { - options.Resources.Add("en"); + options.Resources.Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Volo/Abp/AuditLogging/Localization"); }); } } diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ar.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ar.json new file mode 100644 index 0000000000..e312406b0a --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ar.json @@ -0,0 +1,79 @@ +{ + "culture": "ar", + "texts": { + "Permission:AuditLogging": "تدوين التسجيل", + "Permission:AuditLogs": "سجلات التدقيق", + "Menu:AuditLogging": "سجلات التدقيق", + "AuditLogs": "سجلات التدقيق", + "HttpStatus": "حالة Http", + "HttpMethod": "طريقة Http", + "HttpMethodFilter": "عامل تصفية أسلوب Http", + "HttpRequest": "طلب Http", + "User": "المستعمل", + "UserNameFilter": "مرشح المستخدم", + "HasException": "لديه استثناء", + "IpAddress": "عنوان IP", + "Time": "زمن", + "Duration": "مدة", + "Detail": "التفاصيل", + "Overall": "شاملة", + "Actions": "أجراءات", + "ClientIpAddress": "عنوان IP للعميل", + "ClientName": "اسم العميل", + "BrowserInfo": "معلومات المتصفح", + "Url": "عنوان Url", + "UserName": "اسم االمستخدم", + "UrlFilter": "عامل تصفية عنوان URL", + "Exceptions": "استثناءات", + "Comments": "تعليقات", + "HttpStatusCode": "Http كود الحالة", + "HttpStatusCodeFilter": "Http عامل تصفية رمز الحالة", + "ServiceName": "خدمة", + "MethodName": "طريقة", + "CorrelationId": "معرف الارتباط", + "ApplicationName": "اسم التطبيق", + "ExecutionDuration": "مدة", + "ExtraProperties": "خصائص اضافية", + "MaxDuration": "الأعلى. مدة", + "MinDuration": "دقيقة. مدة", + "{0}Milliseconds": "{0} مللي ثانية", + "ExecutionTime": "زمن", + "Parameters": "المعلمات", + "EntityTypeFullName": "نوع الكيان الاسم الكامل", + "Entity": "شخصية", + "ChangeType": "نوع التغيير", + "ChangeTime": "زمن", + "NewValue": "قيمة جديدة", + "OriginalValue": "القيمة الأصلية", + "PropertyName": "اسم الخاصية", + "PropertyTypeFullName": "نوع الخاصية الاسم الكامل", + "Yes": "نعم", + "No": "لا", + "Changes": "التغييرات", + "AverageExecutionDurationInLogsPerDay": "متوسط مدة التنفيذ", + "AverageExecutionDurationInMilliseconds": "متوسط مدة التنفيذ بالمللي ثانية", + "ErrorRateInLogs": "معدل الخطأ في السجلات", + "Success": "نجاح", + "Fault": "خطأ", + "NoChanges": "لا تغيرات)", + "EntityChanges": "تغييرات الكيان", + "EntityId": "معرف الكيان", + "EntityChangeStartTime": "تاريخ التغيير الأدنى", + "EntityChangeEndTime": "تاريخ التغيير الأقصى", + "EntityHistory": "تاريخ الكيان", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} بواسطة {2}.", + "Created": "خلقت", + "Updated": "محدث", + "Deleted": "تم الحذف", + "ChangeHistory": "تغيير التاريخ", + "FullChangeHistory": "سجل التغيير الكامل", + "ChangeDetails": "تغيير التفاصيل", + "DurationMs": "المدة (مللي ثانية)", + "StartDate": "تاريخ البدء", + "EndDate": "تاريخ الانتهاء", + "Feature:AuditLoggingGroup": "تدوين التسجيل", + "Feature:AuditLoggingEnable": "تمكين صفحة تسجيل التدقيق", + "Feature:AuditLoggingEnableDescription": "تفعيل صفحة تسجيل التدقيق في التطبيق." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/de-DE.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/de-DE.json new file mode 100644 index 0000000000..b1091b7a63 --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/de-DE.json @@ -0,0 +1,79 @@ +{ + "culture": "de-DE", + "texts": { + "Permission:AuditLogging": "Audit-Protokollierung", + "Permission:AuditLogs": "Audit-Protokolle", + "Menu:AuditLogging": "Audit-Protokolle", + "AuditLogs": "Audit-Protokolle", + "HttpStatus": "HTTP-Status", + "HttpMethod": "HTTP-Methode", + "HttpMethodFilter": "HTTP-Methoden-Filter", + "HttpRequest": "HTTP Anfrage", + "User": "Benutzer", + "UserNameFilter": "Benutzer-Filter", + "HasException": "Hat Ausnahme", + "IpAddress": "IP-Adresse", + "Time": "Zeitpunkt", + "Duration": "Dauer", + "Detail": "Details", + "Overall": "Insgesamt", + "Actions": "Aktionen", + "ClientIpAddress": "Client-IP-Adresse", + "ClientName": "Client-Name", + "BrowserInfo": "Browser-Informationen", + "Url": "URL", + "UserName": "Benutzername", + "UrlFilter": "URL-Filter", + "Exceptions": "Ausnahmen", + "Comments": "Kommentare", + "HttpStatusCode": "HTTP-Statuscode", + "HttpStatusCodeFilter": "HTTP-Statuscode-Filter", + "ServiceName": "Service", + "MethodName": "Methode", + "CorrelationId": "Correlation-Id", + "ApplicationName": "Anwendungsname", + "ExecutionDuration": "Dauer", + "ExtraProperties": "Zusätzliche Eigenschaften", + "MaxDuration": "Max. Dauer", + "MinDuration": "Min. Dauer", + "{0}Milliseconds": "{0} Milisekunden", + "ExecutionTime": "Zeitpunkt", + "Parameters": "Parameter", + "EntityTypeFullName": "Voller Name des Entitätstyp", + "Entity": "Entität", + "ChangeType": "Änderungstyp", + "ChangeTime": "Zeitpunkt", + "NewValue": "Neuer Wert", + "OriginalValue": "Alter Wert", + "PropertyName": "Name der Eigenschaft", + "PropertyTypeFullName": "Voller Name der Eigenschaft", + "Yes": "Ja", + "No": "Nein", + "Changes": "Änderungen", + "AverageExecutionDurationInLogsPerDay": "Durchschnittliche Ausführungsdauer", + "AverageExecutionDurationInMilliseconds": "Durchschnittliche Ausführungsdauer in Milisekunden", + "ErrorRateInLogs": "Fehlerrate in Protokollen", + "Success": "Erfolg", + "Fault": "Fehler", + "NoChanges": "Keine Änderung(en)", + "EntityChanges": "Entitäts-Änderungen", + "EntityId": "Entitäts-Id", + "EntityChangeStartTime": "Min. Änderungzeitpunkt", + "EntityChangeEndTime": "Max. Änderungszeitpunkt", + "EntityHistory": "Entitätsverlauf", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} durch {2}.", + "Created": "Erstellt", + "Updated": "Aktualisiert", + "Deleted": "Gelöscht", + "ChangeHistory": "Änderungsverlauf", + "FullChangeHistory": "Voller Änderungsverlauf", + "ChangeDetails": "Änderungsdetails", + "DurationMs": "Dauer (ms)", + "StartDate": "Startdatum", + "EndDate": "Endtermin", + "Feature:AuditLoggingGroup": "Audit-Protokollierung", + "Feature:AuditLoggingEnable": "Aktivieren Sie die Überwachungsprotokollseite", + "Feature:AuditLoggingEnableDescription": "Aktivieren Sie die Überwachungsprotokollseite in der App." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json new file mode 100644 index 0000000000..5de7585e30 --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json @@ -0,0 +1,81 @@ +{ + "culture": "en", + "texts": { + "Permission:AuditLogging": "Audit Logging", + "Permission:AuditLogs": "Audit Logs", + "Menu:AuditLogging": "Audit Logs", + "AuditLogs": "Audit Logs", + "HttpStatus": "Http Status", + "HttpMethod": "Http Method", + "HttpMethodFilter": "Http Method Filter", + "HttpRequest": "Http Request", + "User": "User", + "UserNameFilter": "User Filter", + "HasException": "Has Exception", + "IpAddress": "Ip Address", + "Time": "Time", + "Duration": "Duration", + "Detail": "Detail", + "Overall": "Overall", + "Actions": "Actions", + "ClientIpAddress": "Client Ip Address", + "ClientName": "Client Name", + "BrowserInfo": "Browser Info", + "Url": "Url", + "UserName": "User Name", + "TenantImpersonator": "Tenant Impersonator", + "UserImpersonator": "User Impersonator", + "UrlFilter": "Url Filter", + "Exceptions": "Exceptions", + "Comments": "Comments", + "HttpStatusCode": "Http Status Code", + "HttpStatusCodeFilter": "Http Status Code Filter", + "ServiceName": "Service", + "MethodName": "Method", + "CorrelationId": "Correlation Id", + "ApplicationName": "Application Name", + "ExecutionDuration": "Duration", + "ExtraProperties": "Extra properties", + "MaxDuration": "Max. Duration", + "MinDuration": "Min. Duration", + "{0}Milliseconds": "{0} milliseconds", + "ExecutionTime": "Time", + "Parameters": "Parameters", + "EntityTypeFullName": "Entity Type Full Name", + "Entity": "Entity", + "ChangeType": "Change Type", + "ChangeTime": "Time", + "NewValue": "New Value", + "OriginalValue": "Original Value", + "PropertyName": "Property Name", + "PropertyTypeFullName": "Property Type Full Name", + "Yes": "Yes", + "No": "No", + "Changes": "Changes", + "AverageExecutionDurationInLogsPerDay": "Average execution duration", + "AverageExecutionDurationInMilliseconds": "Average execution duration in milliseconds", + "ErrorRateInLogs": "Error rate in logs", + "Success": "Success", + "Fault": "Fault", + "NoChanges": "No change(s)", + "EntityChanges": "Entity Changes", + "EntityId": "Entity Id", + "EntityChangeStartTime": "Min Change Date", + "EntityChangeEndTime": "Max Change Date", + "EntityHistory": "Entity History", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} by {2}.", + "Created": "Created", + "Updated": "Updated", + "Deleted": "Deleted", + "ChangeHistory": "Change History", + "FullChangeHistory": "Full Change History", + "ChangeDetails": "Change Details", + "DurationMs": "Duration (ms)", + "StartDate": "Start Date", + "EndDate": "End Date", + "Feature:AuditLoggingGroup": "Audit Logging", + "Feature:AuditLoggingEnable": "Enabled audit logging page", + "Feature:AuditLoggingEnableDescription": "Enable audit logging page in the application." + } +} diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/es.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/es.json new file mode 100644 index 0000000000..e2d3da58b3 --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/es.json @@ -0,0 +1,79 @@ +{ + "culture": "es", + "texts": { + "Permission:AuditLogging": "Registros de auditoría", + "Permission:AuditLogs": "Registros de auditoría", + "Menu:AuditLogging": "Registros de auditoría", + "AuditLogs": "Registros de auditoría", + "HttpStatus": "Estado HTTP", + "HttpMethod": "Metodo HTTP", + "HttpMethodFilter": "Filtro de método HTTP", + "HttpRequest": "Peticion Http", + "User": "Usuario", + "UserNameFilter": "Filtro de usuario", + "HasException": "Tiene error", + "IpAddress": "Dirección Ip", + "Time": "Tiempo", + "Duration": "Duración", + "Detail": "Detalles", + "Overall": "En general", + "Actions": "Acciones", + "ClientIpAddress": "Dirección Ip del Cliente", + "ClientName": "Nombre de cliente", + "BrowserInfo": "Informacion de buscador", + "Url": "Url", + "UserName": "Nombre de usuario", + "UrlFilter": "Filtro de URL", + "Exceptions": "Excepciones", + "Comments": "Comentarios", + "HttpStatusCode": "Código de estado HTTP", + "HttpStatusCodeFilter": "Filtro de código de estado HTTP", + "ServiceName": "Servicio", + "MethodName": "Metodo", + "CorrelationId": "ID de correlación", + "ApplicationName": "Nombre de la aplicación", + "ExecutionDuration": "Duración", + "ExtraProperties": "Propiedades adicionales", + "MaxDuration": "Max. Duración", + "MinDuration": "Min. Duración", + "{0}Milliseconds": "{0} milisegundos", + "ExecutionTime": "Tiempo", + "Parameters": "Parámetros", + "EntityTypeFullName": "Tipo de entidad Nombre completo", + "Entity": "Entidad", + "ChangeType": "Tipo de cambio", + "ChangeTime": "Tiempo", + "NewValue": "Nuevo valor", + "OriginalValue": "Valor original", + "PropertyName": "Nombre de la propiedad", + "PropertyTypeFullName": "Tipo de propiedad Nombre completo", + "Yes": "Si", + "No": "No", + "Changes": "Cambios", + "AverageExecutionDurationInLogsPerDay": "Duración media de ejecución", + "AverageExecutionDurationInMilliseconds": "Duración media de ejecución en milisegundos", + "ErrorRateInLogs": "Tasa de error en los registros", + "Success": "Exitosamente", + "Fault": "Culpa", + "NoChanges": "No cambio(s)", + "EntityChanges": "Cambios en entidad", + "EntityId": "Id Entidad", + "EntityChangeStartTime": "Cambiar fecha mínima", + "EntityChangeEndTime": "Cambiar fecha mámima", + "EntityHistory": "Historial de entidad", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} por {2}.", + "Created": "Creado", + "Updated": "Actualizado", + "Deleted": "Eliminado", + "ChangeHistory": "Historial de cambios", + "FullChangeHistory": "Historial de cambios completo", + "ChangeDetails": "Detalles del cambio", + "DurationMs": "Duración (ms)", + "StartDate": "Fecha de inicio", + "EndDate": "Fecha final", + "Feature:AuditLoggingGroup": "Registros de auditoría", + "Feature:AuditLoggingEnable": "Habilitar la página de registro de auditoría", + "Feature:AuditLoggingEnableDescription": "Habilite la página de registro de auditoría en la aplicación." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fi.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fi.json new file mode 100644 index 0000000000..545ea8b63e --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fi.json @@ -0,0 +1,79 @@ +{ + "culture": "fi", + "texts": { + "Permission:AuditLogging": "Tarkastusten kirjaaminen", + "Permission:AuditLogs": "Tarkastuslokit", + "Menu:AuditLogging": "Tarkastuslokit", + "AuditLogs": "Tarkastuslokit", + "HttpStatus": "Http-tila", + "HttpMethod": "Http-menetelmä", + "HttpMethodFilter": "Http-menetelmän suodatin", + "HttpRequest": "Http-pyyntö", + "User": "Käyttäjä", + "UserNameFilter": "Käyttäjäsuodatin", + "HasException": "Onko poikkeus", + "IpAddress": "IP-osoite", + "Time": "Aika", + "Duration": "Kesto", + "Detail": "Yksityiskohta", + "Overall": "Yleensä ottaen", + "Actions": "Toiminnot", + "ClientIpAddress": "Asiakkaan IP-osoite", + "ClientName": "Asiakkaan Nimi", + "BrowserInfo": "Selaimen tiedot", + "Url": "URL-osoite", + "UserName": "Käyttäjänimi", + "UrlFilter": "URL-suodatin", + "Exceptions": "Poikkeukset", + "Comments": "Kommentit", + "HttpStatusCode": "Http-tilakoodi", + "HttpStatusCodeFilter": "Http-tilakoodisuodatin", + "ServiceName": "Palvelu", + "MethodName": "Menetelmä", + "CorrelationId": "Korrelaatiotunnus", + "ApplicationName": "sovelluksen nimi", + "ExecutionDuration": "Kesto", + "ExtraProperties": "Lisäominaisuudet", + "MaxDuration": "Maks. Kesto", + "MinDuration": "Min. Kesto", + "{0}Milliseconds": "{0} millisekuntia", + "ExecutionTime": "Aika", + "Parameters": "Parametrit", + "EntityTypeFullName": "Yhteisön tyyppi Koko nimi", + "Entity": "Entiteetti", + "ChangeType": "Vaihda tyyppiä", + "ChangeTime": "Aika", + "NewValue": "Uusi arvo", + "OriginalValue": "Alkuperäinen arvo", + "PropertyName": "Kiinteistön nimi", + "PropertyTypeFullName": "Kiinteistötyyppi Koko nimi", + "Yes": "Joo", + "No": "Ei", + "Changes": "Muutokset", + "AverageExecutionDurationInLogsPerDay": "Keskimääräinen suorituksen kesto", + "AverageExecutionDurationInMilliseconds": "Keskimääräinen suorituksen kesto millisekunteina", + "ErrorRateInLogs": "Virheprosentti lokeissa", + "Success": "Menestys", + "Fault": "Vika", + "NoChanges": "Ei muutoksia)", + "EntityChanges": "Entiteetin muutokset", + "EntityId": "Entiteetin tunnus", + "EntityChangeStartTime": "Pienin muutospäivä", + "EntityChangeEndTime": "Korkein muutospäivä", + "EntityHistory": "Entiteettihistoria", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} kirjoittanut {2}.", + "Created": "Luotu", + "Updated": "Päivitetty", + "Deleted": "Poistettu", + "ChangeHistory": "Muutoshistoria", + "FullChangeHistory": "Täysi muutoshistoria", + "ChangeDetails": "Muuta tietoja", + "DurationMs": "Kesto (ms)", + "StartDate": "Aloituspäivämäärä", + "EndDate": "Päättymispäivä", + "Feature:AuditLoggingGroup": "Tarkastusten kirjaaminen", + "Feature:AuditLoggingEnable": "Aktivoi auditointilokisivu", + "Feature:AuditLoggingEnableDescription": "Ota käyttöön tarkastuksen kirjaussivu sovelluksessa." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fr.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fr.json new file mode 100644 index 0000000000..ee3680b87f --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/fr.json @@ -0,0 +1,79 @@ +{ + "culture": "fr", + "texts": { + "Permission:AuditLogging": "Journalisation d'audit", + "Permission:AuditLogs": "Journaux d'audit", + "Menu:AuditLogging": "Journaux d'audit", + "AuditLogs": "Journaux d'audit", + "HttpStatus": "État HTTP", + "HttpMethod": "Méthode Http", + "HttpMethodFilter": "Filtre de méthode Http", + "HttpRequest": "Requête HTTP", + "User": "Utilisateur", + "UserNameFilter": "Filtre utilisateur", + "HasException": "A une exception", + "IpAddress": "Adresse IP", + "Time": "Temps", + "Duration": "Durée", + "Detail": "Détail", + "Overall": "Globalement", + "Actions": "Actions", + "ClientIpAddress": "Adresse IP du client", + "ClientName": "Nom du client", + "BrowserInfo": "Informations sur le navigateur", + "Url": "URL", + "UserName": "Nom d'utilisateur", + "UrlFilter": "Filtre d'URL", + "Exceptions": "Exceptions", + "Comments": "commentaires", + "HttpStatusCode": "Code d'état HTTP", + "HttpStatusCodeFilter": "Filtre de code d'état HTTP", + "ServiceName": "Un service", + "MethodName": "Méthode", + "CorrelationId": "ID de corrélation", + "ApplicationName": "Nom de l'application", + "ExecutionDuration": "Durée", + "ExtraProperties": "Propriétés supplémentaires", + "MaxDuration": "Max. Durée", + "MinDuration": "Min. Durée", + "{0}Milliseconds": "{0} millisecondes", + "ExecutionTime": "Temps", + "Parameters": "Paramètres", + "EntityTypeFullName": "Type d'entité Nom complet", + "Entity": "Entité", + "ChangeType": "Changer le type", + "ChangeTime": "Temps", + "NewValue": "Nouvelle valeur", + "OriginalValue": "Valeur d'origine", + "PropertyName": "Nom de la propriété", + "PropertyTypeFullName": "Type de propriété Nom complet", + "Yes": "Oui", + "No": "Non", + "Changes": "Changements", + "AverageExecutionDurationInLogsPerDay": "Durée moyenne d'exécution", + "AverageExecutionDurationInMilliseconds": "Durée moyenne d'exécution en millisecondes", + "ErrorRateInLogs": "Taux d'erreur dans les journaux", + "Success": "Succès", + "Fault": "Faute", + "NoChanges": "Aucun changement)", + "EntityChanges": "Changements d'entité", + "EntityId": "ID d'entité", + "EntityChangeStartTime": "Date de changement min.", + "EntityChangeEndTime": "Date de changement max.", + "EntityHistory": "Historique de l'entité", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} par {2}.", + "Created": "Créé", + "Updated": "Mise à jour", + "Deleted": "Supprimé", + "ChangeHistory": "Historique des modifications", + "FullChangeHistory": "Historique complet des modifications", + "ChangeDetails": "Modifier les détails", + "DurationMs": "Durée (ms)", + "StartDate": "Date de début", + "EndDate": "Date de fin", + "Feature:AuditLoggingGroup": "Journalisation d'audit", + "Feature:AuditLoggingEnable": "Page de journalisation d'audit activée", + "Feature:AuditLoggingEnableDescription": "Activez la page de journalisation d'audit dans l'application." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/hi.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/hi.json new file mode 100644 index 0000000000..c6d35b093f --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/hi.json @@ -0,0 +1,79 @@ +{ + "culture": "hi", + "texts": { + "Permission:AuditLogging": "ऑडिट लॉगिंग", + "Permission:AuditLogs": "ऑडिट लॉग", + "Menu:AuditLogging": "ऑडिट लॉग", + "AuditLogs": "ऑडिट लॉग", + "HttpStatus": "Http स्थिति", + "HttpMethod": "Http विधि", + "HttpMethodFilter": "Http विधि फ़िल्टर", + "HttpRequest": "Http अनुरोध", + "User": "उपयोगकर्ता", + "UserNameFilter": "उपयोगकर्ता फ़िल्टर", + "HasException": "अपवाद है", + "IpAddress": "आईपी पता", + "Time": "समय", + "Duration": "समयांतराल", + "Detail": "विस्तार", + "Overall": "संपूर्ण", + "Actions": "कार्रवाई", + "ClientIpAddress": "ग्राहक इप पता", + "ClientName": "ग्राहक नाम", + "BrowserInfo": "ब्राउज़र जानकारी", + "Url": "यूआरएल", + "UserName": "उपयोगकर्ता नाम", + "UrlFilter": "उर फिल्टर", + "Exceptions": "अपवाद", + "Comments": "टिप्पणियाँ", + "HttpStatusCode": "Http स्थिति कोड", + "HttpStatusCodeFilter": "Http स्थिति कोड फ़िल्टर", + "ServiceName": "सेवा", + "MethodName": "तरीका", + "CorrelationId": "सहसंबंध आईडी", + "ApplicationName": "आवेदन का नाम", + "ExecutionDuration": "समयांतराल", + "ExtraProperties": "अतिरिक्त गुण", + "MaxDuration": "मैक्स। समयांतराल", + "MinDuration": "मिन। समयांतराल", + "{0}Milliseconds": "{0} मिलीसेकंड", + "ExecutionTime": "समय", + "Parameters": "मापदंडों", + "EntityTypeFullName": "संपूर्ण प्रकार पूर्ण नाम", + "Entity": "सत्ता", + "ChangeType": "प्रकार बदलें", + "ChangeTime": "समय", + "NewValue": "नया मूल्य", + "OriginalValue": "असली कीमत", + "PropertyName": "संपत्ति का नाम", + "PropertyTypeFullName": "संपत्ति का पूरा नाम", + "Yes": "हाँ", + "No": "नहीं न", + "Changes": "परिवर्तन", + "AverageExecutionDurationInLogsPerDay": "औसत निष्पादन अवधि", + "AverageExecutionDurationInMilliseconds": "मिलीसेकंड में औसत निष्पादन अवधि", + "ErrorRateInLogs": "लॉग में त्रुटि दर", + "Success": "सफलता", + "Fault": "दोष", + "NoChanges": "कोई बदलाव नहीं)", + "EntityChanges": "इकाई परिवर्तन", + "EntityId": "इकाई आईडी", + "EntityChangeStartTime": "मिन चेंज डेट", + "EntityChangeEndTime": "अधिकतम परिवर्तन तिथि", + "EntityHistory": "इकाई इतिहास", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} से {2}।", + "Created": "बनाया था", + "Updated": "अद्यतन", + "Deleted": "हटाए गए", + "ChangeHistory": "इतिहास बदलें", + "FullChangeHistory": "पूर्ण इतिहास बदलें", + "ChangeDetails": "विवरण बदलें", + "DurationMs": "अवधि (एमएस)", + "StartDate": "आरंभ करने की तिथि", + "EndDate": "समाप्ति तिथि", + "Feature:AuditLoggingGroup": "ऑडिट लॉगिंग", + "Feature:AuditLoggingEnable": "सक्षम ऑडिट लॉगिंग पृष्ठ", + "Feature:AuditLoggingEnableDescription": "एप्लिकेशन में ऑडिट लॉगिंग पृष्ठ सक्षम करें।" + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/it.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/it.json new file mode 100644 index 0000000000..d5a7b70fac --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/it.json @@ -0,0 +1,79 @@ +{ + "culture": "it", + "texts": { + "Permission:AuditLogging": "Registrazione di controllo", + "Permission:AuditLogs": "Registri di controllo", + "Menu:AuditLogging": "Registri di controllo", + "AuditLogs": "Registri di controllo", + "HttpStatus": "Stato HTTP", + "HttpMethod": "Metodo HTTP", + "HttpMethodFilter": "Filtro metodo HTTP", + "HttpRequest": "Richiesta HTTP", + "User": "Utente", + "UserNameFilter": "Filtro utente", + "HasException": "Ha un'eccezione", + "IpAddress": "Indirizzo IP", + "Time": "Orario", + "Duration": "Durata", + "Detail": "Dettaglio", + "Overall": "Complessivo", + "Actions": "Azioni", + "ClientIpAddress": "Indirizzo IP del cliente", + "ClientName": "Nome del cliente", + "BrowserInfo": "Informazioni sul browser", + "Url": "Url", + "UserName": "Nome utente", + "UrlFilter": "Filtro URL", + "Exceptions": "Eccezioni", + "Comments": "Commenti", + "HttpStatusCode": "Codice di stato HTTP", + "HttpStatusCodeFilter": "Filtro codice di stato HTTP", + "ServiceName": "Servizio", + "MethodName": "Metodo", + "CorrelationId": "ID correlazione", + "ApplicationName": "Nome dell'applicazione", + "ExecutionDuration": "Durata", + "ExtraProperties": "Proprietà extra", + "MaxDuration": "Max. Durata", + "MinDuration": "Min. Durata", + "{0}Milliseconds": "{0} millisecondi", + "ExecutionTime": "Orario", + "Parameters": "Parametri", + "EntityTypeFullName": "Nome completo del tipo di entità", + "Entity": "Entità", + "ChangeType": "Cambia tipo", + "ChangeTime": "Orario", + "NewValue": "Nuovo valore", + "OriginalValue": "Valore originale", + "PropertyName": "Nome della proprietà", + "PropertyTypeFullName": "Nome completo del tipo di proprietà", + "Yes": "Sì", + "No": "No", + "Changes": "Modifiche", + "AverageExecutionDurationInLogsPerDay": "Durata media dell'esecuzione", + "AverageExecutionDurationInMilliseconds": "Durata media dell'esecuzione in millisecondi", + "ErrorRateInLogs": "Tasso di errore nei log", + "Success": "Successo", + "Fault": "Fallito", + "NoChanges": "Nessun cambiamento(i)", + "EntityChanges": "Modifiche alle entità", + "EntityId": "Entity Id", + "EntityChangeStartTime": "Data di modifica minima", + "EntityChangeEndTime": "Data di modifica massima", + "EntityHistory": "Storia dell'entità", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} di {2}.", + "Created": "Creato", + "Updated": "Aggiornato", + "Deleted": "Eliminato", + "ChangeHistory": "Cronologia Modifiche", + "FullChangeHistory": "Cronologia completa delle modifiche", + "ChangeDetails": "Modifica dettagli", + "DurationMs": "Durata (ms)", + "StartDate": "Data d'inizio", + "EndDate": "Data di fine", + "Feature:AuditLoggingGroup": "Registrazione di controllo", + "Feature:AuditLoggingEnable": "Pagina di registrazione di controllo abilitata", + "Feature:AuditLoggingEnableDescription": "Abilita la pagina di registrazione dell'audit nell'applicazione." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/pt-BR.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/pt-BR.json new file mode 100644 index 0000000000..d0a66b47dc --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/pt-BR.json @@ -0,0 +1,79 @@ +{ + "culture": "pt-BR", + "texts": { + "Permission:AuditLogging": "Registro de auditoria", + "Permission:AuditLogs": "Logs de auditoria", + "Menu:AuditLogging": "Logs de auditoria", + "AuditLogs": "Logs de auditoria", + "HttpStatus": "Status Http", + "HttpMethod": "Método Http", + "HttpMethodFilter": "Filtro de Método Http", + "HttpRequest": "Pedido Http", + "User": "Usuário", + "UserNameFilter": "Filtro de Usuário", + "HasException": "Tem exceção", + "IpAddress": "Endereço de IP", + "Time": "Tempo", + "Duration": "Duração", + "Detail": "Detalhe", + "Overall": "No geral", + "Actions": "Ações", + "ClientIpAddress": "Endereço IP do cliente", + "ClientName": "Nome do cliente", + "BrowserInfo": "Informação do navegador", + "Url": "Url", + "UserName": "Nome do usuário", + "UrlFilter": "Filtro de Url", + "Exceptions": "Exceções", + "Comments": "Comentários", + "HttpStatusCode": "Código de status Http", + "HttpStatusCodeFilter": "Filtro de código de status Http", + "ServiceName": "Serviço", + "MethodName": "Método", + "CorrelationId": "Id de Correlação", + "ApplicationName": "Nome da Aplicação", + "ExecutionDuration": "Duração", + "ExtraProperties": "Propriedades extras", + "MaxDuration": "Máx. Duração", + "MinDuration": "Min. Duração", + "{0}Milliseconds": "{0} milissegundos", + "ExecutionTime": "Tempo", + "Parameters": "Parâmetros", + "EntityTypeFullName": "Nome completo do tipo da entidade", + "Entity": "Entidade", + "ChangeType": "Tipo de mudança", + "ChangeTime": "Tempo", + "NewValue": "Novo valor", + "OriginalValue": "Valor original", + "PropertyName": "Nome da propriedade", + "PropertyTypeFullName": "Nome completo do tipo da propriedade", + "Yes": "Sim", + "No": "Não", + "Changes": "Mudanças", + "AverageExecutionDurationInLogsPerDay": "Duração média de execução", + "AverageExecutionDurationInMilliseconds": "Duração média de execução em milissegundos", + "ErrorRateInLogs": "Taxa de erros em registros", + "Success": "Sucesso", + "Fault": "Falha", + "NoChanges": "Sem mudança(s)", + "EntityChanges": "Mudanças da Entidade", + "EntityId": "Id da Entidade", + "EntityChangeStartTime": "Data Mínima de Mudança", + "EntityChangeEndTime": "Data Máxima de Mudança", + "EntityHistory": "História da Entidade", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} por {2}.", + "Created": "Criado", + "Updated": "Atualizado", + "Deleted": "Excluído", + "ChangeHistory": "Histórico de Mudanças", + "FullChangeHistory": "Histórico Completo de Mudanças", + "ChangeDetails": "Detalhes de mudança", + "DurationMs": "Duração (ms)", + "StartDate": "Data inicial", + "EndDate": "Data final", + "Feature:AuditLoggingGroup": "Registro de auditoria", + "Feature:AuditLoggingEnable": "Página de registro de auditoria habilitada", + "Feature:AuditLoggingEnableDescription": "Habilite a página de registro de auditoria no aplicativo." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ru.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ru.json new file mode 100644 index 0000000000..4995b5b8be --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/ru.json @@ -0,0 +1,79 @@ +{ + "culture": "ru", + "texts": { + "Permission:AuditLogging": "Ведение журнала аудита", + "Permission:AuditLogs": "Журналы аудита", + "Menu:AuditLogging": "Журналы аудита", + "AuditLogs": "Журналы аудита", + "HttpStatus": "HTTP-статус", + "HttpMethod": "HTTP-метод", + "HttpMethodFilter": "Фильтр HTTP-методов", + "HttpRequest": "HTTP-запрос", + "User": "Пользователь", + "UserNameFilter": "Пользовательский фильтр", + "HasException": "Имеет исключение", + "IpAddress": "Айпи адрес", + "Time": "Время", + "Duration": "Продолжительность", + "Detail": "Деталь", + "Overall": "В общем и целом", + "Actions": "Действия", + "ClientIpAddress": "IP-адрес клиента", + "ClientName": "имя клиента", + "BrowserInfo": "Информация о браузере", + "Url": "URL", + "UserName": "Имя пользователя", + "UrlFilter": "URL-фильтр", + "Exceptions": "Исключения", + "Comments": "Комментарии", + "HttpStatusCode": "Код состояния HTTP", + "HttpStatusCodeFilter": "Фильтр кода состояния HTTP", + "ServiceName": "Оказание услуг", + "MethodName": "Метод", + "CorrelationId": "Идентификатор корреляции", + "ApplicationName": "Имя приложения", + "ExecutionDuration": "Продолжительность", + "ExtraProperties": "Дополнительные свойства", + "MaxDuration": "Максимум. Продолжительность", + "MinDuration": "Мин. Продолжительность", + "{0}Milliseconds": "{0} миллисекунд", + "ExecutionTime": "Время", + "Parameters": "Параметры", + "EntityTypeFullName": "Тип объекта Полное имя", + "Entity": "Сущность", + "ChangeType": "Тип изменения", + "ChangeTime": "Время", + "NewValue": "Новое значение", + "OriginalValue": "Исходное значение", + "PropertyName": "Имя свойства", + "PropertyTypeFullName": "Тип недвижимости Полное имя", + "Yes": "да", + "No": "Нет", + "Changes": "Изменения", + "AverageExecutionDurationInLogsPerDay": "Средняя продолжительность выполнения", + "AverageExecutionDurationInMilliseconds": "Средняя продолжительность выполнения в миллисекундах", + "ErrorRateInLogs": "Частота ошибок в логах", + "Success": "Успех", + "Fault": "Вина", + "NoChanges": "Без изменений)", + "EntityChanges": "Изменения сущности", + "EntityId": "Идентификатор объекта", + "EntityChangeStartTime": "Минимальная дата изменения", + "EntityChangeEndTime": "Максимальная дата изменения", + "EntityHistory": "История объекта", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} от {2}.", + "Created": "Созданный", + "Updated": "Обновлено", + "Deleted": "Удалено", + "ChangeHistory": "История изменений", + "FullChangeHistory": "Полная история изменений", + "ChangeDetails": "Изменить детали", + "DurationMs": "Продолжительность (мс)", + "StartDate": "Дата начала", + "EndDate": "Дата окончания", + "Feature:AuditLoggingGroup": "Ведение журнала аудита", + "Feature:AuditLoggingEnable": "Включенная страница ведения журнала аудита", + "Feature:AuditLoggingEnableDescription": "Включить страницу ведения журнала аудита в приложении." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sk.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sk.json new file mode 100644 index 0000000000..5d7a6c03bd --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sk.json @@ -0,0 +1,79 @@ +{ + "culture": "sk", + "texts": { + "Permission:AuditLogging": "Audit logovanie", + "Permission:AuditLogs": "Audit logy", + "Menu:AuditLogging": "Audit logy", + "AuditLogs": "Audit logy", + "HttpStatus": "Http stav", + "HttpMethod": "Http metóda", + "HttpMethodFilter": "Filter metódy Http", + "HttpRequest": "Http požiadavka", + "User": "Používateľ", + "UserNameFilter": "Filter používateľa", + "HasException": "Má výnimku", + "IpAddress": "IP adresa", + "Time": "Čas", + "Duration": "Trvanie", + "Detail": "Detail", + "Overall": "Celkovo", + "Actions": "Akcie", + "ClientIpAddress": "IP adresa klienta", + "ClientName": "Názov klienta", + "BrowserInfo": "Informácie o prehliadači", + "Url": "Url", + "UserName": "Meno používateľa", + "UrlFilter": "Filter URL", + "Exceptions": "Výnimky", + "Comments": "Komentáre", + "HttpStatusCode": "Http stavový kód", + "HttpStatusCodeFilter": "Filter stavového kódu Http", + "ServiceName": "Služba", + "MethodName": "Metóda", + "CorrelationId": "Id korelácie", + "ApplicationName": "Názov aplikácie", + "ExecutionDuration": "Trvanie", + "ExtraProperties": "Ďalšie vlastnosti", + "MaxDuration": "Max. trvanie", + "MinDuration": "Min. trvanie", + "{0}Milliseconds": "{0} milisekúnd", + "ExecutionTime": "Čas", + "Parameters": "Parametre", + "EntityTypeFullName": "Úplný názov typu entity", + "Entity": "Entita", + "ChangeType": "Typ zmeny", + "ChangeTime": "Čas", + "NewValue": "Nová hodnota", + "OriginalValue": "Pôvodná hodnota", + "PropertyName": "Názov vlastnosti", + "PropertyTypeFullName": "Úplný názov typu vlastnosti", + "Yes": "Áno", + "No": "Nie", + "Changes": "Zmeny", + "AverageExecutionDurationInLogsPerDay": "Priemerné trvanie vykonávania", + "AverageExecutionDurationInMilliseconds": "Priemerné trvanie vykonávania v milisekundách", + "ErrorRateInLogs": "Miera chybovosti v logoch", + "Success": "Úspech", + "Fault": "Porucha", + "NoChanges": "Žiadna/e zmena/y", + "EntityChanges": "Zmeny entity", + "EntityId": "Id entity", + "EntityChangeStartTime": "Min. dátum zmeny", + "EntityChangeEndTime": "Max. dátum zmeny", + "EntityHistory": "História entity", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} vykonal {2}.", + "Created": "Vytvorená", + "Updated": "Aktualizovaná", + "Deleted": "Zmazaná", + "ChangeHistory": "História zmien", + "FullChangeHistory": "Úplná história zmien", + "ChangeDetails": "Podrobnosti zmeny", + "DurationMs": "Trvanie (ms)", + "StartDate": "Dátum začiatku", + "EndDate": "Dátum konca", + "Feature:AuditLoggingGroup": "Audit logovanie", + "Feature:AuditLoggingEnable": "Povoliť stránku audit logovania", + "Feature:AuditLoggingEnableDescription": "Povolená stránka audit logovania v aplikácii." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sl.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sl.json new file mode 100644 index 0000000000..d5a782dc9e --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/sl.json @@ -0,0 +1,79 @@ +{ + "culture": "sl", + "texts": { + "Permission:AuditLogging": "Revizijsko zapisovanje", + "Permission:AuditLogs": "Revizijski zapisi", + "Menu:AuditLogging": "Revizijski zapisi", + "AuditLogs": "Revizijski zapisi", + "HttpStatus": "Http status", + "HttpMethod": "Http metoda", + "HttpMethodFilter": "Filter Http metode", + "HttpRequest": "Http zahtevek", + "User": "Uporabnik", + "UserNameFilter": "Filter po uporabniku", + "HasException": "Ima napako", + "IpAddress": "Ip naslov", + "Time": "Čas", + "Duration": "Trajanje", + "Detail": "Podrobnosti", + "Overall": "Splošno", + "Actions": "Dejanja", + "ClientIpAddress": "Ip naslov odjemalca", + "ClientName": "Ime odjemalca", + "BrowserInfo": "Informacije o brskalniku", + "Url": "Url", + "UserName": "Uporabniško ime", + "UrlFilter": "Filter po Url", + "Exceptions": "Napake", + "Comments": "Komentarji", + "HttpStatusCode": "Http koda statusa", + "HttpStatusCodeFilter": "Filter po kodi statusa", + "ServiceName": "Storitev", + "MethodName": "Metoda", + "CorrelationId": "Id korelacije", + "ApplicationName": "Ime aplikacije", + "ExecutionDuration": "Trajanje", + "ExtraProperties": "Dodatne lastnosti", + "MaxDuration": "Najd. trajanje", + "MinDuration": "Najk. trajanje", + "{0}Milliseconds": "{0} milisekund", + "ExecutionTime": "Čas", + "Parameters": "Parametri", + "EntityTypeFullName": "Polno ime vrste entitete", + "Entity": "Entiteta", + "ChangeType": "Vrsta spremember", + "ChangeTime": "Čas", + "NewValue": "Nova vrednost", + "OriginalValue": "Prvotna vrednost", + "PropertyName": "Ime lastnosti", + "PropertyTypeFullName": "Polno ime vrste lastnosti", + "Yes": "Da", + "No": "Ne", + "Changes": "Spremembe", + "AverageExecutionDurationInLogsPerDay": "Povprečno trajanje izvedbe", + "AverageExecutionDurationInMilliseconds": "Povprečno trajanje izvedbe v milisekundah", + "ErrorRateInLogs": "Stopnja napak v zapisih", + "Success": "Uspešno", + "Fault": "Napaka", + "NoChanges": "Ni sprememb", + "EntityChanges": "Spremembe entitet", + "EntityId": "Id. subjekta", + "EntityChangeStartTime": "Najmanjši datum spremembe", + "EntityChangeEndTime": "Največji datum spremembe", + "EntityHistory": "Zgodovina entitete", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} avtorja {2}.", + "Created": "Ustvarjeno", + "Updated": "Posodobljeno", + "Deleted": "Izbrisano", + "ChangeHistory": "Zgodovina sprememb", + "FullChangeHistory": "Popolna zgodovina sprememb", + "ChangeDetails": "Spremeni podrobnosti", + "DurationMs": "Trajanje (ms)", + "StartDate": "Začetni datum", + "EndDate": "Končni datum", + "Feature:AuditLoggingGroup": "Revizijsko beleženje", + "Feature:AuditLoggingEnable": "Omogočena stran za beleženje revizije", + "Feature:AuditLoggingEnableDescription": "Omogočite stran za beleženje revizije v aplikaciji." + } +} \ No newline at end of file diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/tr.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/tr.json new file mode 100644 index 0000000000..72b93ad2f4 --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/tr.json @@ -0,0 +1,81 @@ +{ + "culture": "tr", + "texts": { + "Permission:AuditLogging": "İşlem Kayıtları", + "Permission:AuditLogs": "İşlem Kayıtlarına erişim", + "Actions": "Aksiyonlar", + "AuditLogs": "Kullanıcı işlem logları", + "BrowserInfo": "Tarayıcı Bilgisi", + "Changes": "Değişiklikler", + "ChangeTime": "Değişiklik Tarihi", + "ChangeType": "Değişiklik Türü", + "ClientIpAddress": "İstemci Ip Adresi", + "ClientName": "İstemci Adı", + "Comments": "Yorumlar", + "Detail": "Detay", + "Duration": "Süre", + "Entity": "Entity", + "EntityTypeFullName": "Entity Tipi", + "Exceptions": "Hatalar", + "ExecutionDuration": "Geçen Süre", + "HasException": "Hata var mı?", + "MaxDuration": "Max. süre", + "MinDuration": "Min. süre", + "ExecutionTime": "İşlem Tarihi", + "HttpMethod": "Http Metodu", + "HttpMethodFilter": "Http Method Filtresi", + "HttpRequest": "Http İstemi", + "HttpStatus": "Http Durumu", + "HttpStatusCode": "Http Durum Kodu", + "HttpStatusCodeFilter": "Http Durum Kodu Filtresi", + "CorrelationId": "Korelasyon ID", + "ApplicationName": "Uygulama ismi", + "IpAddress": "Ip Adresi", + "Menu:AuditLogging": "Kullanıcı işlem logları", + "MethodName": "Method", + "ExtraProperties": "Ekstra özellikler", + "NewValue": "Yeni Değer", + "{0}Milliseconds": "{0} milisaniye", + "OriginalValue": "İlk Değer", + "Overall": "Genel", + "Parameters": "Parametreler", + "PropertyName": "Property Adı", + "PropertyTypeFullName": "Property Türü", + "ServiceName": "Servis", + "Time": "Tarih", + "Url": "Url", + "UserName": "Kullanıcı adı", + "TenantImpersonator": "Kiracı Taklitçisi", + "UserImpersonator": "Kullanıcı Taklitçisi", + "UrlFilter": "Url Filtresi", + "User": "Kullanıcı", + "Yes": "Evet", + "No": "Hayır", + "UserNameFilter": "Kullanıcı Filtresi", + "AverageExecutionDurationInLogsPerDay": "Ortalama işlem süresi", + "AverageExecutionDurationInMilliseconds": "Milisaniye cinsinden ortalama işlem süresi", + "ErrorRateInLogs": "Loglardaki hata oranı", + "Success": "Başarılı", + "Fault": "Hatalı", + "NoChanges": "Değişiklik yok", + "EntityChanges": "Entity Değişiklikleri", + "EntityId": "Entity Id", + "EntityChangeStartTime": "Min Değişiklik Tarihi", + "EntityChangeEndTime": "Max Değişiklik Tarihi", + "EntityHistory": "Entity Geçmişi", + "DaysAgoTitle": "{1} {0}.", + "DaysAgoWithUserTitle": "{1} {2} tarafından {0}.", + "Created": "Oluşturuldu", + "Updated": "Güncellendi", + "Deleted": "Silindi", + "ChangeHistory": "Değişiklik Geçmişi", + "FullChangeHistory": "Tüm Değişiklik Geçmişi", + "ChangeDetails": "Değişiklik Detayı", + "DurationMs": "Süre (ms)", + "StartDate": "Başlangıç Tarihi", + "EndDate": "Bitiş Tarihi", + "Feature:AuditLoggingGroup": "İşlem Kayıtları", + "Feature:AuditLoggingEnable": "İşlem kayıtları sayfasını etkinleştirin", + "Feature:AuditLoggingEnableDescription": "Uygulamadanızdaki işlem kayıtları sayfasını etkinleştirir." + } +} diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hans.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hans.json new file mode 100644 index 0000000000..a3aed9f1df --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hans.json @@ -0,0 +1,81 @@ +{ + "culture": "zh-Hans", + "texts": { + "Permission:AuditLogging": "审计日志", + "Permission:AuditLogs": "审计日志", + "Menu:AuditLogging": "审计日志", + "AuditLogs": "审计日志", + "HttpStatus": "Http状态", + "HttpMethod": "Http方法", + "HttpMethodFilter": "Http方法过滤", + "HttpRequest": "Http请求", + "User": "用户", + "UserNameFilter": "用户过滤", + "HasException": "存在异常", + "IpAddress": "IP地址", + "Time": "时间", + "Duration": "持续时间", + "Detail": "详情", + "Overall": "总体", + "Actions": "操作", + "ClientIpAddress": "客户端IP地址", + "ClientName": "客户端名称", + "BrowserInfo": "浏览器信息", + "Url": "Url", + "UserName": "用户名", + "TenantImpersonator": "租户模拟", + "UserImpersonator": "用户模拟", + "UrlFilter": "Url过滤", + "Exceptions": "异常", + "Comments": "评论", + "HttpStatusCode": "Http状态码", + "HttpStatusCodeFilter": "Http状态码过滤", + "ServiceName": "服务名称", + "MethodName": "方法名称", + "CorrelationId": "关联Id", + "ApplicationName": "应用名称", + "ExecutionDuration": "持续时间", + "ExtraProperties": "额外属性", + "MaxDuration": "最大持续时间", + "MinDuration": "最小持续时间", + "{0}Milliseconds": "{0} 毫秒", + "ExecutionTime": "时间", + "Parameters": "参数", + "EntityTypeFullName": "实体类型全名", + "Entity": "实体", + "ChangeType": "更改类型", + "ChangeTime": "时间", + "NewValue": "新值", + "OriginalValue": "原始值", + "PropertyName": "属性名称", + "PropertyTypeFullName": "属性类型全名", + "Yes": "Yes", + "No": "No", + "Changes": "变化", + "AverageExecutionDurationInLogsPerDay": "平均处理时间(每天日志)", + "AverageExecutionDurationInMilliseconds": "平均处理时间(毫秒)", + "ErrorRateInLogs": "日志中的错误率", + "Success": "成功", + "Fault": "故障", + "NoChanges": "没有变化", + "EntityChanges": "实体变更", + "EntityId": "实体Id", + "EntityChangeStartTime": "最小更改日期", + "EntityChangeEndTime": "最大更改日期", + "EntityHistory": "实体历史", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} 通过 {2}.", + "Created": "创建", + "Updated": "更新", + "Deleted": "已删除", + "ChangeHistory": "变更记录", + "FullChangeHistory": "完整的变更记录", + "ChangeDetails": "变更详情", + "DurationMs": "持续时间(毫秒)", + "StartDate": "开始时间", + "EndDate": "结束时间", + "Feature:AuditLoggingGroup": "审计日志", + "Feature:AuditLoggingEnable": "启用审计日志页面", + "Feature:AuditLoggingEnableDescription": "在应用程序中启用审计日志页面." + } +} diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hant.json b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hant.json new file mode 100644 index 0000000000..a828fa8e17 --- /dev/null +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/zh-Hant.json @@ -0,0 +1,81 @@ +{ + "culture": "zh-Hant", + "texts": { + "Permission:AuditLogging": "審計日誌", + "Permission:AuditLogs": "審計日誌", + "Menu:AuditLogging": "審計日誌", + "AuditLogs": "審計日誌", + "HttpStatus": "Http狀態", + "HttpMethod": "Http方法", + "HttpMethodFilter": "Http方法過濾", + "HttpRequest": "Http請求", + "User": "使用者", + "UserNameFilter": "使用者過濾", + "HasException": "存在異常", + "IpAddress": "IP地址", + "Time": "時間", + "Duration": "持續時間", + "Detail": "詳情", + "Overall": "總體", + "Actions": "操作", + "ClientIpAddress": "客戶端IP地址", + "ClientName": "客戶端名稱", + "BrowserInfo": "瀏覽器資訊", + "Url": "Url", + "UserName": "使用者名稱", + "TenantImpersonator": "租戶模擬", + "UserImpersonator": "用戶模擬", + "UrlFilter": "Url過濾", + "Exceptions": "異常", + "Comments": "評論", + "HttpStatusCode": "Http狀態碼", + "HttpStatusCodeFilter": "Http狀態碼過濾", + "ServiceName": "服務名稱", + "MethodName": "方法名稱", + "CorrelationId": "關聯Id", + "ApplicationName": "應用名稱", + "ExecutionDuration": "持續時間", + "ExtraProperties": "額外屬性", + "MaxDuration": "最大持續時間", + "MinDuration": "最小持續時間", + "{0}Milliseconds": "{0} 毫秒", + "ExecutionTime": "時間", + "Parameters": "參數", + "EntityTypeFullName": "實體型別全名", + "Entity": "實體", + "ChangeType": "更改型別", + "ChangeTime": "時間", + "NewValue": "新值", + "OriginalValue": "原始值", + "PropertyName": "屬性名稱", + "PropertyTypeFullName": "屬性型別全名", + "Yes": "Yes", + "No": "No", + "Changes": "變化", + "AverageExecutionDurationInLogsPerDay": "平均處理時間(每天日誌)", + "AverageExecutionDurationInMilliseconds": "平均處理時間(毫秒)", + "ErrorRateInLogs": "日誌中的錯誤率", + "Success": "成功", + "Fault": "故障", + "NoChanges": "沒有變化", + "EntityChanges": "實體變更", + "EntityId": "實體Id", + "EntityChangeStartTime": "最小更改日期", + "EntityChangeEndTime": "最大更改日期", + "EntityHistory": "實體歷史", + "DaysAgoTitle": "{0} {1}.", + "DaysAgoWithUserTitle": "{0} {1} 通過 {2}.", + "Created": "建立", + "Updated": "更新", + "Deleted": "已刪除", + "ChangeHistory": "變更記錄", + "FullChangeHistory": "完整的變更記錄", + "ChangeDetails": "變更詳情", + "DurationMs": "持續時間(毫秒)", + "StartDate": "開始時間", + "EndDate": "結束時間", + "Feature:AuditLoggingGroup": "審計日誌", + "Feature:AuditLoggingEnable": "啟用審計日誌頁面", + "Feature:AuditLoggingEnableDescription": "在應用程序中啟用審計日誌頁面." + } +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDbProperties.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDbProperties.cs similarity index 86% rename from modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDbProperties.cs rename to modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDbProperties.cs index 401aa379a7..85e44815a2 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDbProperties.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/AbpBackgroundJobsDbProperties.cs @@ -2,7 +2,7 @@ namespace Volo.Abp.BackgroundJobs; -public static class BackgroundJobsDbProperties +public static class AbpBackgroundJobsDbProperties { public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs index fb01736cfa..0beef8d3ea 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore; [IgnoreMultiTenancy] -[ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsDbContext : AbpDbContext, IBackgroundJobsDbContext { public DbSet BackgroundJobs { get; set; } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs index bf9f8d5ea3..849ac3c5d5 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs @@ -18,7 +18,7 @@ public static class BackgroundJobsDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", BackgroundJobsDbProperties.DbSchema); + b.ToTable(AbpBackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs", AbpBackgroundJobsDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs index b091ac126a..a6276e37f8 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore; [IgnoreMultiTenancy] -[ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsDbContext : IEfCoreDbContext { DbSet BackgroundJobs { get; } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs index 42b8a44f0d..8a94e26650 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB; [IgnoreMultiTenancy] -[ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsMongoDbContext : AbpMongoDbContext, IBackgroundJobsMongoDbContext { public IMongoCollection BackgroundJobs { get; set; } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs index b687bf8f90..a4f255c724 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs @@ -11,7 +11,7 @@ public static class BackgroundJobsMongoDbContextExtensions builder.Entity(b => { - b.CollectionName = BackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs"; + b.CollectionName = AbpBackgroundJobsDbProperties.DbTablePrefix + "BackgroundJobs"; }); } } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs index 4f93e1cbe5..d8a94b740d 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB; [IgnoreMultiTenancy] -[ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsMongoDbContext : IAbpMongoDbContext { IMongoCollection BackgroundJobs { get; } diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor index 01500c8801..4d79218662 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor @@ -1,4 +1,7 @@ -@using Volo.Abp.AspNetCore.Components.Web.Theming.Components; +@using Volo.Abp.Ui.LayoutHooks +@using Volo.Abp.AspNetCore.Components.Web.Theming.Components.LayoutHooks +@using Volo.Abp.AspNetCore.Components.Web.Theming.Components +@using Volo.Abp.AspNetCore.Components.Web.Theming.Layout @inherits LayoutComponentBase
+ @Body + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml index f71171912c..02adac253b 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Account.cshtml @@ -12,6 +12,7 @@ @using Volo.Abp.MultiTenancy @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IOptions MultiTenancyOptions @inject ICurrentTenant CurrentTenant @@ -95,6 +96,7 @@ + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml index 23c19c077d..4c91b8edfb 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml @@ -8,6 +8,7 @@ @using Volo.Abp.AspNetCore.Mvc.UI.Widgets.Components.WidgetStyles @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IPageLayout PageLayout @{ @@ -58,7 +59,7 @@ @(await Component.InvokeAsync())
- @RenderSection("content_toolbar", false) + @await RenderSectionAsync("content_toolbar", false)
@await Component.InvokeLayoutHookAsync(LayoutHooks.PageContent.First, StandardLayouts.Application) @@ -68,6 +69,7 @@ + diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml index 70c7d5e1e8..aaef7898c3 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Empty.cshtml @@ -7,6 +7,7 @@ @using Volo.Abp.AspNetCore.Mvc.UI.Widgets.Components.WidgetStyles @using Volo.Abp.Localization @using Volo.Abp.Ui.Branding +@using Volo.Abp.Ui.LayoutHooks @inject IBrandingProvider BrandingProvider @inject IPageLayout PageLayout @{ @@ -63,6 +64,7 @@ + diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/Localization/hu.json b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/Localization/hu.json index 4d2c1794d2..74d9375464 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/Localization/hu.json +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/Localization/hu.json @@ -1,6 +1,6 @@ { - "culture": "hu", - "texts": { - "MyAccount": "A fiókom" - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "MyAccount": "A fiókom" + } +} \ No newline at end of file diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/BlobStoringDatabaseDbProperties.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/AbpBlobStoringDatabaseDbProperties.cs similarity index 85% rename from modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/BlobStoringDatabaseDbProperties.cs rename to modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/AbpBlobStoringDatabaseDbProperties.cs index a9689eb9fd..19985351de 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/BlobStoringDatabaseDbProperties.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/AbpBlobStoringDatabaseDbProperties.cs @@ -2,7 +2,7 @@ namespace Volo.Abp.BlobStoring.Database; -public static class BlobStoringDatabaseDbProperties +public static class AbpBlobStoringDatabaseDbProperties { public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs index b20f5190c4..f3e7661366 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContext.cs @@ -4,7 +4,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; -[ConnectionStringName(BlobStoringDatabaseDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBlobStoringDatabaseDbProperties.ConnectionStringName)] public class BlobStoringDbContext : AbpDbContext, IBlobStoringDbContext { public DbSet BlobContainers { get; set; } diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs index e4fad62e37..6be009f3ec 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/BlobStoringDbContextModelCreatingExtensions.cs @@ -12,7 +12,7 @@ public static class BlobStoringDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", BlobStoringDatabaseDbProperties.DbSchema); + b.ToTable(AbpBlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers", AbpBlobStoringDatabaseDbProperties.DbSchema); b.ConfigureByConvention(); @@ -27,7 +27,7 @@ public static class BlobStoringDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", BlobStoringDatabaseDbProperties.DbSchema); + b.ToTable(AbpBlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs", AbpBlobStoringDatabaseDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs index b36c0753d3..b139d8473b 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.EntityFrameworkCore/Volo/Abp/BlobStoring/Database/EntityFrameworkCore/IBlobStoringDbContext.cs @@ -4,7 +4,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore; -[ConnectionStringName(BlobStoringDatabaseDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBlobStoringDatabaseDbProperties.ConnectionStringName)] public interface IBlobStoringDbContext : IEfCoreDbContext { DbSet BlobContainers { get; } diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContext.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContext.cs index d0be5f4973..108804fbb9 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContext.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContext.cs @@ -4,7 +4,7 @@ using Volo.Abp.MongoDB; namespace Volo.Abp.BlobStoring.Database.MongoDB; -[ConnectionStringName(BlobStoringDatabaseDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBlobStoringDatabaseDbProperties.ConnectionStringName)] public class BlobStoringMongoDbContext : AbpMongoDbContext, IBlobStoringMongoDbContext { public IMongoCollection BlobContainers => Collection(); diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs index 7943215534..28c3bdde7f 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/BlobStoringMongoDbContextExtensions.cs @@ -11,12 +11,12 @@ public static class BlobStoringMongoDbContextExtensions builder.Entity(b => { - b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers"; + b.CollectionName = AbpBlobStoringDatabaseDbProperties.DbTablePrefix + "BlobContainers"; }); builder.Entity(b => { - b.CollectionName = BlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs"; + b.CollectionName = AbpBlobStoringDatabaseDbProperties.DbTablePrefix + "Blobs"; }); } } diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/IBlobStoringMongoDbContext.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/IBlobStoringMongoDbContext.cs index 1fcf61b146..803ed5171d 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/IBlobStoringMongoDbContext.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.MongoDB/Volo/Abp/BlobStoring/Database/MongoDB/IBlobStoringMongoDbContext.cs @@ -4,7 +4,7 @@ using Volo.Abp.MongoDB; namespace Volo.Abp.BlobStoring.Database.MongoDB; -[ConnectionStringName(BlobStoringDatabaseDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpBlobStoringDatabaseDbProperties.ConnectionStringName)] public interface IBlobStoringMongoDbContext : IAbpMongoDbContext { IMongoCollection BlobContainers { get; } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/hu.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/hu.json index c6911aeaf9..d7a5429e46 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/hu.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/hu.json @@ -56,6 +56,8 @@ "ShareOn": "Ossza meg", "TitleLengthWarning": "A címméret 60 karakter alatt maradjon hogy SEO-barát legyen!", "ClearCache": "Törölje a gyorsítótárat", - "ClearCacheConfirmationMessage": "Biztosan törli a gyorsítótárat?" + "ClearCacheConfirmationMessage": "Biztosan törli a gyorsítótárat?", + "MarkdownSupported": "A Markdown támogatott", + "FileUploadInfo": "Húzza, ejtse vagy illessze be a másolt képet." } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json index f26b339d71..bb19760972 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/pt-BR.json @@ -37,7 +37,7 @@ "Edit": "Editar", "BLOG": "BLOG", "CommentDeletionWarningMessage": "O comentário será excluído.", - "PostDeletionWarningMessage": "O post será excluído.", + "PostDeletionWarningMessage": "A postagem será excluída.", "BlogDeletionWarningMessage": "O Blog será excluído.", "AreYouSure": "Você tem certeza?", "CommentWithCount": "{0} comentários", @@ -54,8 +54,10 @@ "Blogs": "Blogs", "Tags": "Etiquetas", "ShareOn": "Compartilhar no", - "TitleLengthWarning": "Mantenha o tamanho do título abaixo de 60 caracteres para ser SEO amigável!", + "TitleLengthWarning": "Mantenha o tamanho do título abaixo de 60 caracteres para ser amigável ao SEO!", "ClearCache": "Limpar cache", - "ClearCacheConfirmationMessage": "Tem certeza de que deseja limpar o cache?" + "ClearCacheConfirmationMessage": "Tem certeza de que deseja limpar o cache?", + "MarkdownSupported": "Markdown é suportado", + "FileUploadInfo": "Arrastar, soltar, ou colar uma imagem copiada." } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDbProperties.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/AbpBloggingDbProperties.cs similarity index 90% rename from modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDbProperties.cs rename to modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/AbpBloggingDbProperties.cs index 6f57d5f404..464ea2c348 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDbProperties.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/AbpBloggingDbProperties.cs @@ -1,6 +1,6 @@ namespace Volo.Blogging { - public static class BloggingDbProperties + public static class AbpBloggingDbProperties { /// /// Default value: "Blg". diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs index 85c34aa996..9ccbe3aa3b 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs @@ -11,7 +11,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { [IgnoreMultiTenancy] - [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] + [ConnectionStringName(AbpBloggingDbProperties.ConnectionStringName)] public class BloggingDbContext : AbpDbContext, IBloggingDbContext { public DbSet Users { get; set; } diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs index 3386da25a5..abf96ebcef 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs @@ -25,7 +25,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "Users", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Users", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); b.ConfigureAbpUser(); @@ -35,7 +35,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "Blogs", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Blogs", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -48,7 +48,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "Posts", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Posts", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -68,7 +68,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "Comments", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Comments", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -84,7 +84,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "Tags", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Tags", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); @@ -99,7 +99,7 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { - b.ToTable(BloggingDbProperties.DbTablePrefix + "PostTags", BloggingDbProperties.DbSchema); + b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "PostTags", AbpBloggingDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs index 4eb8f35c03..ce63597029 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs @@ -11,7 +11,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { [IgnoreMultiTenancy] - [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] + [ConnectionStringName(AbpBloggingDbProperties.ConnectionStringName)] public interface IBloggingDbContext : IEfCoreDbContext { DbSet Users { get; } diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs index 1f20ff1744..d782f0fb1b 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs @@ -10,7 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { [IgnoreMultiTenancy] - [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] + [ConnectionStringName(AbpBloggingDbProperties.ConnectionStringName)] public class BloggingMongoDbContext : AbpMongoDbContext, IBloggingMongoDbContext { public IMongoCollection Users => Collection(); diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs index b04f0a74fc..1083169761 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContextExtensions.cs @@ -16,27 +16,27 @@ namespace Volo.Blogging.MongoDB builder.Entity(b => { - b.CollectionName = BloggingDbProperties.DbTablePrefix + "Users"; + b.CollectionName = AbpBloggingDbProperties.DbTablePrefix + "Users"; }); builder.Entity(b => { - b.CollectionName = BloggingDbProperties.DbTablePrefix + "Blogs"; + b.CollectionName = AbpBloggingDbProperties.DbTablePrefix + "Blogs"; }); builder.Entity(b => { - b.CollectionName = BloggingDbProperties.DbTablePrefix + "Posts"; + b.CollectionName = AbpBloggingDbProperties.DbTablePrefix + "Posts"; }); builder.Entity(b => { - b.CollectionName = BloggingDbProperties.DbTablePrefix + "Tags"; + b.CollectionName = AbpBloggingDbProperties.DbTablePrefix + "Tags"; }); builder.Entity(b => { - b.CollectionName = BloggingDbProperties.DbTablePrefix + "Comments"; + b.CollectionName = AbpBloggingDbProperties.DbTablePrefix + "Comments"; }); } } diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs index 1dbf5eee92..d3c898a14d 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs @@ -10,7 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { [IgnoreMultiTenancy] - [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] + [ConnectionStringName(AbpBloggingDbProperties.ConnectionStringName)] public interface IBloggingMongoDbContext : IAbpMongoDbContext { IMongoCollection Users { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs index 245526cfc2..11466463f8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Tags/EntityTagSetDto.cs @@ -1,15 +1,40 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; +using Volo.Abp.Validation.Localization; +using Volo.CmsKit.Localization; +using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags; [Serializable] -public class EntityTagSetDto +public class EntityTagSetDto : IValidatableObject { public string EntityId { get; set; } + public string EntityType { get; set; } + + [Required] public List Tags { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var l = validationContext.GetRequiredService>(); + + foreach (var tag in Tags) + { + if (tag.Length > TagConsts.MaxNameLength) + { + yield return new ValidationResult( + l[ + "ThisFieldMustBeAStringWithAMaximumLengthOf{0}", + TagConsts.MaxNameLength + ], + new[] { nameof(Tags) } + ); + } + } + } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs index 7cd17b7696..5736048076 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogAdminAppService.cs @@ -1,16 +1,19 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [Authorize(CmsKitAdminPermissions.Blogs.Default)] public class BlogAdminAppService : CmsKitAdminAppServiceBase, IBlogAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs index 823f569bed..774f28634d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminAppService.cs @@ -1,15 +1,18 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [Authorize(CmsKitAdminPermissions.Blogs.Features)] public class BlogFeatureAdminAppService : CmsKitAdminAppServiceBase, IBlogFeatureAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs index 9d8fcfd917..297e70344f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs @@ -1,19 +1,22 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.Users; using Volo.CmsKit.Admin.MediaDescriptors; using Volo.CmsKit.Blogs; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; using Volo.CmsKit.Users; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [Authorize(CmsKitAdminPermissions.BlogPosts.Default)] public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppService @@ -66,18 +69,18 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe public virtual async Task UpdateAsync(Guid id, UpdateBlogPostDto input) { var blogPost = await BlogPostRepository.GetAsync(id); - + blogPost.SetTitle(input.Title); blogPost.SetShortDescription(input.ShortDescription); blogPost.SetContent(input.Content); blogPost.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); - + if (blogPost.CoverImageMediaId != null && input.CoverImageMediaId == null) { await MediaDescriptorAdminAppService.DeleteAsync(blogPost.CoverImageMediaId.Value); } blogPost.CoverImageMediaId = input.CoverImageMediaId; - + if (blogPost.Slug != input.Slug) { await BlogPostManager.SetSlugUrlAsync(blogPost, input.Slug); @@ -146,12 +149,12 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe { var blogPost = await CreateAsync(input); await CurrentUnitOfWork.SaveChangesAsync(); - + await PublishAsync(blogPost.Id); blogPost.Status = BlogPostStatus.Published; return blogPost; } - + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] public virtual async Task SendToReviewAsync(Guid id) { @@ -159,13 +162,13 @@ public class BlogPostAdminAppService : CmsKitAppServiceBase, IBlogPostAdminAppSe blogPost.SetWaitingForReview(); await BlogPostRepository.UpdateAsync(blogPost); } - + [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] public virtual async Task CreateAndSendToReviewAsync(CreateBlogPostDto input) { var blogPost = await CreateAsync(input); await CurrentUnitOfWork.SaveChangesAsync(); - + await SendToReviewAsync(blogPost.Id); blogPost.Status = BlogPostStatus.WaitingForReview; return blogPost; diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs index 5295557860..973a74b58e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs @@ -3,14 +3,17 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Comments; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; using Volo.CmsKit.Users; namespace Volo.CmsKit.Admin.Comments; +[RequiresFeature(CmsKitFeatures.CommentEnable)] [RequiresGlobalFeature(typeof(CommentsFeature))] [Authorize(CmsKitAdminPermissions.Comments.Default)] public class CommentAdminAppService : CmsKitAdminAppServiceBase, ICommentAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminAppService.cs index a78a21de41..c5b63db6c3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminAppService.cs @@ -1,13 +1,16 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Services; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.GlobalResources; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.GlobalResources; +[RequiresFeature(CmsKitFeatures.GlobalResourceEnable)] [RequiresGlobalFeature(typeof(GlobalResourcesFeature))] [Authorize(CmsKitAdminPermissions.GlobalResources.Default)] public class GlobalResourceAdminAppService : ApplicationService, IGlobalResourceAdminAppService @@ -18,10 +21,11 @@ public class GlobalResourceAdminAppService : ApplicationService, IGlobalResource { GlobalResourceManager = globalResourceManager; } - + public async Task GetAsync() { - return new GlobalResourcesDto { + return new GlobalResourcesDto + { StyleContent = (await GlobalResourceManager.GetGlobalStyleAsync()).Value, ScriptContent = (await GlobalResourceManager.GetGlobalScriptAsync()).Value }; diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminAppService.cs index cc785adac0..af347bcc55 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminAppService.cs @@ -1,12 +1,15 @@ using System; using System.Threading.Tasks; using Volo.Abp.BlobStoring; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.MediaDescriptors; namespace Volo.CmsKit.Admin.MediaDescriptors; +[RequiresFeature(CmsKitFeatures.MediaEnable)] [RequiresGlobalFeature(typeof(MediaFeature))] public class MediaDescriptorAdminAppService : CmsKitAdminAppServiceBase, IMediaDescriptorAdminAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs index 8ef6ce0346..3ba2a4b5b9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Menus/MenuItemAdminAppService.cs @@ -1,12 +1,12 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Menus; using Volo.CmsKit.Pages; @@ -14,6 +14,7 @@ using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Menus; +[RequiresFeature(CmsKitFeatures.MenuEnable)] [RequiresGlobalFeature(typeof(MenuFeature))] [Authorize(CmsKitAdminPermissions.Menus.Default)] public class MenuItemAdminAppService : CmsKitAdminAppServiceBase, IMenuItemAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs index 68f0690555..647568e561 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs @@ -1,18 +1,19 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using AutoMapper; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.Admin.Menus; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Pages; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Pages; +[RequiresFeature(CmsKitFeatures.PageEnable)] [RequiresGlobalFeature(typeof(PagesFeature))] [Authorize(CmsKitAdminPermissions.Pages.Default)] public class PageAdminAppService : CmsKitAdminAppServiceBase, IPageAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs index 8d106b70e0..3cdc4dc093 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/EntityTagAdminAppService.cs @@ -1,10 +1,13 @@ using System.Threading.Tasks; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags; +[RequiresFeature(CmsKitFeatures.TagEnable)] [RequiresGlobalFeature(typeof(TagsFeature))] public class EntityTagAdminAppService : CmsKitAdminAppServiceBase, IEntityTagAdminAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs index f6de1ac5b9..46324937cc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Tags/TagAdminAppService.cs @@ -1,18 +1,21 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Localization; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Localization; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags; +[RequiresFeature(CmsKitFeatures.TagEnable)] [Authorize(CmsKitAdminPermissions.Tags.Default)] [RequiresGlobalFeature(typeof(TagsFeature))] public class TagAdminAppService : CmsKitAppServiceBase, ITagAdminAppService diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs index 094c1b1b5a..e7d59ddbcd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogAdminController.cs @@ -1,15 +1,18 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; +using System; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs index e3cc3c5e73..93bdced888 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogFeatureAdminController.cs @@ -1,16 +1,19 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs index 563d90c254..923f9a4036 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Blogs/BlogPostAdminController.cs @@ -1,15 +1,18 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; +using System; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] @@ -61,7 +64,7 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.UpdateAsync(id, input); } - + [HttpPost] [Route("{id}/publish")] [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] @@ -69,7 +72,7 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.PublishAsync(id); } - + [HttpPost] [Route("{id}/draft")] [Authorize(CmsKitAdminPermissions.BlogPosts.Update)] @@ -86,7 +89,7 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.CreateAndPublishAsync(input); } - + [HttpPost] [Route("{id}/send-to-review")] [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] @@ -94,7 +97,7 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.SendToReviewAsync(id); } - + [HttpPost] [Route("create-and-send-to-review")] [Authorize(CmsKitAdminPermissions.BlogPosts.Create)] @@ -102,7 +105,7 @@ public class BlogPostAdminController : CmsKitAdminController, IBlogPostAdminAppS { return BlogPostAdminAppService.CreateAndSendToReviewAsync(input); } - + [HttpGet] [Route("has-blogpost-waiting-for-review")] [Authorize(CmsKitAdminPermissions.BlogPosts.Publish)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs index 6082ad3794..f4813f61ad 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Comments/CommentAdminController.cs @@ -4,12 +4,15 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Comments; +[RequiresFeature(CmsKitFeatures.CommentEnable)] [Authorize(CmsKitAdminPermissions.Comments.Default)] [RequiresGlobalFeature(typeof(CommentsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminController.cs index 3bfe51a600..b1ae9b3f2e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/GlobalResources/GlobalResourceAdminController.cs @@ -2,18 +2,21 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.GlobalResources; +[RequiresFeature(CmsKitFeatures.GlobalResourceEnable)] [RequiresGlobalFeature(typeof(GlobalResourcesFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] [Authorize(CmsKitAdminPermissions.Menus.Default)] [Route("api/cms-kit-admin/global-resources")] -public class GlobalResourceAdminController: CmsKitAdminController, IGlobalResourceAdminAppService +public class GlobalResourceAdminController : CmsKitAdminController, IGlobalResourceAdminAppService { private readonly IGlobalResourceAdminAppService _globalResourceAdminAppService; @@ -21,7 +24,7 @@ public class GlobalResourceAdminController: CmsKitAdminController, IGlobalResour { _globalResourceAdminAppService = globalResourceAdminAppService; } - + [HttpGet] public Task GetAsync() { diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs index f95d2a86b2..c304c5c684 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/MediaDescriptors/MediaDescriptorAdminController.cs @@ -1,16 +1,15 @@ using System; -using System.Net; using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; -using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.MediaDescriptors; +[RequiresFeature(CmsKitFeatures.MediaEnable)] [RequiresGlobalFeature(typeof(MediaFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Menus/MenuItemAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Menus/MenuItemAdminController.cs index de36883ff7..a0325f4f27 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Menus/MenuItemAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Menus/MenuItemAdminController.cs @@ -1,16 +1,19 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; +using System; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Menus; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Menus; +[RequiresFeature(CmsKitFeatures.MenuEnable)] [RequiresGlobalFeature(typeof(MenuFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs index 7936b206e6..5acccb07aa 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Pages/PageAdminController.cs @@ -4,13 +4,15 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.Admin.Menus; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Pages; +[RequiresFeature(CmsKitFeatures.PageEnable)] [RequiresGlobalFeature(typeof(PagesFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/EntityTagAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/EntityTagAdminController.cs index 9df9394fdd..c57e7bb0a7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/EntityTagAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/EntityTagAdminController.cs @@ -1,13 +1,14 @@ -using Microsoft.AspNetCore.Authorization; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; -using Volo.CmsKit.Permissions; namespace Volo.CmsKit.Admin.Tags; +[RequiresFeature(CmsKitFeatures.TagEnable)] [RequiresGlobalFeature(typeof(TagsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs index c34107b742..db0131ba2f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Tags/TagAdminController.cs @@ -1,18 +1,20 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.Admin.Tags; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Permissions; using Volo.CmsKit.Tags; namespace Volo.CmsKit.Admin.Tags; +[RequiresFeature(CmsKitFeatures.TagEnable)] [RequiresGlobalFeature(typeof(TagsFeature))] [RemoteService(Name = CmsKitAdminRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitAdminRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs index 9d212f9c82..8762373383 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Menus/CmsKitAdminMenuContributor.cs @@ -2,8 +2,10 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.UI.Navigation; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Localization; using Volo.CmsKit.Permissions; @@ -37,6 +39,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/Pages", "fa fa-file-alt", order: 6) + .RequireFeatures(CmsKitFeatures.PageEnable) .RequireGlobalFeatures(typeof(PagesFeature)) .RequirePermissions(CmsKitAdminPermissions.Pages.Default)); @@ -46,6 +49,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/Blogs", "fa fa-blog", order: 1) + .RequireFeatures(CmsKitFeatures.BlogEnable) .RequireGlobalFeatures(typeof(BlogsFeature)) .RequirePermissions(CmsKitAdminPermissions.Blogs.Default)); @@ -55,6 +59,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/BlogPosts", "fa fa-file-signature", order: 2) + .RequireFeatures(CmsKitFeatures.BlogEnable) .RequireGlobalFeatures(typeof(BlogsFeature)) .RequirePermissions(CmsKitAdminPermissions.BlogPosts.Default)); @@ -64,6 +69,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/Tags", "fa fa-tags", order: 7) + .RequireFeatures(CmsKitFeatures.TagEnable) .RequireGlobalFeatures(typeof(TagsFeature)) .RequirePermissions(CmsKitAdminPermissions.Tags.Default)); @@ -73,6 +79,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/Comments", "fa fa-comments", order: 3) + .RequireFeatures(CmsKitFeatures.CommentEnable) .RequireGlobalFeatures(typeof(CommentsFeature)) .RequirePermissions(CmsKitAdminPermissions.Comments.Default)); @@ -82,6 +89,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/Menus/Items", "fa fa-stream", order: 5) + .RequireFeatures(CmsKitFeatures.MenuEnable) .RequireGlobalFeatures(typeof(MenuFeature)) .RequirePermissions(CmsKitAdminPermissions.Menus.Default)); @@ -91,6 +99,7 @@ public class CmsKitAdminMenuContributor : IMenuContributor "/Cms/GlobalResources", "bi bi-code-slash", order: 4) + .RequireFeatures(CmsKitFeatures.GlobalResourceEnable) .RequireGlobalFeatures(typeof(GlobalResourcesFeature)) .RequirePermissions(CmsKitAdminPermissions.GlobalResources.Default)); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js index 375b7ad41b..a101635d73 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js @@ -334,6 +334,25 @@ $(function () { editor.insertText(txt); }); + $('.tab-item').on('click', function () { + if ($(this).attr("aria-label") == 'Preview' && editor.isMarkdownMode()) { + + let content = editor.getMarkdown(); + localStorage.setItem('content', content); + + $.post("/CmsKitCommonWidgets/ContentPreview", { content: content }, function (result) { + editor.setHTML(result); + + var highllightedText = $('#ContentEditor').find('.toastui-editor-md-preview-highlight'); + highllightedText.removeClass('toastui-editor-md-preview-highlight'); + }); + } + else if ($(this).attr("aria-label") == 'Write') { + var retrievedObject = localStorage.getItem('content'); + editor.setMarkdown(retrievedObject); + } + }); + function createAddWidgetButton() { const button = document.createElement('button'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js index 51e3eda96c..d14194ecb5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js @@ -255,6 +255,25 @@ $(function () { editor.insertText(txt); }); + $('.tab-item').on('click', function () { + if ($(this).attr("aria-label") == 'Preview' && editor.isMarkdownMode()) { + + let content = editor.getMarkdown(); + localStorage.setItem('content', content); + + $.post("/CmsKitCommonWidgets/ContentPreview", { content: content }, function (result) { + editor.setHTML(result); + + var highllightedText = $('#ContentEditor').find('.toastui-editor-md-preview-highlight'); + highllightedText.removeClass('toastui-editor-md-preview-highlight'); + }); + } + else if ($(this).attr("aria-label") == 'Write') { + var retrievedObject = localStorage.getItem('content'); + editor.setMarkdown(retrievedObject); + } + }); + function createAddWidgetButton() { const button = document.createElement('button'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js index 49a482bf33..ee6c7b7f9f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js @@ -1,6 +1,6 @@ $(function () { var l = abp.localization.getResource("CmsKit"); - + var $createForm = $('#form-page-create'); var $title = $('#ViewModel_Title'); var $slug = $('#ViewModel_Slug'); @@ -90,7 +90,7 @@ $(function () { var fileUriPrefix = "/api/cms-kit/media/"; initEditor(); - + var editor; function initEditor() { var $editorContainer = $("#ContentEditor"); @@ -133,7 +133,7 @@ $(function () { } }); } - + function uploadFile(blob, callback, source) { var UPPY_OPTIONS = { endpoint: fileUploadUri, @@ -166,11 +166,37 @@ $(function () { }); } - $('#GeneratedWidgetText').on('change',function () { + $('#GeneratedWidgetText').on('change', function () { var txt = $('#GeneratedWidgetText').val(); editor.insertText(txt); }); - + + $('.tab-item').on('click', function () { + if ($(this).attr("aria-label") == 'Preview' && editor.isMarkdownMode()) { + + let content = editor.getMarkdown(); + localStorage.setItem('content', content); + + $.post("/CmsKitCommonWidgets/ContentPreview", { content: content }, function (result) { + + let style = styleEditor.getValue(); + + $('#editor-preview-style').remove(); + + $('head').append(''); + + editor.setHTML(result); + + var highllightedText = $('#ContentEditor').find('.toastui-editor-md-preview-highlight'); + highllightedText.removeClass('toastui-editor-md-preview-highlight'); + }); + } + else if ($(this).attr("aria-label") == 'Write'){ + var retrievedObject = localStorage.getItem('content'); + editor.setMarkdown(retrievedObject); + } + }); + function createAddWidgetButton() { const button = document.createElement('button'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js index 565f758552..c46f1c274c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js @@ -140,7 +140,33 @@ $(function () { var txt = $('#GeneratedWidgetText').val(); editor.insertText(txt); }); - + + $('.tab-item').on('click', function () { + if ($(this).attr("aria-label") == 'Preview' && editor.isMarkdownMode()) { + + let content = editor.getMarkdown(); + localStorage.setItem('content', content); + + $.post("/CmsKitCommonWidgets/ContentPreview", { content: content }, function (result) { + + let style = styleEditor.getValue(); + + $('#editor-preview-style').remove(); + + $('head').append(''); + + editor.setHTML(result); + + var highllightedText = $('#ContentEditor').find('.toastui-editor-md-preview-highlight'); + highllightedText.removeClass('toastui-editor-md-preview-highlight'); + }); + } + else if ($(this).attr("aria-label") == 'Write') { + var retrievedObject = localStorage.getItem('content'); + editor.setMarkdown(retrievedObject); + } + }); + function createAddWidgetButton() { const button = document.createElement('button'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs similarity index 80% rename from modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs index 8c6a6a01e9..a7bc27d713 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/BlogPostCommonDto.cs @@ -2,10 +2,10 @@ using Volo.Abp.Application.Dtos; using Volo.CmsKit.Users; -namespace Volo.CmsKit.Public.Blogs; +namespace Volo.CmsKit.Contents; [Serializable] -public class BlogPostPublicDto : AuditedEntityDto +public class BlogPostCommonDto : AuditedEntityDto { public Guid BlogId { get; set; } @@ -20,4 +20,4 @@ public class BlogPostPublicDto : AuditedEntityDto public Guid? CoverImageMediaId { get; set; } public CmsUserDto Author { get; set; } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/DefaultContentDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/DefaultContentDto.cs new file mode 100644 index 0000000000..731e346df4 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/DefaultContentDto.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; + +namespace Volo.CmsKit.Contents; + +public class DefaultContentDto : IContent +{ + public List ContentFragments { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContent.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContent.cs new file mode 100644 index 0000000000..2a393e0a14 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/IContent.cs @@ -0,0 +1,7 @@ +using System.Collections.Generic; + +namespace Volo.CmsKit.Contents; +public interface IContent +{ + public List ContentFragments { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs similarity index 71% rename from modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs index 6f18787a44..d495c5de20 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Application.Contracts/Volo/CmsKit/Contents/PageDto.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; +using System; using Volo.Abp.Application.Dtos; -using Volo.CmsKit.Contents; -namespace Volo.CmsKit.Public.Pages; +namespace Volo.CmsKit.Contents; [Serializable] public class PageDto : EntityDto @@ -17,4 +16,4 @@ public class PageDto : EntityDto public string Script { get; set; } public string Style { get; set; } -} +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Controllers/CmsKitCommonWidgetsController.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Controllers/CmsKitCommonWidgetsController.cs new file mode 100644 index 0000000000..8e226a31f2 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Controllers/CmsKitCommonWidgetsController.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; +using Volo.CmsKit.Web.Pages.CmsKit.Components.ContentPreview; + +namespace Volo.CmsKit.Web.Controllers; + +public class CmsKitCommonWidgetsController : AbpController +{ + [HttpPost] + public IActionResult ContentPreview(ContentPreviewDto dto) + { + return ViewComponent(typeof(ContentPreviewViewComponent), new { content = dto.Content }); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewDto.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewDto.cs new file mode 100644 index 0000000000..9c01a325bf --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewDto.cs @@ -0,0 +1,9 @@ +using System; + +namespace Volo.CmsKit.Web.Pages.CmsKit.Components.ContentPreview; + +[Serializable] +public class ContentPreviewDto +{ + public string Content { get; set; } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs new file mode 100644 index 0000000000..2251f6d0cd --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/ContentPreviewViewComponent.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Web.Contents; + +namespace Volo.CmsKit.Web.Pages.CmsKit.Components.ContentPreview; + +public class ContentPreviewViewComponent : AbpViewComponent +{ + protected ContentParser ContentParser { get; } + + public ContentPreviewViewComponent(ContentParser contentParser) + { + ContentParser = contentParser; + } + + public virtual async Task InvokeAsync(string content) + { + var fragments = await ContentParser.ParseAsync(content); + + return View("~/Pages/CmsKit/Components/ContentPreview/Default.cshtml", new DefaultContentDto + { + ContentFragments = fragments + }); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/Default.cshtml new file mode 100644 index 0000000000..6baf41716e --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/ContentPreview/Default.cshtml @@ -0,0 +1,10 @@ +@using Volo.CmsKit.Contents +@using Volo.CmsKit.Web.Pages.CmsKit.Components.Contents + +@model DefaultContentDto + +
+ + @await Component.InvokeAsync(typeof(ContentFragmentViewComponent), Model) + +
\ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/CmsKitContentWidgetOptions.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs similarity index 100% rename from modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/CmsKitContentWidgetOptions.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/CmsKitContentWidgetOptions.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragment.cshtml b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragment.cshtml new file mode 100644 index 0000000000..0fa7d59064 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragment.cshtml @@ -0,0 +1,20 @@ +@using System.Dynamic +@using Volo.Abp.Data +@using Volo.CmsKit.Web.Renderers; +@using Volo.CmsKit.Web.Pages.CmsKit.Components.Contents; + +@model ContentFragmentViewComponent + +@inject IMarkdownToHtmlRenderer MarkdownRenderer + +@foreach (var contentFragment in Model.ContentDto.ContentFragments) +{ + if (contentFragment.Type == "Markdown") + { + @Html.Raw(await MarkdownRenderer.RenderAsync(contentFragment.GetProperty("Content"))) + } + else if (contentFragment.Type == "Widget") + { + @await Component.InvokeAsync(contentFragment.GetProperty("Type"), contentFragment.ExtraProperties.ConvertToDynamicObject()) + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragmentViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragmentViewComponent.cs new file mode 100644 index 0000000000..d276165982 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentFragmentViewComponent.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Widgets; +using Volo.CmsKit.Contents; + +namespace Volo.CmsKit.Web.Pages.CmsKit.Components.Contents; + +[ViewComponent(Name = "ContentFragment")] +[Widget( + AutoInitialize = true +)] +public class ContentFragmentViewComponent : AbpViewComponent +{ + public IContent ContentDto { get; set; } + + public virtual async Task InvokeAsync(IContent contentDto) + { + return View("~/Pages/CmsKit/Components/Contents/ContentFragment.cshtml", new ContentFragmentViewComponent() { ContentDto = contentDto }); + } +} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/ContentParser.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs similarity index 100% rename from modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/ContentParser.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentParser.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/ContentWidgetConfig.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs similarity index 100% rename from modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/ContentWidgetConfig.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/ContentWidgetConfig.cs diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/IContentRenderer.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/IContentRenderer.cs similarity index 66% rename from modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/IContentRenderer.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/IContentRenderer.cs index 879b27cda7..b33c044392 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/IContentRenderer.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/IContentRenderer.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace Volo.CmsKit.Web.Contents; +namespace Volo.CmsKit.Web.Pages.CmsKit.Components.Contents; public interface IContentRenderer { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/PlainTextContentRenderer.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/PlainTextContentRenderer.cs similarity index 80% rename from modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/PlainTextContentRenderer.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/PlainTextContentRenderer.cs index cf68e25e15..3fcc78f658 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Contents/PlainTextContentRenderer.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Pages/CmsKit/Components/Contents/PlainTextContentRenderer.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace Volo.CmsKit.Web.Contents; +namespace Volo.CmsKit.Web.Pages.CmsKit.Components.Contents; public class PlainTextContentRenderer : IContentRenderer, ITransientDependency { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/IMarkdownToHtmlRenderer.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/IMarkdownToHtmlRenderer.cs similarity index 80% rename from modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/IMarkdownToHtmlRenderer.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/IMarkdownToHtmlRenderer.cs index 0dd60f34c5..565437af7e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/IMarkdownToHtmlRenderer.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/IMarkdownToHtmlRenderer.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace Volo.CmsKit.Public.Web.Renderers; +namespace Volo.CmsKit.Web.Renderers; public interface IMarkdownToHtmlRenderer { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/MarkdownToHtmlRenderer.cs b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs similarity index 98% rename from modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/MarkdownToHtmlRenderer.cs rename to modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs index 4ef7c82c0d..83317c2111 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Renderers/MarkdownToHtmlRenderer.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Renderers/MarkdownToHtmlRenderer.cs @@ -7,7 +7,7 @@ using Ganss.XSS; using Markdig; using Volo.Abp.DependencyInjection; -namespace Volo.CmsKit.Public.Web.Renderers; +namespace Volo.CmsKit.Web.Renderers; public class MarkdownToHtmlRenderer : IMarkdownToHtmlRenderer, ITransientDependency { diff --git a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Volo.CmsKit.Common.Web.csproj b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Volo.CmsKit.Common.Web.csproj index 1ca9a78b27..e717f49be5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Common.Web/Volo.CmsKit.Common.Web.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Common.Web/Volo.CmsKit.Common.Web.csproj @@ -1,38 +1,40 @@ - - + + - - net6.0 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - true - Library - Volo.CmsKit.Web - true - + + net6.0 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + Volo.CmsKit.Web + true + - - - - - + + + + + - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj index 22160272fd..550a704a75 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo.CmsKit.Domain.Shared.csproj @@ -12,6 +12,7 @@ + diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs new file mode 100644 index 0000000000..597e5240e8 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatureDefinitionProvider.cs @@ -0,0 +1,73 @@ +using Volo.Abp.Features; +using Volo.Abp.Localization; +using Volo.Abp.Validation.StringValues; +using Volo.CmsKit.Localization; + +namespace Volo.CmsKit.Features; +public class CmsKitFeatureDefinitionProvider : FeatureDefinitionProvider +{ + public override void Define(IFeatureDefinitionContext context) + { + var group = context.AddGroup(CmsKitFeatures.GroupName, + L("Feature:CmsKitGroup")); + + group.AddFeature(CmsKitFeatures.BlogEnable, + "true", + L("Feature:BlogEnable"), + L("Feature:BlogEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.CommentEnable, + "true", + L("Feature:CommentEnable"), + L("Feature:CommentEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.GlobalResourceEnable, + "true", + L("Feature:GlobalResourceEnable"), + L("Feature:GlobalResourceEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.MediaEnable, + "true", + L("Feature:MediaEnable"), + L("Feature:MediaEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.MenuEnable, + "true", + L("Feature:MenuEnable"), + L("Feature:MenuEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.PageEnable, + "true", + L("Feature:PageEnable"), + L("Feature:PageEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.RatingEnable, + "true", + L("Feature:RatingEnable"), + L("Feature:RatingEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.ReactionEnable, + "true", + L("Feature:ReactionEnable"), + L("Feature:ReactionEnableDescription"), + new ToggleStringValueType()); + + group.AddFeature(CmsKitFeatures.TagEnable, + "true", + L("Feature:TagEnable"), + L("Feature:TagEnableDescription"), + new ToggleStringValueType()); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs new file mode 100644 index 0000000000..1dbf642755 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Features/CmsKitFeatures.cs @@ -0,0 +1,15 @@ +namespace Volo.CmsKit.Features; +public static class CmsKitFeatures +{ + public const string GroupName = "CmsKit"; + + public const string BlogEnable = GroupName + ".BlogEnable"; + public const string CommentEnable = GroupName + ".CommentEnable"; + public const string GlobalResourceEnable = GroupName + ".GlobalResourceEnable"; + public const string MediaEnable = GroupName + ".MediaEnable"; + public const string MenuEnable = GroupName + ".MenuEnable"; + public const string PageEnable = GroupName + ".PageEnable"; + public const string RatingEnable = GroupName + ".RatingEnable"; + public const string ReactionEnable = GroupName + ".ReactionEnable"; + public const string TagEnable = GroupName + ".TagEnable"; +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/ContentsFeature.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/ContentsFeature.cs new file mode 100644 index 0000000000..ac752a68c4 --- /dev/null +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/GlobalFeatures/ContentsFeature.cs @@ -0,0 +1,28 @@ +using JetBrains.Annotations; +using Volo.Abp.GlobalFeatures; + +namespace Volo.CmsKit.GlobalFeatures; + +[GlobalFeatureName(Name)] +public class ContentsFeature : GlobalFeature +{ + public const string Name = "CmsKit.Contents"; + + internal ContentsFeature( + [NotNull] GlobalCmsKitFeatures cmsKit + ) : base(cmsKit) + { + + } + + public override void Enable() + { + var userFeature = FeatureManager.Modules.CmsKit().User; + if (!userFeature.IsEnabled) + { + userFeature.Enable(); + } + + base.Enable(); + } +} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json index 922059463f..3119bf618c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ar.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "هل أنت متأكد من حذف هذه الصفحة؟", "PageId": "صفحة", "Pages": "الصفحات", - "PageSlugInformation": "سبيكة تستخدم على url. سيكون عنوان url الخاص بك هو \"/pages/{{slug}}\".", + "PageSlugInformation": "سبيكة تستخدم على url. سيكون عنوان url الخاص بك هو \"/{slug}}\".", "Permission:BlogManagement": "إدارة المدونة", "Permission:BlogManagement.Create": "إنشاء", "Permission:BlogManagement.Delete": "حذف", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json index 9192b48abe..8ae9479b06 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/cs.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Opravdu chcete smazat tuto stránku?", "PageId": "Strana", "Pages": "stránky", - "PageSlugInformation": "Na adrese URL je použit Slug. Vaše adresa URL bude '/pages/{{slug}}'.", + "PageSlugInformation": "Na adrese URL je použit Slug. Vaše adresa URL bude '/{{slug}}'.", "Permission:BlogManagement": "Správa blogu", "Permission:BlogManagement.Create": "Vytvořit", "Permission:BlogManagement.Delete": "Vymazat", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json index 903a7e3d0a..857f7f1e1a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/de-DE.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Möchten Sie diese Seite wirklich löschen?", "PageId": "Buchseite", "Pages": "Seiten", - "PageSlugInformation": "Slug wird auf URL verwendet. Ihre URL lautet '/pages/{{slug}}'.", + "PageSlugInformation": "Slug wird auf URL verwendet. Ihre URL lautet '/{{slug}}'.", "Permission:BlogManagement": "Blog-Verwaltung", "Permission:BlogManagement.Create": "Schaffen", "Permission:BlogManagement.Delete": "Löschen", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json index 222cbe0fbd..7a838b120a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/el.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Είστε βέβαιοι ότι θα διαγράψετε αυτήν τη σελίδα;", "PageId": "Σελίδα", "Pages": "Σελίδες", - "PageSlugInformation": "Το Slug χρησιμοποιείται στο url. Το url σας θα είναι '/pages/{{slug}}'.", + "PageSlugInformation": "Το Slug χρησιμοποιείται στο url. Το url σας θα είναι '/{{slug}}'.", "Permission:BlogManagement": "Διαχείριση ιστολογίου", "Permission:BlogManagement.Create": "Δημιουργώ", "Permission:BlogManagement.Delete": "Διαγράφω", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json index 8da6be8bd5..0faaf04e81 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Are you sure to delete this page?", "PageId": "Page", "Pages": "Pages", - "PageSlugInformation": "Slug is used on url. Your url will be '/pages/{{slug}}'.", + "PageSlugInformation": "Slug is used on url. Your url will be '/{{slug}}'.", "Permission:BlogManagement": "Blog Management", "Permission:BlogManagement.Create": "Create", "Permission:BlogManagement.Delete": "Delete", @@ -185,8 +185,27 @@ "Add": "Add", "AddWidget": "Add Widget", "PleaseConfigureWidgets": "Please configure widgets", - "SelectAnAuthor":"Select an Author", - "InThisDocument":"In This Document", - "GoToTop":"Go To Top" + "SelectAnAuthor": "Select an Author", + "InThisDocument": "In This Document", + "GoToTop": "Go To Top", + "Feature:CmsKitGroup": "Cms Kit", + "Feature:BlogEnable": "Enabled blog page", + "Feature:BlogEnableDescription": "Enable blog page in the application.", + "Feature:CommentEnable": "Enabled commenting", + "Feature:CommentEnableDescription": "Enable comment in the application.", + "Feature:GlobalResourceEnable": "Enabled global resourcing", + "Feature:GlobalResourceEnableDescription": "Enable global resource in the application.", + "Feature:MediaEnable": "Enabled media", + "Feature:MediaEnableDescription": "Enable media in the application.", + "Feature:MenuEnable": "Enabled menu", + "Feature:MenuEnableDescription": "Enable menu in the application.", + "Feature:PageEnable": "Enabled paging page", + "Feature:PageEnableDescription": "Enable paging page in the application.", + "Feature:RatingEnable": "Enabled rating", + "Feature:RatingEnableDescription": "Enable rating in the application.", + "Feature:ReactionEnable": "Enabled reaction", + "Feature:ReactionEnableDescription": "Enable reaction in the application.", + "Feature:TagEnable": "Enabled taging", + "Feature:TagEnableDescription": "Enable taging in the application." } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json index 19df2c45a2..8e8750e530 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/es.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "¿Está seguro de eliminar esta página?", "PageId": "Página", "Pages": "Paginas", - "PageSlugInformation": "Slug se usa en la URL. Su URL será '/pages/{{slug}}'.", + "PageSlugInformation": "Slug se usa en la URL. Su URL será '/{{slug}}'.", "Permission:BlogManagement": "Gestión de blogs", "Permission:BlogManagement.Create": "Crear", "Permission:BlogManagement.Delete": "Borrar", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json index 3ac961feef..855b6d091d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fa.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "آیا مطمئن هستید که این صفحه را حذف می کنید؟", "PageId": "صفحه", "Pages": "صفحات", - "PageSlugInformation": "Slug در url استفاده می شود. آدرس اینترنتی شما '/pages/{{slug}}' خواهد بود.", + "PageSlugInformation": "Slug در url استفاده می شود. آدرس اینترنتی شما '/{{slug}}' خواهد بود.", "Permission:BlogManagement": "مدیریت وبلاگ", "Permission:BlogManagement.Create": "ایجاد", "Permission:BlogManagement.Delete": "حذف", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json index 30a56fa9c0..438818cdfb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Haluatko varmasti poistaa tämän sivun?", "PageId": "Sivu", "Pages": "Sivut", - "PageSlugInformation": "Etanaa käytetään URL-osoitteessa. URL-osoitteesi on '/pages/{{slug}}'.", + "PageSlugInformation": "Etanaa käytetään URL-osoitteessa. URL-osoitteesi on '/{{slug}}'.", "Permission:BlogManagement": "Blogin hallinta", "Permission:BlogManagement.Create": "Luoda", "Permission:BlogManagement.Delete": "Poistaa", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json index 6d4e8f4cf5..5c789e996e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/fr.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Êtes-vous sûr de vouloir supprimer cette page?", "PageId": "Page", "Pages": "Pages", - "PageSlugInformation": "Slug est utilisé sur l'url. Votre URL sera '/pages/{{slug}}'.", + "PageSlugInformation": "Slug est utilisé sur l'url. Votre URL sera '/{{slug}}'.", "Permission:BlogManagement": "Gestion de blog", "Permission:BlogManagement.Create": "Créer", "Permission:BlogManagement.Delete": "Effacer", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json index 732ca3d2de..8f69f2e25f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "क्या आप इस पृष्ठ को हटाना सुनिश्चित कर रहे हैं?", "PageId": "पृष्ठ", "Pages": "पृष्ठों", - "PageSlugInformation": "स्लग का उपयोग url पर किया जाता है। आपका url '/pages/{{slug}}' होगा।", + "PageSlugInformation": "स्लग का उपयोग url पर किया जाता है। आपका url '/{{slug}}' होगा।", "Permission:BlogManagement": "ब्लॉग प्रबंधन", "Permission:BlogManagement.Create": "सृजन करना", "Permission:BlogManagement.Delete": "हटाएं", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json index 49b7d5f828..18f34ebd71 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/hu.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Biztosan törlöd ezt az oldalt?", "PageId": "oldal", "Pages": "Oldalak", - "PageSlugInformation": "A Slug az url-en használatos. Az Ön URL-je a következő lesz: „/pages/{{slug}}”.", + "PageSlugInformation": "A Slug az url-en használatos. Az Ön URL-je a következő lesz: '/{{slug}}'.", "Permission:BlogManagement": "Blogkezelés", "Permission:BlogManagement.Create": "Teremt", "Permission:BlogManagement.Delete": "Töröl", @@ -85,6 +85,7 @@ "Permission:BlogPostManagement.Create": "Teremt", "Permission:BlogPostManagement.Delete": "Töröl", "Permission:BlogPostManagement.Update": "Frissítés", + "Permission:BlogPostManagement.Publish": "Közzététel", "Permission:CmsKit": "CmsKit", "Permission:Comments": "Megjegyzéskezelés", "Permission:Comments.Delete": "Töröl", @@ -115,6 +116,7 @@ "Permission:TagManagement.Create": "Teremt", "Permission:TagManagement.Delete": "Töröl", "Permission:TagManagement.Update": "Frissítés", + "Permission:GlobalResources": "Globális források", "PickYourReaction": "Válassza ki a reakciót", "Rating": "Értékelés", "RatingUndoMessage": "Az értékelésed visszavonásra kerül.", @@ -129,6 +131,7 @@ "SelectAll": "Mindet kiválaszt", "Send": "Küldés", "SendMessage": "Üzenet küldése", + "SelectedAuthor": "Szerző", "ShortDescription": "Rövid leírás", "Slug": "Meztelen csiga", "Source": "Forrás", @@ -158,6 +161,51 @@ "YourEmailAddress": "Az email címed", "YourFullName": "A teljes neved", "YourMessage": "Az üzeneted", - "YourReply": "A válaszod" + "YourReply": "A válaszod", + "MarkdownSupported": "Markdown támogatott.", + "GlobalResources": "Globális források", + "SavedSuccessfully": "sikeresen elmentve", + "CmsKit.BlogPost.Status.0": "Piszkozat", + "CmsKit.BlogPost.Status.1": "Közzétett", + "CmsKit.BlogPost.Status.2": "Felülvizsgálatra vár", + "BlogPostPublishConfirmationMessage": "Biztosan közzéteszi a(z) \"{0}\" blogbejegyzést?", + "SuccessfullyPublished": "Sikeres közzététel!", + "Draft": "Piszkozat", + "Publish": "Közzététel", + "BlogPostDraftConfirmationMessage": "Biztosan piszkozatként állítja be a(z) \"{0}\" blogbejegyzést?", + "BlogPostSendToReviewConfirmationMessage": "Biztosan elküldi a(z) \"{0}\" blogbejegyzést adminisztrátori felülvizsgálatnak közzététel céljából?", + "SaveAsDraft": "Mentés piszkozatként", + "SendToReview": "Küldje el felülvizsgálatra", + "SendToReviewToPublish": "Küldje el véleményezésre a közzétételhez", + "BlogPostSendToReviewSuccessMessage": "A(z) \"{0}\" blogbejegyzést adminisztrátori felülvizsgálatra küldtük közzététel céljából.", + "HasBlogPostWaitingForReviewMessage": "Van egy blogbejegyzésed, amely felülvizsgálatra vár. Kattintson a listához.", + "SelectAStatus": "Válasszon állapotot", + "Status": "Állapot", + "CmsKit.BlogPost.ScrollIndex": "Gyors navigációs sáv a blogbejegyzésekben", + "Add": "Hozzáadás", + "AddWidget": "Widget hozzáadása", + "PleaseConfigureWidgets": "Kérjük, állítsa be a widgeteket", + "SelectAnAuthor": "Válasszon ki egy szerzőt", + "InThisDocument": "Ebben a dokumentumban", + "GoToTop": "Ugrás a tetejére", + "Feature:CmsKitGroup": "Cms készlet", + "Feature:BlogEnable": "Engedélyezett blogoldal", + "Feature:BlogEnableDescription": "Engedélyezze a blogoldalt az alkalmazásban.", + "Feature:CommentEnable": "Hozzászólás engedélyezve", + "Feature:CommentEnableDescription": "Megjegyzés engedélyezése az alkalmazásban.", + "Feature:GlobalResourceEnable": "Globális erőforrás-kihelyezés engedélyezve", + "Feature:GlobalResourceEnableDescription": "Globális erőforrás engedélyezése az alkalmazásban.", + "Feature:MediaEnable": "Engedélyezett média", + "Feature:MediaEnableDescription": "Média engedélyezése az alkalmazásban.", + "Feature:MenuEnable": "Engedélyezett menü", + "Feature:MenuEnableDescription": "Menü engedélyezése az alkalmazásban.", + "Feature:PageEnable": "Lapozási oldal engedélyezve", + "Feature:PageEnableDescription": "Lapozási oldal engedélyezése az alkalmazásban.", + "Feature:RatingEnable": "Besorolás engedélyezve", + "Feature:RatingEnableDescription": "Besorolás engedélyezése az alkalmazásban.", + "Feature:ReactionEnable": "Engedélyezett reakció", + "Feature:ReactionEnableDescription": "Reakció engedélyezése az alkalmazásban.", + "Feature:TagEnable": "Címkézés engedélyezve", + "Feature:TagEnableDescription": "Engedélyezze a címkézést az alkalmazásban." } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json index f5bb342dc6..60c8d13744 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/it.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Sei sicuro di cancellare questa pagina?", "PageId": "Pagina", "Pages": "Pagine", - "PageSlugInformation": "Lo slug viene utilizzato sull'URL. Il tuo URL sarà '/pages/{{slug}}'.", + "PageSlugInformation": "Lo slug viene utilizzato sull'URL. Il tuo URL sarà '/{{slug}}'.", "Permission:BlogManagement": "Gestione del blog", "Permission:BlogManagement.Create": "Crea", "Permission:BlogManagement.Delete": "Elimina", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json index b8adbbd5bb..39779d1d57 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/nl.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Weet u zeker dat u deze pagina wilt verwijderen?", "PageId": "Bladzijde", "Pages": "Pagina's", - "PageSlugInformation": "Slug wordt gebruikt voor de url. Uw url wordt '/pages/{{slug}}'.", + "PageSlugInformation": "Slug wordt gebruikt voor de url. Uw url wordt '/{{slug}}'.", "Permission:BlogManagement": "Blogbeheer", "Permission:BlogManagement.Create": "Toevoegen", "Permission:BlogManagement.Delete": "Verwijderen", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json index 6c5e77a7d3..5a2ed06a5d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pl-PL.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Czy na pewno chcesz usunąć tę stronę?", "PageId": "Strona", "Pages": "Strony", - "PageSlugInformation": "Slug jest używany na adresie URL. Twój adres URL to „/pages/{{slug}}”.", + "PageSlugInformation": "Slug jest używany na adresie URL. Twój adres URL to „/{{slug}}”.", "Permission:BlogManagement": "Zarządzanie blogiem", "Permission:BlogManagement.Create": "Tworzyć", "Permission:BlogManagement.Delete": "Kasować", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json index 5ec2a64799..fff05fefdd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/pt-BR.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Tem certeza que deseja deletar esta página?", "PageId": "Página", "Pages": "Páginas", - "PageSlugInformation": "Slug é usado na url. Sua url será '/pages/{{slug}}'.", + "PageSlugInformation": "Slug é usado na url. Sua url será '/{{slug}}'.", "Permission:BlogManagement": "Gerenciamento de blogs", "Permission:BlogManagement.Create": "Criar", "Permission:BlogManagement.Delete": "Excluir", @@ -181,6 +181,31 @@ "HasBlogPostWaitingForReviewMessage": "Você tem uma postagem para revisão. Clique para listar.", "SelectAStatus": "Selecione um status", "Status": "Status", - "CmsKit.BlogPost.ScrollIndex": "Barra de navegação rápida em postagens" + "CmsKit.BlogPost.ScrollIndex": "Barra de navegação rápida em postagens", + "Add": "Adicionar", + "AddWidget": "Adicionar Widget", + "PleaseConfigureWidgets": "Por favor, configure os widgets", + "SelectAnAuthor": "Selecione um Autor", + "InThisDocument": "Neste Documento", + "GoToTop": "Ir para o Topo", + "Feature:CmsKitGroup": "Cms Kit", + "Feature:BlogEnable": "Habilitar página de blog", + "Feature:BlogEnableDescription": "Habilitar página de blog no aplicativo.", + "Feature:CommentEnable": "Habilitar comentários", + "Feature:CommentEnableDescription": "Habilitar comentários no aplicativo.", + "Feature:GlobalResourceEnable": "Recursos globais ativados", + "Feature:GlobalResourceEnableDescription": "Habilitar recurso global no aplicativo.", + "Feature:MediaEnable": "Mídia ativada", + "Feature:MediaEnableDescription": "Mídia ativada no aplicativo.", + "Feature:MenuEnable": "Menu habilitado", + "Feature:MenuEnableDescription": "Menu habilitado no aplicativo.", + "Feature:PageEnable": "Página de paginação ativada", + "Feature:PageEnableDescription": "Página de paginação ativada no aplicativo.", + "Feature:RatingEnable": "Classificação ativada", + "Feature:RatingEnableDescription": "Classificação ativada no aplicativo.", + "Feature:ReactionEnable": "Reações habilitadas", + "Feature:ReactionEnableDescription": "Reações habilitadas no aplicativo.", + "Feature:TagEnable": "Habilitar tag", + "Feature:TagEnableDescription": "Habilitar tag no aplicativo." } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json index 3e7e1caaa9..9cd519bb53 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ro-RO.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Sunteţi sigur(ă) că vreţi să ştergeţi această pagină?", "PageId": "Pagina", "Pages": "Pagini", - "PageSlugInformation": "Slug este folosit pe url. Url-ul dumneavoastră va fi '/pages/{{slug}}'.", + "PageSlugInformation": "Slug este folosit pe url. Url-ul dumneavoastră va fi '/{{slug}}'.", "Permission:BlogManagement": "Administrare Blog", "Permission:BlogManagement.Create": "Creează", "Permission:BlogManagement.Delete": "Şterge", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json index 289b952e1b..f95ee910e4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/ru.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Вы уверены, что хотите удалить эту страницу?", "PageId": "Страница", "Pages": "Страницы", - "PageSlugInformation": "Слаг используется для URL. Ваш URL-адрес будет '/pages/{{slug}}'.", + "PageSlugInformation": "Слаг используется для URL. Ваш URL-адрес будет '/{{slug}}'.", "Permission:BlogManagement": "Управление блогом", "Permission:BlogManagement.Create": "Создавать", "Permission:BlogManagement.Delete": "Удалить", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json index d5873f42e1..2cf9410ca9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sk.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Určite chcete túto stránku vymazať?", "PageId": "Stránka", "Pages": "Stránky", - "PageSlugInformation": "Slug sa používa v URL. Vaša URL bude '/pages/{{slug}}'.", + "PageSlugInformation": "Slug sa používa v URL. Vaša URL bude '/{{slug}}'.", "Permission:BlogManagement": "Správa blogov", "Permission:BlogManagement.Create": "Vytvoriť", "Permission:BlogManagement.Delete": "Zmazať", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json index 0a79428aac..22f252ea51 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/sl.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Ali ste prepričani, da želite izbrisati to stran?", "PageId": "stran", "Pages": "strani", - "PageSlugInformation": "Slug se uporablja na url-ju. Vaš url bo '/pages/{{slug}}'.", + "PageSlugInformation": "Slug se uporablja na url-ju. Vaš url bo '/{{slug}}'.", "Permission:BlogManagement": "Upravljanje blogov", "Permission:BlogManagement.Create": "Ustvari", "Permission:BlogManagement.Delete": "Izbriši", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json index 431c50596c..78fb34087b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/tr.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Bu sayfayı silmek istediğinize emin misiniz?", "PageId": "Sayfa", "Pages": "Sayfalar", - "PageSlugInformation": "Etiket URL'de kullanılır. Url şöyle görünür: '/pages/{{slug}}'.", + "PageSlugInformation": "Etiket URL'de kullanılır. Url şöyle görünür: '/{{slug}}'.", "Permission:BlogManagement": "Blog Yönetimi", "Permission:BlogManagement.Create": "Oluşturma", "Permission:BlogManagement.Delete": "Silme", @@ -190,6 +190,25 @@ "CmsKit.BlogPost.ScrollIndex": "Blog yazılarında hızlı gezinme çubuğu", "Add": "Ekle", "AddWidget": "Widget Ekle", - "PleaseConfigureWidgets": "Lütfen widget'leri yapılandırın" + "PleaseConfigureWidgets": "Lütfen widget'leri yapılandırın", + "Feature:CmsKitGroup": "Cms Kit", + "Feature:BlogEnable": "Blog sayfasını etkinleştirin", + "Feature:BlogEnableDescription": "Uygulamınızdaki blog sayfasını etkinleştirir.", + "Feature:CommentEnable": "Yorum özelliğini etkinleştirin", + "Feature:CommentEnableDescription": "Uygulamınızdaki yorum özelliğini etkinleştirir.", + "Feature:GlobalResourceEnable": "Blog global kaynakları etkinleştirin", + "Feature:GlobalResourceEnableDescription": "Uygulamınızdaki global kaynakları etkinleştirir.", + "Feature:MediaEnable": "Medyayı etkinleştirin", + "Feature:MediaEnableDescription": "Uygulamınızdaki medyayı etkinleştirir.", + "Feature:MenuEnable": "Menüyü etkinleştirin", + "Feature:MenuEnableDescription": "Uygulamınızdaki menüyü etkinleştirir.", + "Feature:PageEnable": "Sayfa özelliğini etkinleştirin", + "Feature:PageEnableDescription": "Uygulamınızdaki sayfa özelliğini etkinleştirir.", + "Feature:RatingEnable": "Oylamayı etkinleştirin", + "Feature:RatingEnableDescription": "Uygulamınızdaki oylamayı etkinleştirir.", + "Feature:ReactionEnable": "Reaksiyonları etkinleştirin", + "Feature:ReactionEnableDescription": "Uygulamınızdaki reaksiyonları etkinleştirir.", + "Feature:TagEnable": "Etkiketleri etkinleştirin", + "Feature:TagEnableDescription": "Uygulamınızdaki etiketleri etkinleştirir." } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json index b0ed51a5d6..a581da6362 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/vi.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "Bạn có chắc chắn xóa trang này không?", "PageId": "Trang", "Pages": "Các trang", - "PageSlugInformation": "Slug được sử dụng trên url. Url của bạn sẽ là '/pages/{{slug}}'.", + "PageSlugInformation": "Slug được sử dụng trên url. Url của bạn sẽ là '/{{slug}}'.", "Permission:BlogManagement": "Quản lý blog", "Permission:BlogManagement.Create": "Tạo ra", "Permission:BlogManagement.Delete": "Xóa bỏ", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json index 2d4683a150..b8d5353b82 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hans.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "你确定删除这个页面吗?", "PageId": "页", "Pages": "页面", - "PageSlugInformation": "Slug用于url. 你的url将是 '/pages/{{slug}}'.", + "PageSlugInformation": "Slug用于url. 你的url将是 '/{{slug}}'.", "Permission:BlogManagement": "博客管理", "Permission:BlogManagement.Create": "创建", "Permission:BlogManagement.Delete": "删除", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json index 49584e5af0..91a742deba 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/zh-Hant.json @@ -75,7 +75,7 @@ "PageDeletionConfirmationMessage": "你確定刪除這個頁面嗎?", "PageId": "頁", "Pages": "頁面", - "PageSlugInformation": "Slug用於網址. 你的網址將是 '/pages/{{slug}}'.", + "PageSlugInformation": "Slug用於網址. 你的網址將是 '/{{slug}}'.", "Permission:BlogManagement": "部落格管理", "Permission:BlogManagement.Create": "創建", "Permission:BlogManagement.Delete": "刪除", diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs index 9f03dc809f..ff07df87a1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs @@ -2,7 +2,7 @@ namespace Volo.CmsKit.Pages; -public class PageConsts +public static class PageConsts { public const string EntityType = "Page"; @@ -16,7 +16,7 @@ public class PageConsts public static int MaxStyleLength { get; set; } = int.MaxValue; - private static string _urlPrefix = "/pages/"; + private static string _urlPrefix = "/"; public static string UrlPrefix { get => _urlPrefix; set => _urlPrefix = value.EnsureEndsWith('/').EnsureStartsWith('/'); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDbProperties.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/AbpCmsKitDbProperties.cs similarity index 83% rename from modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDbProperties.cs rename to modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/AbpCmsKitDbProperties.cs index 6a29834233..1ce1fd8413 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/CmsKitDbProperties.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/AbpCmsKitDbProperties.cs @@ -1,6 +1,6 @@ namespace Volo.CmsKit; -public static class CmsKitDbProperties +public static class AbpCmsKitDbProperties { public static string DbTablePrefix { get; set; } = "Cms"; diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs index 2707b8854c..98a401af17 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/EntityTagManager.cs @@ -1,9 +1,9 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Volo.Abp.Domain.Services; namespace Volo.CmsKit.Tags; @@ -62,7 +62,7 @@ public class EntityTagManager : DomainService var deletedTags = existingTags.Where(x => !tags.Contains(x.Name)).ToList(); var addedTags = tags.Where(x => !existingTags.Any(a => a.Name == x)); - await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray()); + await EntityTagRepository.DeleteManyAsync(deletedTags.Select(s => s.Id).ToArray(), entityId); foreach (var addedTag in addedTags) { @@ -85,6 +85,6 @@ public class EntityTagManager : DomainService [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default) { - return await EntityTagRepository.GetEntityIdsFilteredByTagNameAsync(tagName, entityType,tenantId, cancellationToken); + return await EntityTagRepository.GetEntityIdsFilteredByTagNameAsync(tagName, entityType, tenantId, cancellationToken); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs index 5105635c82..098ac8e46c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Tags/IEntityTagRepository.cs @@ -1,8 +1,8 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Volo.Abp.Domain.Repositories; namespace Volo.CmsKit.Tags; @@ -15,7 +15,7 @@ public interface IEntityTagRepository : IBasicRepository [CanBeNull] Guid? tenantId, CancellationToken cancellationToken = default); - Task DeleteManyAsync(Guid[] tagIds, CancellationToken cancellationToken = default); + Task DeleteManyAsync(Guid[] tagIds, string entityId, CancellationToken cancellationToken = default); Task> GetEntityIdsFilteredByTagAsync( [NotNull] Guid tagId, @@ -25,6 +25,6 @@ public interface IEntityTagRepository : IBasicRepository Task> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, - CancellationToken cancellationToken=default); + [CanBeNull] Guid? tenantId = null, + CancellationToken cancellationToken = default); } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs index 8f501f4c98..265495f5bf 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs @@ -14,7 +14,7 @@ using Volo.CmsKit.Users; namespace Volo.CmsKit.EntityFrameworkCore; -[ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpCmsKitDbProperties.ConnectionStringName)] public class CmsKitDbContext : AbpDbContext, ICmsKitDbContext { public DbSet Comments { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 9ab103fefc..9a42f6c4b0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -28,7 +28,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "Users", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Users", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); b.ConfigureAbpUser(); @@ -48,7 +48,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "UserReactions", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "UserReactions", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -71,7 +71,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "Comments", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Comments", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -95,7 +95,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(r => { - r.ToTable(CmsKitDbProperties.DbTablePrefix + "Ratings", CmsKitDbProperties.DbSchema); + r.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Ratings", AbpCmsKitDbProperties.DbSchema); r.ConfigureByConvention(); @@ -117,7 +117,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "Tags", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Tags", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -134,7 +134,7 @@ public static class CmsKitDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "EntityTags", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "EntityTags", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -158,7 +158,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "Pages", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Pages", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -180,7 +180,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "Blogs", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "Blogs", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -193,7 +193,7 @@ public static class CmsKitDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogPosts", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "BlogPosts", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -210,7 +210,7 @@ public static class CmsKitDbContextModelCreatingExtensions builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "BlogFeatures", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "BlogFeatures", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -230,7 +230,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "MediaDescriptors", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "MediaDescriptors", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -251,7 +251,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "MenuItems", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "MenuItems", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); @@ -269,7 +269,7 @@ public static class CmsKitDbContextModelCreatingExtensions { builder.Entity(b => { - b.ToTable(CmsKitDbProperties.DbTablePrefix + "GlobalResources", CmsKitDbProperties.DbSchema); + b.ToTable(AbpCmsKitDbProperties.DbTablePrefix + "GlobalResources", AbpCmsKitDbProperties.DbSchema); b.ConfigureByConvention(); diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs index fca31f2d73..8b6edc1cbe 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs @@ -14,7 +14,7 @@ using Volo.CmsKit.Users; namespace Volo.CmsKit.EntityFrameworkCore; -[ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpCmsKitDbProperties.ConnectionStringName)] public interface ICmsKitDbContext : IEfCoreDbContext { DbSet Comments { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs index c9e501edc0..8dfeacfc36 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreEntityTagRepository.cs @@ -1,9 +1,9 @@ -using JetBrains.Annotations; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -19,11 +19,11 @@ public class EfCoreEntityTagRepository : EfCoreRepository(); - dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId))); + dbSet.RemoveRange(dbSet.Where(x => tagIds.Contains(x.TagId) && x.EntityId == entityId)); await dbContext.SaveChangesAsync(GetCancellationToken(cancellationToken)); } @@ -56,18 +56,18 @@ public class EfCoreEntityTagRepository : EfCoreRepository> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, - CancellationToken cancellationToken=default) + [CanBeNull] Guid? tenantId = null, + CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); var result = from et in dbContext.Set() join t in dbContext.Set() on et.TagId equals t.Id - where t.Name == tagName - && t.EntityType == entityType - && et.TenantId == tenantId + where t.Name == tagName + && t.EntityType == entityType + && et.TenantId == tenantId && t.TenantId == tenantId && !t.IsDeleted - select et.EntityId; - return await result.ToListAsync(cancellationToken:GetCancellationToken(cancellationToken)); + select et.EntityId; + return await result.ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs index 36c9cf882c..c6a97dfbef 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs @@ -15,7 +15,7 @@ using Tag = Volo.CmsKit.Tags.Tag; namespace Volo.CmsKit.MongoDB; -[ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpCmsKitDbProperties.ConnectionStringName)] public class CmsKitMongoDbContext : AbpMongoDbContext, ICmsKitMongoDbContext { public IMongoCollection Comments => Collection(); diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs index 7b7edcce0d..b6127ab125 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs @@ -22,67 +22,67 @@ public static class CmsKitMongoDbContextExtensions builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Users"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Users"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "UserReactions"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "UserReactions"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Comments"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Comments"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Ratings"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Ratings"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Tags"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Tags"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "EntityTags"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "EntityTags"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Pages"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Pages"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Blogs"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "Blogs"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "BlogPosts"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "BlogPosts"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "BlogFeatures"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "BlogFeatures"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "MediaDescriptors"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "MediaDescriptors"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "MenuItems"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "MenuItems"; }); builder.Entity(x => { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "GlobalResources"; + x.CollectionName = AbpCmsKitDbProperties.DbTablePrefix + "GlobalResources"; }); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs index a2dff419e2..e220aff46e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs @@ -15,7 +15,7 @@ using Tag = Volo.CmsKit.Tags.Tag; namespace Volo.CmsKit.MongoDB; -[ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] +[ConnectionStringName(AbpCmsKitDbProperties.ConnectionStringName)] public interface ICmsKitMongoDbContext : IAbpMongoDbContext { IMongoCollection UserReactions { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs index e3835bfe42..b270255900 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Tags/MongoEntityTagRepository.cs @@ -1,15 +1,14 @@ -using JetBrains.Annotations; -using MongoDB.Driver; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using JetBrains.Annotations; +using MongoDB.Driver; using Volo.Abp; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; using Volo.CmsKit.Tags; -using Tag = Volo.CmsKit.Tags.Tag; namespace Volo.CmsKit.MongoDB.Tags; @@ -20,12 +19,19 @@ public class MongoEntityTagRepository : MongoDbRepository.Filter.In(x => x.TagId, tagIds), token); + + var builder = Builders.Filter; + var filter = builder.And( + builder.In(x => x.TagId, tagIds), + builder.Eq(x => x.EntityId, entityId) + ); + + await collection.DeleteManyAsync(filter, token); } public virtual Task FindAsync( @@ -57,7 +63,7 @@ public class MongoEntityTagRepository : MongoDbRepository> GetEntityIdsFilteredByTagNameAsync( [NotNull] string tagName, [NotNull] string entityType, - [CanBeNull] Guid? tenantId=null, + [CanBeNull] Guid? tenantId = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); @@ -76,7 +82,7 @@ public class MongoEntityTagRepository : MongoDbRepository s.entityTag.EntityId); - + return await AsyncExecuter.ToListAsync(resultQueryable, GetCancellationToken(cancellationToken)); } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs index 42161f884c..a6462d937c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/IBlogPostPublicAppService.cs @@ -1,18 +1,18 @@ -using System.Collections.Generic; -using JetBrains.Annotations; +using System; using System.Threading.Tasks; +using JetBrains.Annotations; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.CmsKit.Contents; using Volo.CmsKit.Users; -using System; namespace Volo.CmsKit.Public.Blogs; public interface IBlogPostPublicAppService : IApplicationService { - Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input); + Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input); - Task GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug); + Task GetAsync([NotNull] string blogSlug, [NotNull] string blogPostSlug); Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs index 0b33a91236..230b8ded97 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/IPagePublicAppService.cs @@ -1,6 +1,7 @@ using JetBrains.Annotations; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Volo.CmsKit.Contents; namespace Volo.CmsKit.Public.Pages; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs index 5b16e41f4f..5041406bd0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Blogs/BlogPostPublicAppService.cs @@ -3,13 +3,18 @@ using System.Collections.Generic; using System.Threading.Tasks; using JetBrains.Annotations; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.CmsKit.Blogs; + +using Volo.CmsKit.Contents; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPublicAppService { @@ -25,17 +30,17 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub BlogPostRepository = blogPostRepository; } - public virtual async Task GetAsync( + public virtual async Task GetAsync( [NotNull] string blogSlug, [NotNull] string blogPostSlug) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); var blogPost = await BlogPostRepository.GetBySlugAsync(blog.Id, blogPostSlug); - return ObjectMapper.Map(blogPost); + return ObjectMapper.Map(blogPost); } - public virtual async Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input) + public virtual async Task> GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); @@ -43,10 +48,10 @@ public class BlogPostPublicAppService : CmsKitPublicAppServiceBase, IBlogPostPub BlogPostStatus.Published, input.MaxResultCount, input.SkipCount, input.Sorting); - return new PagedResultDto( + return new PagedResultDto( await BlogPostRepository.GetCountAsync(blogId: blog.Id, tagId: input.TagId, statusFilter: BlogPostStatus.Published, authorId: input.AuthorId), - ObjectMapper.Map, List>(blogPosts)); + ObjectMapper.Map, List>(blogPosts)); } public virtual async Task> GetAuthorsHasBlogPostsAsync(BlogPostFilteredPagedAndSortedResultRequestDto input) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs index b1fae564d2..ef7e6be9fd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs @@ -1,20 +1,23 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Authorization; using Volo.Abp.Data; using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.Users; using Volo.CmsKit.Comments; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Comments; +[RequiresFeature(CmsKitFeatures.CommentEnable)] [RequiresGlobalFeature(typeof(CommentsFeature))] public class CommentPublicAppService : CmsKitPublicAppServiceBase, ICommentPublicAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicAppService.cs index 2debf10ed5..af0d1fbf39 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicAppService.cs @@ -1,11 +1,14 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.GlobalResources; namespace Volo.CmsKit.Public.GlobalResources; +[RequiresFeature(CmsKitFeatures.GlobalResourceEnable)] [RequiresGlobalFeature(typeof(GlobalResourcesFeature))] public class GlobalResourcePublicAppService : ApplicationService, IGlobalResourcePublicAppService { @@ -15,18 +18,18 @@ public class GlobalResourcePublicAppService : ApplicationService, IGlobalResourc { GlobalResourceManager = globalResourceManager; } - + public async Task GetGlobalScriptAsync() { var globalScript = await GlobalResourceManager.GetGlobalScriptAsync(); - + return ObjectMapper.Map(globalScript); } - + public async Task GetGlobalStyleAsync() { var globalStyle = await GlobalResourceManager.GetGlobalStyleAsync(); - + return ObjectMapper.Map(globalStyle); } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Menus/MenuItemPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Menus/MenuItemPublicAppService.cs index 11a58d5935..0e9062d9af 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Menus/MenuItemPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Menus/MenuItemPublicAppService.cs @@ -1,12 +1,15 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Caching; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Menus; namespace Volo.CmsKit.Public.Menus; +[RequiresFeature(CmsKitFeatures.MenuEnable)] [RequiresGlobalFeature(typeof(MenuFeature))] public class MenuItemPublicAppService : CmsKitPublicAppServiceBase, IMenuItemPublicAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs index 258ef935ed..c93adcd5a7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs @@ -1,10 +1,14 @@ using System.Threading.Tasks; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Pages; namespace Volo.CmsKit.Public.Pages; +[RequiresFeature(CmsKitFeatures.PageEnable)] [RequiresGlobalFeature(typeof(PagesFeature))] public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs index d5a1b58445..92620743ff 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs @@ -2,13 +2,13 @@ using Volo.Abp.AutoMapper; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; +using Volo.CmsKit.Contents; using Volo.CmsKit.GlobalResources; using Volo.CmsKit.Menus; using Volo.CmsKit.Pages; using Volo.CmsKit.Public.Blogs; using Volo.CmsKit.Public.Comments; using Volo.CmsKit.Public.GlobalResources; -using Volo.CmsKit.Public.Pages; using Volo.CmsKit.Public.Ratings; using Volo.CmsKit.Ratings; using Volo.CmsKit.Users; @@ -31,8 +31,8 @@ public class PublicApplicationAutoMapperProfile : Profile CreateMap(); CreateMap(); - - CreateMap(); + + CreateMap(); CreateMap(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Ratings/RatingPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Ratings/RatingPublicAppService.cs index 87ea0531db..f3b46c518b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Ratings/RatingPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Ratings/RatingPublicAppService.cs @@ -1,15 +1,18 @@ -using Microsoft.AspNetCore.Authorization; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Authorization; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.Users; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Ratings; using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Ratings; +[RequiresFeature(CmsKitFeatures.RatingEnable)] [RequiresGlobalFeature(typeof(RatingsFeature))] public class RatingPublicAppService : CmsKitPublicAppServiceBase, IRatingPublicAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Reactions/ReactionPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Reactions/ReactionPublicAppService.cs index b12f659d23..1151578d57 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Reactions/ReactionPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Reactions/ReactionPublicAppService.cs @@ -1,17 +1,19 @@ -using Microsoft.AspNetCore.Authorization; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; -using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; using Volo.Abp.Users; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Reactions; namespace Volo.CmsKit.Public.Reactions; +[RequiresFeature(CmsKitFeatures.ReactionEnable)] [RequiresGlobalFeature(typeof(ReactionsFeature))] public class ReactionPublicAppService : CmsKitPublicAppServiceBase, IReactionPublicAppService { diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs index b1bbf6be07..f26816e88d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/BlogPostPublicClientProxy.Generated.cs @@ -2,11 +2,9 @@ using System; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; -using Volo.CmsKit.Public.Blogs; +using Volo.CmsKit.Contents; using Volo.CmsKit.Users; // ReSharper disable once CheckNamespace @@ -16,18 +14,18 @@ namespace Volo.CmsKit.Public.Blogs.ClientProxies; [ExposeServices(typeof(IBlogPostPublicAppService), typeof(BlogPostPublicClientProxy))] public partial class BlogPostPublicClientProxy : ClientProxyBase, IBlogPostPublicAppService { - public virtual async Task GetAsync(string blogSlug, string blogPostSlug) + public virtual async Task GetAsync(string blogSlug, string blogPostSlug) { - return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue { { typeof(string), blogSlug }, { typeof(string), blogPostSlug } }); } - public virtual async Task> GetListAsync(string blogSlug, BlogPostGetListInput input) + public virtual async Task> GetListAsync(string blogSlug, BlogPostGetListInput input) { - return await RequestAsync>(nameof(GetListAsync), new ClientProxyRequestTypeValue + return await RequestAsync>(nameof(GetListAsync), new ClientProxyRequestTypeValue { { typeof(string), blogSlug }, { typeof(BlogPostGetListInput), input } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/PagesPublicClientProxy.Generated.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/PagesPublicClientProxy.Generated.cs index 9ecf6cb387..f992bb3dbf 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/PagesPublicClientProxy.Generated.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/PagesPublicClientProxy.Generated.cs @@ -1,12 +1,8 @@ // This file is automatically generated by ABP framework to use MVC Controllers from CSharp -using System; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Http.Client; -using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; -using Volo.CmsKit.Public.Pages; +using Volo.CmsKit.Contents; // ReSharper disable once CheckNamespace namespace Volo.CmsKit.Public.Pages.ClientProxies; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json index 626dce7ff2..e3b3802ee9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi.Client/ClientProxies/cms-kit-generate-proxy.json @@ -505,57 +505,6 @@ } } }, - "Volo.CmsKit.Public.Polls.PollViewComponentController": { - "controllerName": "PollViewComponent", - "controllerGroupName": "PollViewComponent", - "isRemoteService": true, - "apiVersion": null, - "type": "Volo.CmsKit.Public.Polls.PollViewComponentController", - "interfaces": [ - { - "type": "Volo.CmsKit.Public.Polls.IPollViewComponentAppService" - } - ], - "actions": { - "ParseAsyncByContent": { - "uniqueName": "ParseAsyncByContent", - "name": "ParseAsync", - "httpMethod": "GET", - "url": "api/cms-kit-public/polls/{content}", - "supportedVersions": [], - "parametersOnMethod": [ - { - "name": "content", - "typeAsString": "System.String, System.Private.CoreLib", - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null - } - ], - "parameters": [ - { - "nameOnMethod": "content", - "name": "content", - "jsonName": null, - "type": "System.String", - "typeSimple": "string", - "isOptional": false, - "defaultValue": null, - "constraintTypes": [], - "bindingSourceId": "Path", - "descriptorName": "" - } - ], - "returnValue": { - "type": "System.Collections.Generic.List", - "typeSimple": "[Volo.CmsKit.Polls.ContentFragment]" - }, - "allowAnonymous": null, - "implementFrom": "Volo.CmsKit.Public.Polls.IPollViewComponentAppService" - } - } - }, "Volo.CmsKit.Public.Pages.PagesPublicController": { "controllerName": "PagesPublic", "controllerGroupName": "PagesPublic", @@ -599,8 +548,8 @@ } ], "returnValue": { - "type": "Volo.CmsKit.Public.Pages.PageDto", - "typeSimple": "Volo.CmsKit.Public.Pages.PageDto" + "type": "Volo.CmsKit.Contents.PageDto", + "typeSimple": "Volo.CmsKit.Contents.PageDto" }, "allowAnonymous": null, "implementFrom": "Volo.CmsKit.Public.Pages.IPagePublicAppService" @@ -985,8 +934,8 @@ } ], "returnValue": { - "type": "Volo.CmsKit.Public.Blogs.BlogPostPublicDto", - "typeSimple": "Volo.CmsKit.Public.Blogs.BlogPostPublicDto" + "type": "Volo.CmsKit.Contents.BlogPostCommonDto", + "typeSimple": "Volo.CmsKit.Contents.BlogPostCommonDto" }, "allowAnonymous": null, "implementFrom": "Volo.CmsKit.Public.Blogs.IBlogPostPublicAppService" @@ -1090,8 +1039,8 @@ } ], "returnValue": { - "type": "Volo.Abp.Application.Dtos.PagedResultDto", - "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" }, "allowAnonymous": null, "implementFrom": "Volo.CmsKit.Public.Blogs.IBlogPostPublicAppService" diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs index 9f43d65766..e5d2570e21 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Blogs/BlogPostPublicController.cs @@ -1,16 +1,18 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; -using Volo.Abp.Content; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Blogs; +[RequiresFeature(CmsKitFeatures.BlogEnable)] [RequiresGlobalFeature(typeof(BlogsFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] @@ -26,14 +28,14 @@ public class BlogPostPublicController : CmsKitPublicControllerBase, IBlogPostPub [HttpGet] [Route("{blogSlug}/{blogPostSlug}")] - public virtual Task GetAsync(string blogSlug, string blogPostSlug) + public virtual Task GetAsync(string blogSlug, string blogPostSlug) { return BlogPostPublicAppService.GetAsync(blogSlug, blogPostSlug); } [HttpGet] [Route("{blogSlug}")] - public virtual Task> GetListAsync(string blogSlug, BlogPostGetListInput input) + public virtual Task> GetListAsync(string blogSlug, BlogPostGetListInput input) { return BlogPostPublicAppService.GetListAsync(blogSlug, input); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Comments/CommentPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Comments/CommentPublicController.cs index afbf11e843..f77444431e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Comments/CommentPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Comments/CommentPublicController.cs @@ -3,11 +3,14 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Comments; +[RequiresFeature(CmsKitFeatures.CommentEnable)] [RequiresGlobalFeature(typeof(CommentsFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicController.cs index 8b58a00f9a..635e228e0b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/GlobalResources/GlobalResourcePublicController.cs @@ -1,16 +1,19 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.GlobalResources; +[RequiresFeature(CmsKitFeatures.GlobalResourceEnable)] [RequiresGlobalFeature(typeof(GlobalResourcesFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] [Route("api/cms-kit-public/global-resources")] -public class GlobalResourcePublicController: CmsKitPublicControllerBase, IGlobalResourcePublicAppService +public class GlobalResourcePublicController : CmsKitPublicControllerBase, IGlobalResourcePublicAppService { private readonly IGlobalResourcePublicAppService _globalResourcePublicAppService; @@ -18,14 +21,14 @@ public class GlobalResourcePublicController: CmsKitPublicControllerBase, IGlobal { _globalResourcePublicAppService = globalResourcePublicAppService; } - + [HttpGet] [Route("script")] public Task GetGlobalScriptAsync() { return _globalResourcePublicAppService.GetGlobalScriptAsync(); } - + [HttpGet] [Route("style")] public Task GetGlobalStyleAsync() diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Menus/MenuItemPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Menus/MenuItemPublicController.cs index fc8820c1b2..3eb00439fb 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Menus/MenuItemPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Menus/MenuItemPublicController.cs @@ -2,13 +2,16 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Menus; namespace Volo.CmsKit.Public.Menus; -[RequiresGlobalFeature(typeof(BlogsFeature))] +[RequiresFeature(CmsKitFeatures.MenuEnable)] +[RequiresGlobalFeature(typeof(MenuFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] [Route("api/cms-kit-public/menu-items")] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs index 763fe7522d..22f2bd75bd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Pages/PagesPublicController.cs @@ -1,11 +1,15 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Contents; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Pages; +[RequiresFeature(CmsKitFeatures.PageEnable)] [RequiresGlobalFeature(typeof(PagesFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Ratings/RatingPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Ratings/RatingPublicController.cs index 11e8d22a69..f793aaefc4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Ratings/RatingPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Ratings/RatingPublicController.cs @@ -2,11 +2,14 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Ratings; +[RequiresFeature(CmsKitFeatures.RatingEnable)] [RequiresGlobalFeature(typeof(RatingsFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Reactions/ReactionPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Reactions/ReactionPublicController.cs index 4a9df74df7..6242e253a2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Reactions/ReactionPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Reactions/ReactionPublicController.cs @@ -2,11 +2,14 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; namespace Volo.CmsKit.Public.Reactions; +[RequiresFeature(CmsKitFeatures.ReactionEnable)] [RequiresGlobalFeature(typeof(ReactionsFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs index ec45901118..1620f136da 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Tags/TagPublicController.cs @@ -1,13 +1,16 @@ -using Microsoft.AspNetCore.Mvc; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; +using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.CmsKit.Features; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Tags; namespace Volo.CmsKit.Public.Tags; +[RequiresFeature(CmsKitFeatures.TagEnable)] [RequiresGlobalFeature(typeof(TagsFeature))] [RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] [Area(CmsKitPublicRemoteServiceConsts.ModuleName)] diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs index 88b01c8ae9..3ce96f1a86 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook; +using Volo.Abp.Ui.LayoutHooks; using Volo.Abp.AutoMapper; using Volo.Abp.GlobalFeatures; using Volo.Abp.Http.ProxyScripting.Generators.JQuery; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs index 8c307e390e..81fd94406d 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/CommentingViewComponent.cs @@ -8,7 +8,7 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI; using Volo.Abp.AspNetCore.Mvc.UI.Widgets; using Volo.CmsKit.Public.Comments; -using Volo.CmsKit.Public.Web.Renderers; +using Volo.CmsKit.Web.Renderers; namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting; diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml index 88d7398fcf..d5dc5a0be8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml @@ -9,7 +9,7 @@ @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags -@using Volo.CmsKit.Public.Web.Renderers +@using Volo.CmsKit.Web.Renderers @using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs @using Volo.CmsKit.Contents diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs index 268528c4bc..87630f9bd0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPost.cshtml.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using Volo.Abp.GlobalFeatures; using Volo.Abp.ObjectMapping; using Volo.CmsKit.Blogs; +using Volo.CmsKit.Contents; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Public.Blogs; using Volo.CmsKit.Web.Contents; @@ -48,7 +49,7 @@ public class BlogPostModel : CmsKitPublicPageModelBase public virtual async Task OnGetAsync() { var blogPostPublicDto = await BlogPostPublicAppService.GetAsync(BlogSlug, BlogPostSlug); - ViewModel = ObjectMapper.Map(blogPostPublicDto); + ViewModel = ObjectMapper.Map(blogPostPublicDto); if (ViewModel == null) { return NotFound(); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs index ff154b6a7b..789d2687fc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/BlogPostViewModel.cs @@ -3,12 +3,11 @@ using System.Collections.Generic; using AutoMapper; using Volo.Abp.Application.Dtos; using Volo.CmsKit.Contents; -using Volo.CmsKit.Public.Blogs; using Volo.CmsKit.Users; namespace Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Blogs; -[AutoMap(typeof(BlogPostPublicDto), ReverseMap = true)] +[AutoMap(typeof(BlogPostCommonDto), ReverseMap = true)] public class BlogPostViewModel : AuditedEntityDto { public Guid BlogId { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs index f5f2cc2f7a..736fba5e9e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Blogs/Index.cshtml.cs @@ -1,11 +1,9 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System; using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination; +using Volo.CmsKit.Contents; using Volo.CmsKit.Public.Blogs; using Volo.CmsKit.Users; @@ -27,7 +25,7 @@ public class IndexModel : CmsKitPublicPageModelBase [BindProperty(SupportsGet = true)] public Guid? TagId { get; set; } - public PagedResultDto Blogs { get; private set; } + public PagedResultDto Blogs { get; private set; } public PagerModel PagerModel => new PagerModel(Blogs.TotalCount, Blogs.Items.Count, CurrentPage, PageSize, Request.Path.ToString()); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml index 6a8b7a6742..e14733695a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml @@ -2,16 +2,13 @@ @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap @using Volo.CmsKit.Contents @using System.Dynamic -@using Volo.CmsKit.Public.Web.Renderers @using Volo.Abp.Data @using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs; @using Volo.Abp.AspNetCore.Mvc.UI.Widgets; - -@inject IMarkdownToHtmlRenderer MarkdownRenderer - - +@using Volo.CmsKit.Web.Renderers @model Volo.CmsKit.Public.Web.Pages.Public.CmsKit.Pages.IndexModel +@inject IMarkdownToHtmlRenderer MarkdownRenderer @section styles{ diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs index 98f1fb70c4..18eb184742 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.CmsKit.Contents; using Volo.CmsKit.Public.Pages; using Volo.CmsKit.Web.Contents; using Volo.CmsKit.Web.Pages; diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs index c200fd01f3..a895f4a949 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/EntityTagRepository_Test.cs @@ -9,11 +9,11 @@ namespace Volo.CmsKit.Tags; public abstract class EntityTagRepository_Test : CmsKitTestBase where TStartupModule : IAbpModule { - private CmsKitTestData _cmsKitTestData; - private IEntityTagRepository _entityTagRepository; - private ITagRepository _tagRepository; + private readonly CmsKitTestData _cmsKitTestData; + private readonly IEntityTagRepository _entityTagRepository; + private readonly ITagRepository _tagRepository; - public EntityTagRepository_Test() + protected EntityTagRepository_Test() { _cmsKitTestData = GetRequiredService(); _entityTagRepository = GetRequiredService(); @@ -25,7 +25,7 @@ public abstract class EntityTagRepository_Test : CmsKitTestBase< { var relatedTags = await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.Content_1_EntityType, _cmsKitTestData.Content_1_EntityId); - await _entityTagRepository.DeleteManyAsync(relatedTags.Select(s => s.Id).ToArray()); + await _entityTagRepository.DeleteManyAsync(relatedTags.Select(s => s.Id).ToArray(), _cmsKitTestData.Content_1_EntityId); relatedTags = await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.Content_1_EntityType, _cmsKitTestData.Content_1_EntityId); @@ -35,7 +35,7 @@ public abstract class EntityTagRepository_Test : CmsKitTestBase< [Fact] public async Task GetEntityIdsFilteredByTagNameAsync_ShouldWorkProperly() { - var entityIds = await _entityTagRepository.GetEntityIdsFilteredByTagNameAsync(_cmsKitTestData.TagName_1, _cmsKitTestData.EntityType1); + var entityIds = await _entityTagRepository.GetEntityIdsFilteredByTagNameAsync(_cmsKitTestData.TagName_1, _cmsKitTestData.EntityType1); entityIds.ShouldNotBeNull(); entityIds.ShouldNotBeEmpty(); diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs index c415efa860..b574870fd8 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentDto.cs @@ -8,6 +8,8 @@ namespace Volo.Docs.Admin.Documents public class DocumentDto : EntityDto { public virtual Guid ProjectId { get; set; } + + public virtual string ProjectName { get; set; } public virtual string Name { get; set; } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentInfoDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentInfoDto.cs new file mode 100644 index 0000000000..545e665869 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/DocumentInfoDto.cs @@ -0,0 +1,11 @@ +using System; + +namespace Volo.Docs.Admin.Documents; + +public class DocumentInfoDto +{ + public string Version { get; set; } + public string Format { get; set; } + public string LanguageCode { get; set; } + public Guid ProjectId { get; set; } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs index 0770ec5d72..12bdbc87be 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/IDocumentAdminAppService.cs @@ -19,5 +19,7 @@ namespace Volo.Docs.Admin.Documents Task RemoveFromCacheAsync(Guid documentId); Task ReindexAsync(Guid documentId); + + Task> GetFilterItemsAsync(); } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json index 4849da66e5..ada739b4d7 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ar.json @@ -54,6 +54,7 @@ "Version": "إصدار", "LanguageCode": "رمز اللغة", "FileName": "اسم الملف", - "LastCachedTime": "وقت ذاكرة التخزين" + "LastCachedTime": "وقت ذاكرة التخزين", + "Project": "مشروع " } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json index 57dd3c75d5..c593147804 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/cs.json @@ -54,6 +54,7 @@ "Version": "Verze", "LanguageCode": "Kód jazyka", "FileName": "Název souboru", - "LastCachedTime": "Čas uložení v mezipaměti" + "LastCachedTime": "Čas uložení v mezipaměti", + "Project": "Projekt" } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json index 28d5f53f47..4d92840132 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de-DE.json @@ -54,6 +54,7 @@ "Version": "Version", "LanguageCode": "Sprachcode", "FileName": "Dateiname", - "LastCachedTime": "Cache-Zeit" + "LastCachedTime": "Cache-Zeit", + "Project": "Projekt" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json index 2eccecb715..7939e4a8f1 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/de.json @@ -32,6 +32,7 @@ "DisplayName:GitHubUserAgent": "GitHub-Benutzer-Agent", "DisplayName:All": "Pull all", "DisplayName:LanguageCode": "Sprachcode", - "DisplayName:Version": "Version" + "DisplayName:Version": "Version", + "Project": "Projekt" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json index d44ba001db..bacdfd56de 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/el.json @@ -54,6 +54,7 @@ "Version": "Εκδοχή", "LanguageCode": "Κωδικός γλώσσας", "FileName": "Όνομα αρχείου", - "LastCachedTime": "Χρόνος προσωρινής αποθήκευσης" + "LastCachedTime": "Χρόνος προσωρινής αποθήκευσης", + "Project": "Εργο" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json index 1e3339963a..d72c523ef5 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en-GB.json @@ -54,6 +54,8 @@ "Version": "Version", "LanguageCode": "Language code", "FileName": "File name", - "LastCachedTime": "Cache time" + "LastCachedTime": "Cache time", + "Project": "Project", + "AdvancedFilters": "Advanced Filters" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json index d19bef7adf..86142ceb44 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json @@ -54,6 +54,8 @@ "Version": "Version", "LanguageCode": "Language code", "FileName": "File name", - "LastCachedTime": "Cache time" + "LastCachedTime": "Cache time", + "Project": "Project", + "AdvancedFilters": "Advanced Filters" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json index f09eb5386b..9858f9d94a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/es.json @@ -54,6 +54,7 @@ "Version": "Versión", "LanguageCode": "Código de idioma", "FileName": "Nombre de fichero", - "LastCachedTime": "Última actualización de caché" + "LastCachedTime": "Última actualización de caché", + "Project": "Proyecto" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json index 0d0f7de507..58befd658c 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fi.json @@ -54,6 +54,7 @@ "Version": "Versio", "LanguageCode": "Kielikoodi", "FileName": "Tiedoston nimi", - "LastCachedTime": "Välimuistin aika" + "LastCachedTime": "Välimuistin aika", + "Project": "Projekti" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json index f00ce0a5c9..7a6d6a89cf 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/fr.json @@ -54,6 +54,7 @@ "Version": "Version", "LanguageCode": "Code de langue", "FileName": "Nom de fichier", - "LastCachedTime": "Temps de cache" + "LastCachedTime": "Temps de cache", + "Project": "Projet" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json index d2a0e11876..a7d357e83e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hi.json @@ -54,6 +54,7 @@ "Version": "संस्करण", "LanguageCode": "भाषा कोड", "FileName": "फ़ाइल का नाम", - "LastCachedTime": "कैश समय" + "LastCachedTime": "कैश समय", + "Project": "परियोजना" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hu.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hu.json index 10d1611838..fce9150db3 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hu.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/hu.json @@ -1,61 +1,62 @@ { - "culture": "hu", - "texts": { - "Permission:DocumentManagement": "Dokumentum kezelés", - "Permission:Projects": "Projektek", - "Permission:Edit": "Szerkesztés", - "Permission:Delete": "Törlés", - "Permission:Create": "Létrehozás", - "Permission:Documents": "Dokumentumok", - "Menu:Documents": "Dokumentumok", - "Menu:DocumentManagement": "Dokumentumok", - "Menu:ProjectManagement": "Projektek", - "CreateANewProject": "Új projekt létrehozása", - "Edit": "Szerkesztés", - "Create": "Létrehozás", - "Pull": "Pull", - "Projects": "Projektek", - "Name": "Név", - "ShortName": "Rövid név", - "DocumentStoreType": "Dokumentumtároló típus", - "Format": "Formátum", - "ShortNameInfoText": "Használjon egyedi URL-t.", - "DisplayName:Name": "Név", - "DisplayName:ShortName": "Rövid név", - "DisplayName:Format": "Formátum", - "DisplayName:DefaultDocumentName": "Alapértlemezett dokumentum név", - "DisplayName:NavigationDocumentName": "Navigációs dokumentum neve", - "DisplayName:MinimumVersion": "Minimális verzió", - "DisplayName:MainWebsiteUrl": "A fő webhely URL-je", - "DisplayName:LatestVersionBranchName": "Az utolsó verzió branch neve", - "DisplayName:GitHubRootUrl": "GitHub root URL", - "DisplayName:GitHubAccessToken": "GitHub access token", - "DisplayName:GitHubUserAgent": "GitHub user agent", - "DisplayName:GithubVersionProviderSource": "GitHub version provider source", - "DisplayName:VersionBranchPrefix": "Version branch prefix", - "DisplayName:All": "Pull all", - "DisplayName:LanguageCode": "Nyelv kódja", - "DisplayName:Version": "Verzió", - "Documents": "Dokumentumok", - "RemoveFromCache": "Távolítsa el a gyorsítótárból", - "Reindex": "Újraindexálás", - "ReindexCompleted": "Újraindexálás teljes.", - "RemovedFromCache": "Távolítsa el a gyorsítótárból", - "RemoveFromCacheConfirmation": "Biztosan eltávolítja ezt az elemet a gyorsítótárból?", - "ReIndexDocumentConfirmation": "Biztosan újraindexeli ezt az elemet?", - "DeleteDocumentFromDbConfirmation": "Biztosan törli ezt az elemet az adatbázisból?", - "DeleteFromDatabase": "Törlés az adatbázisból", - "Deleted": "Törölt", - "Search": "Keresés", - "StartDate": "Indulási dátum", - "EndDate": "Befejezés dátuma", - "CreationTime": "Létrehozás ideje", - "LastUpdateTime": "Utolsó módosítás ideje", - "LastSignificantUpdateTime": "Utolsó jelentős frissítés", - "Version": "Verzió", - "LanguageCode": "Nyelv kódja", - "FileName": "Filenév", - "LastCachedTime": "Cache idő" - } + "culture": "hu", + "texts": { + "Permission:DocumentManagement": "Dokumentum kezelés", + "Permission:Projects": "Projektek", + "Permission:Edit": "Szerkesztés", + "Permission:Delete": "Törlés", + "Permission:Create": "Létrehozás", + "Permission:Documents": "Dokumentumok", + "Menu:Documents": "Dokumentumok", + "Menu:DocumentManagement": "Dokumentumok", + "Menu:ProjectManagement": "Projektek", + "CreateANewProject": "Új projekt létrehozása", + "Edit": "Szerkesztés", + "Create": "Létrehozás", + "Pull": "Pull", + "Projects": "Projektek", + "Name": "Név", + "ShortName": "Rövid név", + "DocumentStoreType": "Dokumentumtároló típus", + "Format": "Formátum", + "ShortNameInfoText": "Használjon egyedi URL-t.", + "DisplayName:Name": "Név", + "DisplayName:ShortName": "Rövid név", + "DisplayName:Format": "Formátum", + "DisplayName:DefaultDocumentName": "Alapértlemezett dokumentum név", + "DisplayName:NavigationDocumentName": "Navigációs dokumentum neve", + "DisplayName:MinimumVersion": "Minimális verzió", + "DisplayName:MainWebsiteUrl": "A fő webhely URL-je", + "DisplayName:LatestVersionBranchName": "Az utolsó verzió branch neve", + "DisplayName:GitHubRootUrl": "GitHub root URL", + "DisplayName:GitHubAccessToken": "GitHub access token", + "DisplayName:GitHubUserAgent": "GitHub user agent", + "DisplayName:GithubVersionProviderSource": "GitHub version provider source", + "DisplayName:VersionBranchPrefix": "Version branch prefix", + "DisplayName:All": "Pull all", + "DisplayName:LanguageCode": "Nyelv kódja", + "DisplayName:Version": "Verzió", + "DisplayName:Role": "Szerepkör", + "Documents": "Dokumentumok", + "RemoveFromCache": "Távolítsa el a gyorsítótárból", + "Reindex": "Újraindexálás", + "ReindexCompleted": "Újraindexálás teljes.", + "RemovedFromCache": "Távolítsa el a gyorsítótárból", + "RemoveFromCacheConfirmation": "Biztosan eltávolítja ezt az elemet a gyorsítótárból?", + "ReIndexDocumentConfirmation": "Biztosan újraindexeli ezt az elemet?", + "DeleteFromDatabase": "Törlés az adatbázisból", + "Deleted": "Törölt", + "Search": "Keresés", + "StartDate": "Indulási dátum", + "EndDate": "Befejezés dátuma", + "CreationTime": "Létrehozás ideje", + "LastUpdateTime": "Utolsó módosítás ideje", + "LastSignificantUpdateTime": "Utolsó jelentős frissítés", + "Version": "Verzió", + "LanguageCode": "Nyelv kódja", + "FileName": "Filenév", + "LastCachedTime": "Cache idő", + "Project": "Projekt", + "AdvancedFilters": "Speciális szűrők" } - \ No newline at end of file +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json index 101aab8182..c7d13791d0 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/is.json @@ -54,6 +54,7 @@ "Version": "Útgáfa", "LanguageCode": "Túngumála kóði", "FileName": "Skráar nafn", - "LastCachedTime": "Tími geymt í skyndiminni" + "LastCachedTime": "Tími geymt í skyndiminni", + "Project": "Verkefni" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json index 1a4d8e3f4c..b6c95e5b58 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/it.json @@ -54,6 +54,7 @@ "Version": "Versione", "LanguageCode": "Codice della lingua", "FileName": "Nome del file", - "LastCachedTime": "Tempo di cache" + "LastCachedTime": "Tempo di cache", + "Project": "Progetto" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json index 6451eed41e..e8cd5d730a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/nl.json @@ -54,6 +54,7 @@ "Version": "Versie", "LanguageCode": "Taalcode", "FileName": "Bestandsnaam", - "LastCachedTime": "Cache tijd" + "LastCachedTime": "Cache tijd", + "Project": "Project" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json index 26e4b8bc7f..5f1025a9a6 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pl-PL.json @@ -54,6 +54,7 @@ "Version": "Wersja", "LanguageCode": "Kod języka", "FileName": "Nazwa pliku", - "LastCachedTime": "Czas w pamięci podręcznej" + "LastCachedTime": "Czas w pamięci podręcznej", + "Project": "Projekt" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json index 7daa4964b3..d926dfada9 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/pt-BR.json @@ -32,7 +32,7 @@ "DisplayName:GitHubAccessToken": "Token de acesso do GitHub", "DisplayName:GitHubUserAgent": "Usuário agente do GitHub", "DisplayName:GithubVersionProviderSource": "Fonte do provedor de versão do GitHub", - "DisplayName:VersionBranchPrefix": "Prefixo da ramificação da versão", + "DisplayName:VersionBranchPrefix": "Prefixo da Branch da versão", "DisplayName:All": "Puxe tudo", "DisplayName:LanguageCode": "Código de idioma", "DisplayName:Version": "Versão", @@ -54,6 +54,8 @@ "Version": "Versão", "LanguageCode": "Código de idioma", "FileName": "Nome do arquivo", - "LastCachedTime": "Tempo de cache" + "LastCachedTime": "Tempo de cache", + "Project": "Projeto", + "AdvancedFilters": "Filtros Avançados" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json index 02198cb96c..b236915665 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ro-RO.json @@ -54,6 +54,7 @@ "Version": "Versiune", "LanguageCode": "Codul limbii", "FileName": "Nume fişier", - "LastCachedTime": "Durată cache" + "LastCachedTime": "Durată cache", + "Project": "Proiect" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json index 1b7082d189..16102717c2 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/ru.json @@ -54,6 +54,7 @@ "Version": "Версия", "LanguageCode": "Код языка", "FileName": "Имя файла", - "LastCachedTime": "Время кеширования" + "LastCachedTime": "Время кеширования", + "Project": "Проект" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json index ab0bc3e008..8041e796f0 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sk.json @@ -54,6 +54,7 @@ "Version": "Verzia", "LanguageCode": "Kód jazyka", "FileName": "Názov súboru", - "LastCachedTime": "Čas vyrovnávacej pamäte" + "LastCachedTime": "Čas vyrovnávacej pamäte", + "Project": "Projekt" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json index f2061a9fd5..a3445dc87b 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/sl.json @@ -54,6 +54,7 @@ "Version": "Različica", "LanguageCode": "Jezikovna koda", "FileName": "Ime datoteke", - "LastCachedTime": "Čas predpomnilnika" + "LastCachedTime": "Čas pred pomnilnika", + "Project": "Projekt" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json index 57c72b6db5..dade32b970 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/tr.json @@ -48,12 +48,14 @@ "Search": "Arama", "StartDate": "Başlangıç tarihi", "EndDate": "Bitiş tarihi", - "CreationTime": "oluşturma zamanı", + "CreationTime": "Oluşturma Zamanı", "LastUpdateTime": "Son Güncelleme", "LastSignificantUpdateTime": "Son önemli güncelleme", - "Version": "sürüm", + "Version": "Sürüm", "LanguageCode": "Dil kodu", "FileName": "Dosya adı", - "LastCachedTime": "Önbellek süresi" + "LastCachedTime": "Önbellek süresi", + "Project": "Proje", + "AdvancedFilters": "Gelişmiş Filtre" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json index 350d995cfe..c44d2feb8f 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/vi.json @@ -54,6 +54,7 @@ "Version": "Phiên bản", "LanguageCode": "Mật ngữ", "FileName": "Tên tệp", - "LastCachedTime": "Thời gian lưu vào bộ nhớ đệm" + "LastCachedTime": "Thời gian lưu vào bộ nhớ đệm", + "Project": "Dự án" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json index c0985f956a..f81333d38e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hans.json @@ -54,6 +54,7 @@ "Version": "版本", "LanguageCode": "语言代码", "FileName": "文件名称", - "LastCachedTime": "缓存项" + "LastCachedTime": "缓存项", + "Project": "项目" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json index cc76f54510..54d86eca33 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/zh-Hant.json @@ -54,6 +54,7 @@ "Version": "版本", "LanguageCode": "語言代碼", "FileName": "文檔名稱", - "LastCachedTime": "緩存時間" + "LastCachedTime": "緩存時間", + "Project": "项目" } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs index 9b832165d1..6f3d503f44 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -20,5 +21,6 @@ namespace Volo.Docs.Admin.Projects Task ReindexAsync(ReindexInput input); Task ReindexAllAsync(); + Task> GetListWithoutDetailsAsync(); } } diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectWithoutDetailsDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectWithoutDetailsDto.cs new file mode 100644 index 0000000000..b6e6a301cb --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectWithoutDetailsDto.cs @@ -0,0 +1,9 @@ +using System; + +namespace Volo.Docs.Admin.Projects; + +public class ProjectWithoutDetailsDto +{ + public Guid Id { get; set; } + public string Name { get; set; } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs index 86e6d46e0c..01a7250ce5 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Volo.Abp.AutoMapper; using Volo.Docs.Admin.Documents; using Volo.Docs.Admin.Projects; using Volo.Docs.Documents; @@ -11,8 +12,10 @@ namespace Volo.Docs.Admin public DocsAdminApplicationAutoMapperProfile() { CreateMap(); - CreateMap(); + CreateMap().Ignore(x => x.ProjectName); CreateMap(); + CreateMap(); + CreateMap(); } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs index af515b4be7..7d68681b1d 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Documents/DocumentAdminAppService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Logging; using Volo.Abp; -using Volo.Abp.Uow; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Caching; @@ -217,6 +216,13 @@ namespace Volo.Docs.Admin.Documents await _elasticSearchService.AddOrUpdateAsync(document); } + public async Task> GetFilterItemsAsync() + { + var documents = await _documentRepository.GetUniqueListDocumentInfoAsync(); + return ObjectMapper.Map, List>(documents); + } + + private async Task UpdateDocumentUpdateInfoCache(Document document) { var cacheKey = $"DocumentUpdateInfo{document.ProjectId}#{document.Name}#{document.LanguageCode}#{document.Version}"; diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs index 14833cd3e4..540ecfe275 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs @@ -156,5 +156,11 @@ namespace Volo.Docs.Admin.Projects await ReindexProjectAsync(project.Id); } } + + public async Task> GetListWithoutDetailsAsync() + { + var projects = await _projectRepository.GetListWithoutDetailsAsync(); + return ObjectMapper.Map, List>(projects); + } } } diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs index 7bb1ef0e87..e2b9fa2783 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/DocumentsAdminClientProxy.Generated.cs @@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; using Volo.Docs.Admin.Documents; +using System.Collections.Generic; // ReSharper disable once CheckNamespace namespace Volo.Docs.Admin.ClientProxies; @@ -62,4 +63,9 @@ public partial class DocumentsAdminClientProxy : ClientProxyBase> GetFilterItemsAsync() + { + return await RequestAsync>(nameof(GetFilterItemsAsync)); + } } diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs index cb8d5c3947..072106df0e 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/ProjectsAdminClientProxy.Generated.cs @@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; using Volo.Docs.Admin.Projects; +using System.Collections.Generic; // ReSharper disable once CheckNamespace namespace Volo.Docs.Admin.ClientProxies; @@ -61,6 +62,11 @@ public partial class ProjectsAdminClientProxy : ClientProxyBase> GetListWithoutDetailsAsync() + { + return await RequestAsync>(nameof(GetListWithoutDetailsAsync)); + } + public virtual async Task ReindexAsync(ReindexInput input) { await RequestAsync(nameof(ReindexAsync), new ClientProxyRequestTypeValue diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json index e85e6fbb43..c6cf885b09 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/ClientProxies/docs-admin-generate-proxy.json @@ -7,6 +7,8 @@ "Volo.Docs.Admin.DocumentsAdminController": { "controllerName": "DocumentsAdmin", "controllerGroupName": "DocumentsAdmin", + "isRemoteService": true, + "apiVersion": null, "type": "Volo.Docs.Admin.DocumentsAdminController", "interfaces": [ { @@ -427,12 +429,29 @@ }, "allowAnonymous": null, "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" + }, + "GetFilterItemsAsync": { + "uniqueName": "GetFilterItemsAsync", + "name": "GetFilterItemsAsync", + "httpMethod": "GET", + "url": "api/docs/admin/documents/GetFilterItems", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Docs.Admin.Documents.DocumentInfoDto]" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Admin.Documents.IDocumentAdminAppService" } } }, "Volo.Docs.Admin.ProjectsAdminController": { "controllerName": "ProjectsAdmin", "controllerGroupName": "ProjectsAdmin", + "isRemoteService": true, + "apiVersion": null, "type": "Volo.Docs.Admin.ProjectsAdminController", "interfaces": [ { @@ -684,6 +703,21 @@ "allowAnonymous": null, "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" }, + "GetListWithoutDetailsAsync": { + "uniqueName": "GetListWithoutDetailsAsync", + "name": "GetListWithoutDetailsAsync", + "httpMethod": "GET", + "url": "api/docs/admin/projects/GetListProjectWithoutDetailsAsync", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Docs.Admin.Projects.ProjectWithoutDetailsDto]" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Docs.Admin.Projects.IProjectAdminAppService" + }, "ReindexAsyncByInput": { "uniqueName": "ReindexAsyncByInput", "name": "ReindexAsync", diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs index 9404ac0bde..c0586ed699 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocumentsAdminController.cs @@ -63,5 +63,12 @@ namespace Volo.Docs.Admin { await _documentAdminAppService.ReindexAsync(documentId); } + + [HttpGet] + [Route("GetFilterItems")] + public async Task> GetFilterItemsAsync() + { + return await _documentAdminAppService.GetFilterItemsAsync(); + } } } diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs index 1696229bf8..ea0c7f1afd 100644 --- a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/ProjectsAdminController.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; @@ -61,6 +62,13 @@ namespace Volo.Docs.Admin return _projectAppService.ReindexAllAsync(); } + [HttpGet] + [Route("GetListProjectWithoutDetailsAsync")] + public Task> GetListWithoutDetailsAsync() + { + return _projectAppService.GetListWithoutDetailsAsync(); + } + [HttpPost] [Route("Reindex")] public Task ReindexAsync(ReindexInput input) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml index 5873afc279..9e846f24a9 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml @@ -32,147 +32,156 @@
-
-
-
-
@L["Name"].Value
- - -
-
+ -
+
-
@L["Version"].Value
- - +
@L["Project"].Value
+ +
-
+ -
+
-
@L["LanguageCode"].Value
+
@L["Version"].Value
- +
-
- - -
+ + +
-
@L["FileName"].Value
+
@L["Name"].Value
+ id="Name" + name="Name" + class="form-control">
-
+ -
+
-
@L["Format"].Value
+
@L["LanguageCode"].Value
- +
-
- - -
-
-
@L["CreationTime"].Value
- - - + + + + + + @L["AdvancedFilters"] + + +
+
+ -
-
-
@L["LastUpdateTime"].Value
- - +
+
@L["LastUpdateTime"].Value
+ - - - - -
-
- -
-
-
@L["LastSignificantUpdateTime"].Value
- - - - - - - -
-
+
+ -
-
-
@L["LastCachedTime"].Value
+ +
+
@L["LastCachedTime"].Value
- - - - - - -
-
- -
- -
-
+
+ + + +
+
@L["Format"].Value
+ + +
+
+ + + + + +
+
@L["LastSignificantUpdateTime"].Value
+ + + + +
+
+ + +
@@ -180,13 +189,14 @@ @L["Actions"] + @L["ProjectName"] @L["Name"] @L["Version"] @L["LanguageCode"] @L["FileName"] @L["Format"] @L["CreationTime"] - @L["LastUpdatedTime"] + @L["LastUpdateTime"] @L["LastSignificantUpdateTime"] @L["LastCachedTime"] diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs index 559eaab5eb..194ad6780f 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml.cs @@ -1,18 +1,24 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Volo.Docs.Documents; +using Volo.Docs.Admin.Projects; -namespace Volo.Docs.Admin.Pages.Docs.Admin.Documents +namespace Volo.Docs.Admin.Pages.Docs.Admin.Documents; + +[Authorize(DocsAdminPermissions.Projects.Default)] +public class IndexModel : DocsAdminPageModel { - [Authorize(DocsAdminPermissions.Projects.Default)] - public class IndexModel : DocsAdminPageModel + private readonly IProjectAdminAppService _projectAdminAppService; + public List Projects { get; set; } + + public IndexModel(IProjectAdminAppService projectAdminAppService) + { + _projectAdminAppService = projectAdminAppService; + } + public virtual async Task OnGet() { - public virtual Task OnGet() - { - return Task.FromResult(Page()); - } + Projects = await _projectAdminAppService.GetListWithoutDetailsAsync(); + return Page(); } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js index 928990e160..85c1ebc7be 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js @@ -6,13 +6,112 @@ $(function () { return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); }; + var comboboxItems = []; + + service.getFilterItems() + .then(function (result) { + comboboxItems = result; + fillOptions(); + }).catch(function (error) { + abp.message.error(error); + }); + + + var $projectId = $('#ProjectId'); + + $projectId.on('change', function () { + fillOptions(); + }); + + var comboboxs = { + version: $('#Version'), + languageCode: $('#LanguageCode'), + format: $('#Format') + }; + + for (var key in comboboxs) { + comboboxs[key].on('change', function () { + fillOptions(); + }); + } + + + var selectedItem = getSelectedItem(); + + function emptyComboboxs() { + for (var key in comboboxs) { + comboboxs[key].empty(); + } + } + + function getSelectedItem() { + var item = {}; + for (var key in comboboxs) { + item[key] = comboboxs[key].val(); + } + return item; + } + + function SetComboboxsValues(item) { + for (var key in comboboxs) { + comboboxs[key].val(item[key]); + } + } + + function addComboboxsEmptyItem() { + for (var key in comboboxs) { + comboboxs[key].append($('
public bool AddDeveloperSigningCredential { get; set; } = true; + + /// + /// Adds the default cookie handlers and corresponding configuration + /// Default: true, Set false to suppress AddCookieAuthentication() call on the IIdentityServerBuilder. + /// + public bool AddIdentityServerCookieAuthentication { get; set; } = true; } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs index 96ab4abd89..9b9dde5c96 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using IdentityServer4.Configuration; using IdentityServer4.Services; using IdentityServer4.Stores; using Microsoft.Extensions.DependencyInjection; @@ -71,13 +72,7 @@ public class AbpIdentityServerDomainModule : AbpModule var configuration = services.GetConfiguration(); var builderOptions = services.ExecutePreConfiguredActions(); - var identityServerBuilder = services.AddIdentityServer(options => - { - options.Events.RaiseErrorEvents = true; - options.Events.RaiseInformationEvents = true; - options.Events.RaiseFailureEvents = true; - options.Events.RaiseSuccessEvents = true; - }); + var identityServerBuilder = AddIdentityServer(services, builderOptions); if (builderOptions.AddDeveloperSigningCredential) { @@ -110,6 +105,37 @@ public class AbpIdentityServerDomainModule : AbpModule } } + private static IIdentityServerBuilder AddIdentityServer(IServiceCollection services, AbpIdentityServerBuilderOptions abpIdentityServerBuilderOptions) + { + services.Configure(options => + { + options.Events.RaiseErrorEvents = true; + options.Events.RaiseInformationEvents = true; + options.Events.RaiseFailureEvents = true; + options.Events.RaiseSuccessEvents = true; + }); + + var identityServerBuilder = services.AddIdentityServerBuilder() + .AddRequiredPlatformServices() + .AddCoreServices() + .AddDefaultEndpoints() + .AddPluggableServices() + .AddValidators() + .AddResponseGenerators() + .AddDefaultSecretParsers() + .AddDefaultSecretValidators(); + + if (abpIdentityServerBuilderOptions.AddIdentityServerCookieAuthentication) + { + identityServerBuilder.AddCookieAuthentication(); + } + + // provide default in-memory implementation, not suitable for most production scenarios + identityServerBuilder.AddInMemoryPersistedGrants(); + + return identityServerBuilder; + } + public override void PostConfigureServices(ServiceConfigurationContext context) { OneTimeRunner.Run(() => diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpWildcardSubdomainCorsPolicyService.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpWildcardSubdomainCorsPolicyService.cs index 82658ceccd..32d2d1eb73 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpWildcardSubdomainCorsPolicyService.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpWildcardSubdomainCorsPolicyService.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using IdentityServer4.Configuration; using Microsoft.Extensions.Options; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; using Volo.Abp.Text.Formatting; @@ -13,7 +14,7 @@ public class AbpWildcardSubdomainCorsPolicyService : AbpCorsPolicyService { public AbpWildcardSubdomainCorsPolicyService( IDistributedCache cache, - IHybridServiceScopeFactory hybridServiceScopeFactory, + IServiceScopeFactory hybridServiceScopeFactory, IOptions options) : base(cache, hybridServiceScopeFactory, options) { diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs index 77181a8b8b..cf69fda91a 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AspNetIdentity/AbpResourceOwnerPasswordValidator.cs @@ -32,7 +32,7 @@ public class AbpResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } protected ILogger> Logger { get; } protected IStringLocalizer Localizer { get; } - protected IHybridServiceScopeFactory ServiceScopeFactory { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } protected AbpIdentityOptions AbpIdentityOptions { get; } protected IOptions IdentityOptions { get; } @@ -43,7 +43,7 @@ public class AbpResourceOwnerPasswordValidator : IResourceOwnerPasswordValidator ILogger> logger, IStringLocalizer localizer, IOptions abpIdentityOptions, - IHybridServiceScopeFactory serviceScopeFactory, + IServiceScopeFactory serviceScopeFactory, IOptions identityOptions) { UserManager = userManager; diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs index 51862d7597..f9988a377e 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs @@ -31,6 +31,7 @@ public class ResourceStore : IResourceStore protected IDistributedCache IdentityResourceCache { get; } protected IDistributedCache ApiScopeCache { get; } protected IDistributedCache ApiResourceCache { get; } + protected IDistributedCache> ApiResourcesCache { get; } protected IDistributedCache ResourcesCache { get; } protected IdentityServerOptions Options { get; } @@ -42,6 +43,7 @@ public class ResourceStore : IResourceStore IDistributedCache identityResourceCache, IDistributedCache apiScopeCache, IDistributedCache apiResourceCache, + IDistributedCache> apiResourcesCache, IDistributedCache resourcesCache, IOptions options) { @@ -52,6 +54,7 @@ public class ResourceStore : IResourceStore IdentityResourceCache = identityResourceCache; ApiScopeCache = apiScopeCache; ApiResourceCache = apiResourceCache; + ApiResourcesCache = apiResourcesCache; ResourcesCache = resourcesCache; Options = options.Value; } @@ -91,16 +94,22 @@ public class ResourceStore : IResourceStore ///
public virtual async Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames) { - return (await GetCacheItemsAsync( - ApiResourceCache, - scopeNames, - async keys => await ApiResourceRepository.GetListByScopesAsync(keys, includeDetails: true), - (models, cacheKeyPrefix) => - { - return models - .Select(model => model.Scopes.Select(scope => new KeyValuePair(AddCachePrefix(scope, cacheKeyPrefix), model)).ToList()) - .Where(scopes => scopes.Any()).Cast>>().ToList(); - }, ApiResourceScopeNameCacheKeyPrefix)).DistinctBy(x => x.Name); + var cacheItems = await ApiResourcesCache.GetManyAsync(AddCachePrefix(scopeNames, ApiResourceScopeNameCacheKeyPrefix)); + if (cacheItems.All(x => x.Value != null)) + { + return cacheItems.SelectMany(x => x.Value).DistinctBy(x => x.Name); + } + + var otherKeys = RemoveCachePrefix(cacheItems.Where(x => x.Value == null).Select(x => x.Key), ApiResourceScopeNameCacheKeyPrefix).ToArray(); + var otherModels = ObjectMapper.Map, List>(await ApiResourceRepository.GetListByScopesAsync(otherKeys, includeDetails: true)); + + var otherCacheItems = otherKeys.Select(otherKey => new KeyValuePair>(AddCachePrefix(otherKey, ApiResourceScopeNameCacheKeyPrefix), otherModels)).ToList(); + await ApiResourcesCache.SetManyAsync(otherCacheItems, new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = Options.Caching.ClientStoreExpiration + }); + + return cacheItems.Where(x => x.Value != null).SelectMany(x => x.Value).Concat(otherModels).DistinctBy(x => x.Name); } /// diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs index 6d0b8a3b19..a464fcc75f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; @@ -28,6 +29,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas private readonly IDistributedCache _clientCache; private readonly IDistributedCache _identityResourceCache; + private readonly IDistributedCache> _apiResourcesCache; private readonly IDistributedCache _apiResourceCache; private readonly IDistributedCache _apiScopeCache; private readonly IDistributedCache _resourceCache; @@ -46,6 +48,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas _clientCache = GetRequiredService>(); _identityResourceCache = GetRequiredService>(); + _apiResourcesCache = GetRequiredService>>(); _apiResourceCache = GetRequiredService>(); _apiScopeCache = GetRequiredService>(); _resourceCache = GetRequiredService>(); @@ -93,9 +96,9 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas (await _apiResourceCache.GetAsync(newApiResource2)).ShouldBeNull(); //FindApiResourcesByScopeNameAsync - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { testApiResourceApiScopeName1 }); - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); var testApiResource1 = await _apiResourceRepository.FindByNameAsync(testApiResourceName1); await _apiResourceRepository.DeleteAsync(testApiResource1); diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs index c54c99e88d..27e3b04c5a 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs @@ -51,9 +51,9 @@ public class IdentityResourceStore_Tests : AbpIdentityServerTestBase })).ToList(); //Assert - apiResources.ShouldNotBe(null); + apiResources.ShouldNotBeNull(); - apiResources[0].Scopes.Count.ShouldBe(4); + apiResources.ShouldContain(x => x.Scopes.Contains("Test-ApiResource-ApiScope-Name-1")); } [Fact] diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs index b33b8aa580..20b8ff8689 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs @@ -51,14 +51,14 @@ public class ResourceStore_Cache_Tests : AbpIdentityServerDomainTestBase { var apiResources1 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1" })).ToList(); apiResources1.ShouldNotBeEmpty(); - apiResources1.Count.ShouldBe(1); - apiResources1.First().Name.ShouldBe("Test-ApiResource-Name-1"); + apiResources1.Count.ShouldBe(2); + apiResources1.ShouldContain(x => x.Name == "Test-ApiResource-Name-1"); var apiResources2 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1", "Test-ApiResource-ApiScope-Name-2", nameof(ApiResourceScope.Scope) })).ToList(); apiResources2.ShouldNotBeEmpty(); apiResources2.Count.ShouldBe(2); apiResources2.ShouldContain(x => x.Name == "Test-ApiResource-Name-1"); - apiResources2.ShouldContain(x => x.Name == apiResources1.First().Name); + apiResources2.ShouldContain(x => x.Name == "NewApiResource1"); } [Fact] diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index eaf8aabf58..e6344f9c6f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -87,6 +87,7 @@ public class AbpIdentityServerTestDataBuilder : ITransientDependency apiResource.DisplayName = nameof(apiResource.DisplayName); apiResource.AddScope(nameof(ApiResourceScope.Scope)); + apiResource.AddScope("Test-ApiResource-ApiScope-Name-1"); apiResource.AddUserClaim(nameof(ApiResourceClaim.Type)); apiResource.AddSecret(nameof(ApiResourceSecret.Value)); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs index 49d415c927..1484ea4b52 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.OpenIddict.Controllers; public partial class TokenController { - protected IHybridServiceScopeFactory ServiceScopeFactory => LazyServiceProvider.LazyGetRequiredService(); + protected IServiceScopeFactory ServiceScopeFactory => LazyServiceProvider.LazyGetRequiredService(); protected ITenantConfigurationProvider TenantConfigurationProvider=> LazyServiceProvider.LazyGetRequiredService(); protected IOptions AbpIdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); protected IOptions IdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/hu.json b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/hu.json new file mode 100644 index 0000000000..081bc4bb89 --- /dev/null +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/hu.json @@ -0,0 +1,15 @@ +{ + "culture": "hu", + "texts": { + "TheOpenIDConnectRequestCannotBeRetrieved": "Az OpenID Connect kérés nem kérhető le.", + "TheUserDetailsCannotBbeRetrieved": "A felhasználói adatok nem kérhetők le.", + "TheApplicationDetailsCannotBeFound": "Az alkalmazás részletei nem találhatók.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "A hívó kliens alkalmazással kapcsolatos részletek nem találhatók.", + "TheSpecifiedGrantTypeIsNotImplemented.": "A megadott támogatási típus ({0}) nincs megvalósítva.", + "Authorization": "Engedélyezés", + "DoYouWantToGrantAccessToYourData": "Hozzáférést szeretne adni a(z) {0} számára az adataihoz?", + "ScopesRequested": "Kért hatókörök", + "Accept": "Elfogad", + "Deny": "Tiltás" + } +} \ No newline at end of file diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json index 2952a0352c..6962ebcc4c 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json @@ -4,10 +4,10 @@ "TheOpenIDConnectRequestCannotBeRetrieved": "Não foi possivel recuperar a requisição do OpenID Connect.", "TheUserDetailsCannotBbeRetrieved": "Não foi possivel recuperar os detalhes do usuário.", "TheApplicationDetailsCannotBeFound": "Os detalhes da aplicação não foram encontrados.", - "DetailsConcerningTheCallingClientApplicationCannotBeFound": "Os detalhes relativos ao aplicativo cliente requisitante não firam encontrados.", + "DetailsConcerningTheCallingClientApplicationCannotBeFound": "Os detalhes relativos ao aplicativo cliente requisitante não foram encontrados.", "TheSpecifiedGrantTypeIsNotImplemented.": "O tipo de permissão {0} não está implementando.", "Authorization": "Autorização", - "DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acesse seus dados?", + "DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acessar seus dados?", "ScopesRequested": "Escopo solicitado", "Accept": "Aceitar", "Deny": "Negar" diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionGroupDto.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionGroupDto.cs index a138cd0451..b9cc6d5f90 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionGroupDto.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/PermissionGroupDto.cs @@ -7,6 +7,10 @@ public class PermissionGroupDto public string Name { get; set; } public string DisplayName { get; set; } + + public string DisplayNameKey { get; set; } + + public string DisplayNameResource { get; set; } public List Permissions { get; set; } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/PermissionAppService.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/PermissionAppService.cs index d7d7f28820..9ef60a17e4 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/PermissionAppService.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/PermissionAppService.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using Volo.Abp.Application.Services; using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; using Volo.Abp.SimpleStateChecking; @@ -43,14 +44,9 @@ public class PermissionAppService : ApplicationService, IPermissionAppService var multiTenancySide = CurrentTenant.GetMultiTenancySide(); - foreach (var group in PermissionDefinitionManager.GetGroups()) + foreach (var group in await PermissionDefinitionManager.GetGroupsAsync()) { - var groupDto = new PermissionGroupDto - { - Name = group.Name, - DisplayName = group.DisplayName.Localize(StringLocalizerFactory), - Permissions = new List() - }; + var groupDto = CreatePermissionGroupDto(group); var neededCheckPermissions = new List(); @@ -70,14 +66,9 @@ public class PermissionAppService : ApplicationService, IPermissionAppService continue; } - var grantInfoDtos = neededCheckPermissions.Select(x => new PermissionGrantInfoDto - { - Name = x.Name, - DisplayName = x.DisplayName.Localize(StringLocalizerFactory), - ParentName = x.Parent?.Name, - AllowedProviders = x.Providers, - GrantedProviders = new List() - }).ToList(); + var grantInfoDtos = neededCheckPermissions + .Select(CreatePermissionGrantInfoDto) + .ToList(); var multipleGrantInfo = await PermissionManager.GetAsync(neededCheckPermissions.Select(x => x.Name).ToArray(), providerName, providerKey); @@ -108,6 +99,33 @@ public class PermissionAppService : ApplicationService, IPermissionAppService return result; } + private PermissionGrantInfoDto CreatePermissionGrantInfoDto(PermissionDefinition permission) + { + return new PermissionGrantInfoDto { + Name = permission.Name, + DisplayName = permission.DisplayName?.Localize(StringLocalizerFactory), + ParentName = permission.Parent?.Name, + AllowedProviders = permission.Providers, + GrantedProviders = new List() + }; + } + + private PermissionGroupDto CreatePermissionGroupDto(PermissionGroupDefinition group) + { + var localizableDisplayName = group.DisplayName as LocalizableString; + + return new PermissionGroupDto + { + Name = group.Name, + DisplayName = group.DisplayName?.Localize(StringLocalizerFactory), + DisplayNameKey = localizableDisplayName?.Name, + DisplayNameResource = localizableDisplayName?.ResourceType != null + ? LocalizationResourceNameAttribute.GetName(localizableDisplayName.ResourceType) + : null, + Permissions = new List() + }; + } + public virtual async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) { await CheckProviderPolicy(providerName); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs index b477de008d..b96a1c9d4d 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs @@ -4,7 +4,9 @@ using System.Linq; using System.Threading.Tasks; using Blazorise; using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Components.Web.Configuration; +using Volo.Abp.Localization; using Volo.Abp.PermissionManagement.Localization; namespace Volo.Abp.PermissionManagement.Blazor.Components; @@ -14,6 +16,8 @@ public partial class PermissionManagementModal [Inject] protected IPermissionAppService PermissionAppService { get; set; } [Inject] protected ICurrentApplicationConfigurationCacheResetService CurrentApplicationConfigurationCacheResetService { get; set; } + [Inject] protected IOptions LocalizationOptions { get; set; } + protected Modal _modal; protected string _providerName; diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/hu.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/hu.json index aaf2369adc..8ebdbe7d80 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/hu.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/hu.json @@ -1,10 +1,11 @@ { - "culture": "hu", - "texts": { - "Permissions": "Engedélyek", - "OnlyProviderPermissons": "Csak ez a szolgáltató", - "All": "Összes", - "SelectAllInAllTabs": "Adjon meg minden engedélyt", - "SelectAllInThisTab": "Mindet kiválaszt" - } - } \ No newline at end of file + "culture": "hu", + "texts": { + "Permissions": "Engedélyek", + "OnlyProviderPermissons": "Csak ez a szolgáltató", + "All": "Összes", + "SelectAllInAllTabs": "Adjon meg minden engedélyt", + "SelectAllInThisTab": "Mindet kiválaszt", + "SaveWithoutAnyPermissionsWarningMessage": "Biztos, hogy engedélyek nélkül akar menteni?" + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionDefinitionRecordConsts.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionDefinitionRecordConsts.cs new file mode 100644 index 0000000000..93b1b465c6 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionDefinitionRecordConsts.cs @@ -0,0 +1,15 @@ +namespace Volo.Abp.PermissionManagement; + +public class PermissionDefinitionRecordConsts +{ + /// + /// Default value: 128 + /// + public static int MaxNameLength { get; set; } = 128; + + public static int MaxDisplayNameLength { get; set; } = 256; + + public static int MaxProvidersLength { get; set; } = 128; + + public static int MaxStateCheckersLength { get; set; } = 256; +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs index 38a17340c5..630f5dc72e 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs @@ -2,11 +2,6 @@ public static class PermissionGrantConsts { - /// - /// Default value: 128 - /// - public static int MaxNameLength { get; set; } = 128; - /// /// Default value: 64 /// diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecordConsts.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecordConsts.cs new file mode 100644 index 0000000000..fb26c075b8 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecordConsts.cs @@ -0,0 +1,11 @@ +namespace Volo.Abp.PermissionManagement; + +public class PermissionGroupDefinitionRecordConsts +{ + /// + /// Default value: 128 + /// + public static int MaxNameLength { get; set; } = 128; + + public static int MaxDisplayNameLength { get; set; } = 256; +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo.Abp.PermissionManagement.Domain.csproj b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo.Abp.PermissionManagement.Domain.csproj index d9cc5a058f..f9eb16d965 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo.Abp.PermissionManagement.Domain.csproj +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo.Abp.PermissionManagement.Domain.csproj @@ -23,4 +23,8 @@ + + + + diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs index 6dff7bf663..71b42a20fb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs @@ -1,11 +1,20 @@ -using System.Collections.Generic; +using System; +using System.Threading; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Polly; using Volo.Abp.Authorization; +using Volo.Abp.Authorization.Permissions; using Volo.Abp.Caching; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; using Volo.Abp.Domain; using Volo.Abp.Json; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.PermissionManagement; @@ -16,5 +25,141 @@ namespace Volo.Abp.PermissionManagement; [DependsOn(typeof(AbpJsonModule))] public class AbpPermissionManagementDomainModule : AbpModule { + private readonly CancellationTokenSource _cancellationTokenSource = new(); + public override void ConfigureServices(ServiceConfigurationContext context) + { + if (context.Services.IsDataMigrationEnvironment()) + { + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + } + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); + } + + public override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + InitializeDynamicPermissions(context); + return Task.CompletedTask; + } + + public override Task OnApplicationShutdownAsync(ApplicationShutdownContext context) + { + _cancellationTokenSource.Cancel(); + return Task.CompletedTask; + } + + private void InitializeDynamicPermissions(ApplicationInitializationContext context) + { + var options = context + .ServiceProvider + .GetRequiredService>() + .Value; + + if (!options.SaveStaticPermissionsToDatabase && !options.IsDynamicPermissionStoreEnabled) + { + return; + } + + var rootServiceProvider = context.ServiceProvider.GetRequiredService(); + + Task.Run(async () => + { + using var scope = rootServiceProvider.CreateScope(); + var applicationLifetime = scope.ServiceProvider.GetService(); + var cancellationTokenProvider = scope.ServiceProvider.GetRequiredService(); + var cancellationToken = applicationLifetime?.ApplicationStopping ?? _cancellationTokenSource.Token; + + try + { + using (cancellationTokenProvider.Use(cancellationToken)) + { + if (cancellationTokenProvider.Token.IsCancellationRequested) + { + return; + } + + await SaveStaticPermissionsToDatabaseAsync(options, scope, cancellationTokenProvider); + + if (cancellationTokenProvider.Token.IsCancellationRequested) + { + return; + } + + await PreCacheDynamicPermissionsAsync(options, scope); + } + } + // ReSharper disable once EmptyGeneralCatchClause (No need to log since it is logged above) + catch { } + }); + } + + private async static Task SaveStaticPermissionsToDatabaseAsync( + PermissionManagementOptions options, + IServiceScope scope, + ICancellationTokenProvider cancellationTokenProvider) + { + if (!options.SaveStaticPermissionsToDatabase) + { + return; + } + + await Policy + .Handle() + .WaitAndRetryAsync(8, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt) * 10)) + .ExecuteAsync(async _ => + { + try + { + // ReSharper disable once AccessToDisposedClosure + await scope + .ServiceProvider + .GetRequiredService() + .SaveAsync(); + } + catch (Exception ex) + { + // ReSharper disable once AccessToDisposedClosure + scope.ServiceProvider + .GetService>()? + .LogException(ex); + + throw; // Polly will catch it + } + }, cancellationTokenProvider.Token); + } + + private async static Task PreCacheDynamicPermissionsAsync(PermissionManagementOptions options, IServiceScope scope) + { + if (!options.IsDynamicPermissionStoreEnabled) + { + return; + } + + try + { + // Pre-cache permissions, so first request doesn't wait + await scope + .ServiceProvider + .GetRequiredService() + .GetGroupsAsync(); + } + catch (Exception ex) + { + // ReSharper disable once AccessToDisposedClosure + scope + .ServiceProvider + .GetService>()? + .LogException(ex); + + throw; // It will be cached in InitializeDynamicPermissions + } + } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStore.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStore.cs new file mode 100644 index 0000000000..f2e73cefc0 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStore.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.Options; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Threading; + +namespace Volo.Abp.PermissionManagement; + +[Dependency(ReplaceServices = true)] +public class DynamicPermissionDefinitionStore : IDynamicPermissionDefinitionStore, ITransientDependency +{ + protected IPermissionGroupDefinitionRecordRepository PermissionGroupRepository { get; } + protected IPermissionDefinitionRecordRepository PermissionRepository { get; } + protected IPermissionDefinitionSerializer PermissionDefinitionSerializer { get; } + protected IDynamicPermissionDefinitionStoreInMemoryCache StoreCache { get; } + protected IDistributedCache DistributedCache { get; } + protected IAbpDistributedLock DistributedLock { get; } + public PermissionManagementOptions PermissionManagementOptions { get; } + protected AbpDistributedCacheOptions CacheOptions { get; } + + public DynamicPermissionDefinitionStore( + IPermissionGroupDefinitionRecordRepository permissionGroupRepository, + IPermissionDefinitionRecordRepository permissionRepository, + IPermissionDefinitionSerializer permissionDefinitionSerializer, + IDynamicPermissionDefinitionStoreInMemoryCache storeCache, + IDistributedCache distributedCache, + IOptions cacheOptions, + IOptions permissionManagementOptions, + IAbpDistributedLock distributedLock) + { + PermissionGroupRepository = permissionGroupRepository; + PermissionRepository = permissionRepository; + PermissionDefinitionSerializer = permissionDefinitionSerializer; + StoreCache = storeCache; + DistributedCache = distributedCache; + DistributedLock = distributedLock; + PermissionManagementOptions = permissionManagementOptions.Value; + CacheOptions = cacheOptions.Value; + } + + public virtual async Task GetOrNullAsync(string name) + { + if (!PermissionManagementOptions.IsDynamicPermissionStoreEnabled) + { + return null; + } + + using (await StoreCache.SyncSemaphore.LockAsync()) + { + await EnsureCacheIsUptoDateAsync(); + return StoreCache.GetPermissionOrNull(name); + } + } + + public virtual async Task> GetPermissionsAsync() + { + if (!PermissionManagementOptions.IsDynamicPermissionStoreEnabled) + { + return Array.Empty(); + } + + using (await StoreCache.SyncSemaphore.LockAsync()) + { + await EnsureCacheIsUptoDateAsync(); + return StoreCache.GetPermissions().ToImmutableList(); + } + } + + public virtual async Task> GetGroupsAsync() + { + if (!PermissionManagementOptions.IsDynamicPermissionStoreEnabled) + { + return Array.Empty(); + } + + using (await StoreCache.SyncSemaphore.LockAsync()) + { + await EnsureCacheIsUptoDateAsync(); + return StoreCache.GetGroups().ToImmutableList(); + } + } + + protected virtual async Task EnsureCacheIsUptoDateAsync() + { + if (StoreCache.LastCheckTime.HasValue && + DateTime.Now.Subtract(StoreCache.LastCheckTime.Value).TotalSeconds < 30) + { + /* We get the latest permission with a small delay for optimization */ + return; + } + + var stampInDistributedCache = await GetOrSetStampInDistributedCache(); + + if (stampInDistributedCache == StoreCache.CacheStamp) + { + StoreCache.LastCheckTime = DateTime.Now; + return; + } + + await UpdateInMemoryStoreCache(); + + StoreCache.CacheStamp = stampInDistributedCache; + StoreCache.LastCheckTime = DateTime.Now; + } + + protected virtual async Task UpdateInMemoryStoreCache() + { + var permissionGroupRecords = await PermissionGroupRepository.GetListAsync(); + var permissionRecords = await PermissionRepository.GetListAsync(); + + await StoreCache.FillAsync(permissionGroupRecords, permissionRecords); + } + + protected virtual async Task GetOrSetStampInDistributedCache() + { + var cacheKey = GetCommonStampCacheKey(); + + var stampInDistributedCache = await DistributedCache.GetStringAsync(cacheKey); + if (stampInDistributedCache != null) + { + return stampInDistributedCache; + } + + await using (var commonLockHandle = await DistributedLock + .TryAcquireAsync(GetCommonDistributedLockKey(), TimeSpan.FromMinutes(2))) + { + if (commonLockHandle == null) + { + /* This request will fail */ + throw new AbpException( + "Could not acquire distributed lock for permission definition common stamp check!" + ); + } + + stampInDistributedCache = await DistributedCache.GetStringAsync(cacheKey); + if (stampInDistributedCache != null) + { + return stampInDistributedCache; + } + + stampInDistributedCache = Guid.NewGuid().ToString(); + + await DistributedCache.SetStringAsync( + cacheKey, + stampInDistributedCache, + new DistributedCacheEntryOptions + { + SlidingExpiration = TimeSpan.FromDays(30) //TODO: Make it configurable? + } + ); + } + + return stampInDistributedCache; + } + + protected virtual string GetCommonStampCacheKey() + { + return $"{CacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp"; + } + + protected virtual string GetCommonDistributedLockKey() + { + return $"{CacheOptions.KeyPrefix}_Common_AbpPermissionUpdateLock"; + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStoreInMemoryCache.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStoreInMemoryCache.cs new file mode 100644 index 0000000000..3b09c922dc --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/DynamicPermissionDefinitionStoreInMemoryCache.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Localization; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.PermissionManagement; + +public class DynamicPermissionDefinitionStoreInMemoryCache : + IDynamicPermissionDefinitionStoreInMemoryCache, + ISingletonDependency +{ + public string CacheStamp { get; set; } + + protected IDictionary PermissionGroupDefinitions { get; } + protected IDictionary PermissionDefinitions { get; } + protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } + protected ILocalizableStringSerializer LocalizableStringSerializer { get; } + + public SemaphoreSlim SyncSemaphore { get; } = new(1, 1); + + public DateTime? LastCheckTime { get; set; } + + public DynamicPermissionDefinitionStoreInMemoryCache( + ISimpleStateCheckerSerializer stateCheckerSerializer, + ILocalizableStringSerializer localizableStringSerializer) + { + StateCheckerSerializer = stateCheckerSerializer; + LocalizableStringSerializer = localizableStringSerializer; + + PermissionGroupDefinitions = new Dictionary(); + PermissionDefinitions = new Dictionary(); + } + + public Task FillAsync( + List permissionGroupRecords, + List permissionRecords) + { + PermissionGroupDefinitions.Clear(); + PermissionDefinitions.Clear(); + + var context = new PermissionDefinitionContext(null); + + foreach (var permissionGroupRecord in permissionGroupRecords) + { + var permissionGroup = context.AddGroup( + permissionGroupRecord.Name, + LocalizableStringSerializer.Deserialize(permissionGroupRecord.DisplayName) + ); + + PermissionGroupDefinitions[permissionGroup.Name] = permissionGroup; + + foreach (var property in permissionGroupRecord.ExtraProperties) + { + permissionGroup[property.Key] = property.Value; + } + + var permissionRecordsInThisGroup = permissionRecords + .Where(p => p.GroupName == permissionGroup.Name); + + foreach (var permissionRecord in permissionRecordsInThisGroup.Where(x => x.ParentName == null)) + { + AddPermissionRecursively(permissionGroup, permissionRecord, permissionRecords); + } + } + + return Task.CompletedTask; + } + + public PermissionDefinition GetPermissionOrNull(string name) + { + return PermissionDefinitions.GetOrDefault(name); + } + + public IReadOnlyList GetPermissions() + { + return PermissionDefinitions.Values.ToList(); + } + + public IReadOnlyList GetGroups() + { + return PermissionGroupDefinitions.Values.ToList(); + } + + private void AddPermissionRecursively(ICanAddChildPermission permissionContainer, + PermissionDefinitionRecord permissionRecord, + List allPermissionRecords) + { + var permission = permissionContainer.AddPermission( + permissionRecord.Name, + LocalizableStringSerializer.Deserialize(permissionRecord.DisplayName), + permissionRecord.MultiTenancySide, + permissionRecord.IsEnabled + ); + + PermissionDefinitions[permission.Name] = permission; + + if (!permissionRecord.Providers.IsNullOrWhiteSpace()) + { + permission.Providers.AddRange(permissionRecord.Providers.Split(',')); + } + + if (!permissionRecord.StateCheckers.IsNullOrWhiteSpace()) + { + var checkers = StateCheckerSerializer + .DeserializeArray( + permissionRecord.StateCheckers, + permission + ); + permission.StateCheckers.AddRange(checkers); + } + + foreach (var property in permissionRecord.ExtraProperties) + { + permission[property.Key] = property.Value; + } + + foreach (var subPermission in allPermissionRecords.Where(p => p.ParentName == permissionRecord.Name)) + { + AddPermissionRecursively(permission, subPermission, allPermissionRecords); + } + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IDynamicPermissionDefinitionStoreInMemoryCache.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IDynamicPermissionDefinitionStoreInMemoryCache.cs new file mode 100644 index 0000000000..2dab588ebd --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IDynamicPermissionDefinitionStoreInMemoryCache.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; + +namespace Volo.Abp.PermissionManagement; + +public interface IDynamicPermissionDefinitionStoreInMemoryCache +{ + string CacheStamp { get; set; } + + SemaphoreSlim SyncSemaphore { get; } + + DateTime? LastCheckTime { get; set; } + + Task FillAsync( + List permissionGroupRecords, + List permissionRecords); + + PermissionDefinition GetPermissionOrNull(string name); + + IReadOnlyList GetPermissions(); + + IReadOnlyList GetGroups(); +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionRecordRepository.cs new file mode 100644 index 0000000000..e332d8483d --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionRecordRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace Volo.Abp.PermissionManagement; + +public interface IPermissionDefinitionRecordRepository : IBasicRepository +{ + Task FindByNameAsync( + string name, + CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionSerializer.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionSerializer.cs new file mode 100644 index 0000000000..8ed09a4380 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionDefinitionSerializer.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Volo.Abp.Authorization.Permissions; + +namespace Volo.Abp.PermissionManagement; + +public interface IPermissionDefinitionSerializer +{ + Task<(PermissionGroupDefinitionRecord[], PermissionDefinitionRecord[])> + SerializeAsync(IEnumerable permissionGroups); + + Task SerializeAsync( + PermissionGroupDefinition permissionGroup); + + Task SerializeAsync( + PermissionDefinition permission, + [CanBeNull] PermissionGroupDefinition permissionGroup); +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGroupDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGroupDefinitionRecordRepository.cs new file mode 100644 index 0000000000..984adbe72d --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IPermissionGroupDefinitionRecordRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Volo.Abp.PermissionManagement; + +public interface IPermissionGroupDefinitionRecordRepository : IBasicRepository +{ + +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IStaticPermissionSaver.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IStaticPermissionSaver.cs new file mode 100644 index 0000000000..5c91636c3d --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/IStaticPermissionSaver.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.PermissionManagement; + +public interface IStaticPermissionSaver +{ + Task SaveAsync(); +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeedContributor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeedContributor.cs index d0a98eb593..71570aafce 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeedContributor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeedContributor.cs @@ -23,17 +23,16 @@ public class PermissionDataSeedContributor : IDataSeedContributor, ITransientDep CurrentTenant = currentTenant; } - public virtual Task SeedAsync(DataSeedContext context) + public virtual async Task SeedAsync(DataSeedContext context) { var multiTenancySide = CurrentTenant.GetMultiTenancySide(); - var permissionNames = PermissionDefinitionManager - .GetPermissions() + var permissionNames = (await PermissionDefinitionManager.GetPermissionsAsync()) .Where(p => p.MultiTenancySide.HasFlag(multiTenancySide)) .Where(p => !p.Providers.Any() || p.Providers.Contains(RolePermissionValueProvider.ProviderName)) .Select(p => p.Name) .ToArray(); - return PermissionDataSeeder.SeedAsync( + await PermissionDataSeeder.SeedAsync( RolePermissionValueProvider.ProviderName, "admin", permissionNames, diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionRecord.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionRecord.cs new file mode 100644 index 0000000000..2ba9ffa26a --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionRecord.cs @@ -0,0 +1,175 @@ +using System; +using System.Text.Json.Serialization; +using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.PermissionManagement; + +public class PermissionDefinitionRecord : BasicAggregateRoot, IHasExtraProperties +{ + /* Ignoring Id because it is different whenever we create an instance of + * this class, and we are using Json Serialize, than Hash to understand + * if permission definitions have changed (in StaticPermissionSaver.CalculateHash()). + */ + [JsonIgnore] + public override Guid Id { get; protected set; } + + public string GroupName { get; set; } + + public string Name { get; set; } + + public string ParentName { get; set; } + + public string DisplayName { get; set; } + + public bool IsEnabled { get; set; } + + public MultiTenancySides MultiTenancySide { get; set; } + + /// + /// Comma separated list of provider names. + /// + public string Providers { get; set; } + + /// + /// Serialized string to store info about the state checkers. + /// + public string StateCheckers { get; set; } + + public ExtraPropertyDictionary ExtraProperties { get; protected set; } + + public PermissionDefinitionRecord() + { + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } + + public PermissionDefinitionRecord( + Guid id, + string groupName, + string name, + string parentName, + string displayName, + bool isEnabled = true, + MultiTenancySides multiTenancySide = MultiTenancySides.Both, + string providers = null, + string stateCheckers = null) + : base(id) + { + GroupName = Check.NotNullOrWhiteSpace(groupName, nameof(groupName), PermissionGroupDefinitionRecordConsts.MaxNameLength); + Name = Check.NotNullOrWhiteSpace(name, nameof(name), PermissionDefinitionRecordConsts.MaxNameLength); + ParentName = Check.Length(parentName, nameof(parentName), PermissionDefinitionRecordConsts.MaxNameLength); + DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), PermissionDefinitionRecordConsts.MaxDisplayNameLength); + IsEnabled = isEnabled; + MultiTenancySide = multiTenancySide; + Providers = providers; + StateCheckers = stateCheckers; + + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } + + public bool HasSameData(PermissionDefinitionRecord otherRecord) + { + if (Name != otherRecord.Name) + { + return false; + } + + if (GroupName != otherRecord.GroupName) + { + return false; + } + + if (ParentName != otherRecord.ParentName) + { + return false; + } + + if (DisplayName != otherRecord.DisplayName) + { + return false; + } + + if (IsEnabled != otherRecord.IsEnabled) + { + return false; + } + + if (MultiTenancySide != otherRecord.MultiTenancySide) + { + return false; + } + + if (Providers != otherRecord.Providers) + { + return false; + } + + if (StateCheckers != otherRecord.StateCheckers) + { + return false; + } + + if (!this.HasSameExtraProperties(otherRecord)) + { + return false; + } + + return true; + } + + public void Patch(PermissionDefinitionRecord otherRecord) + { + if (Name != otherRecord.Name) + { + Name = otherRecord.Name; + } + + if (GroupName != otherRecord.GroupName) + { + GroupName = otherRecord.GroupName; + } + + if (ParentName != otherRecord.ParentName) + { + ParentName = otherRecord.ParentName; + } + + if (DisplayName != otherRecord.DisplayName) + { + DisplayName = otherRecord.DisplayName; + } + + if (IsEnabled != otherRecord.IsEnabled) + { + IsEnabled = otherRecord.IsEnabled; + } + + if (MultiTenancySide != otherRecord.MultiTenancySide) + { + MultiTenancySide = otherRecord.MultiTenancySide; + } + + if (Providers != otherRecord.Providers) + { + Providers = otherRecord.Providers; + } + + if (StateCheckers != otherRecord.StateCheckers) + { + StateCheckers = otherRecord.StateCheckers; + } + + if (!this.HasSameExtraProperties(otherRecord)) + { + this.ExtraProperties.Clear(); + + foreach (var property in otherRecord.ExtraProperties) + { + this.ExtraProperties.Add(property.Key, property.Value); + } + } + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer.cs new file mode 100644 index 0000000000..8e63342502 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer.cs @@ -0,0 +1,106 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.Localization; +using Volo.Abp.SimpleStateChecking; + +namespace Volo.Abp.PermissionManagement; + +public class PermissionDefinitionSerializer : IPermissionDefinitionSerializer, ITransientDependency +{ + protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } + protected IGuidGenerator GuidGenerator { get; } + protected ILocalizableStringSerializer LocalizableStringSerializer { get; } + + public PermissionDefinitionSerializer( + IGuidGenerator guidGenerator, + ISimpleStateCheckerSerializer stateCheckerSerializer, + ILocalizableStringSerializer localizableStringSerializer) + { + StateCheckerSerializer = stateCheckerSerializer; + LocalizableStringSerializer = localizableStringSerializer; + GuidGenerator = guidGenerator; + } + + public async Task<(PermissionGroupDefinitionRecord[], PermissionDefinitionRecord[])> + SerializeAsync(IEnumerable permissionGroups) + { + var permissionGroupRecords = new List(); + var permissionRecords = new List(); + + foreach (var permissionGroup in permissionGroups) + { + permissionGroupRecords.Add(await SerializeAsync(permissionGroup)); + + foreach (var permission in permissionGroup.GetPermissionsWithChildren()) + { + permissionRecords.Add(await SerializeAsync(permission, permissionGroup)); + } + } + + return (permissionGroupRecords.ToArray(), permissionRecords.ToArray()); + } + + public Task SerializeAsync(PermissionGroupDefinition permissionGroup) + { + using (CultureHelper.Use(CultureInfo.InvariantCulture)) + { + var permissionGroupRecord = new PermissionGroupDefinitionRecord( + GuidGenerator.Create(), + permissionGroup.Name, + LocalizableStringSerializer.Serialize(permissionGroup.DisplayName) + ); + + foreach (var property in permissionGroup.Properties) + { + permissionGroupRecord.SetProperty(property.Key, property.Value); + } + + return Task.FromResult(permissionGroupRecord); + } + } + + public Task SerializeAsync( + PermissionDefinition permission, + PermissionGroupDefinition permissionGroup) + { + using (CultureHelper.Use(CultureInfo.InvariantCulture)) + { + var permissionRecord = new PermissionDefinitionRecord( + GuidGenerator.Create(), + permissionGroup?.Name, + permission.Name, + permission.Parent?.Name, + LocalizableStringSerializer.Serialize(permission.DisplayName), + permission.IsEnabled, + permission.MultiTenancySide, + SerializeProviders(permission.Providers), + SerializeStateCheckers(permission.StateCheckers) + ); + + foreach (var property in permission.Properties) + { + permissionRecord.SetProperty(property.Key, property.Value); + } + + return Task.FromResult(permissionRecord); + } + } + + protected virtual string SerializeProviders(ICollection providers) + { + return providers.Any() + ? providers.JoinAsString(",") + : null; + } + + protected virtual string SerializeStateCheckers(List> stateCheckers) + { + return StateCheckerSerializer.Serialize(stateCheckers); + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecord.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecord.cs new file mode 100644 index 0000000000..f93bf57e21 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionGroupDefinitionRecord.cs @@ -0,0 +1,84 @@ +using System; +using System.Text.Json.Serialization; +using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; + +namespace Volo.Abp.PermissionManagement; + +public class PermissionGroupDefinitionRecord : BasicAggregateRoot, IHasExtraProperties +{ + /* Ignoring Id because it is different whenever we create an instance of + * this class, and we are using Json Serialize, than Hash to understand + * if permission definitions have changed (in StaticPermissionSaver.CalculateHash()). + */ + [JsonIgnore] + public override Guid Id { get; protected set; } + + public string Name { get; set; } + + public string DisplayName { get; set; } + + public ExtraPropertyDictionary ExtraProperties { get; protected set; } + + public PermissionGroupDefinitionRecord() + { + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } + + public PermissionGroupDefinitionRecord( + Guid id, + string name, + string displayName) + : base(id) + { + Name = Check.NotNullOrWhiteSpace(name, nameof(name), PermissionGroupDefinitionRecordConsts.MaxNameLength); + DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), PermissionGroupDefinitionRecordConsts.MaxDisplayNameLength);; + + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } + + public bool HasSameData(PermissionGroupDefinitionRecord otherRecord) + { + if (Name != otherRecord.Name) + { + return false; + } + + if (DisplayName != otherRecord.DisplayName) + { + return false; + } + + if (!this.HasSameExtraProperties(otherRecord)) + { + return false; + } + + return true; + } + + public void Patch(PermissionGroupDefinitionRecord otherRecord) + { + if (Name != otherRecord.Name) + { + Name = otherRecord.Name; + } + + if (DisplayName != otherRecord.DisplayName) + { + DisplayName = otherRecord.DisplayName; + } + + if (!this.HasSameExtraProperties(otherRecord)) + { + this.ExtraProperties.Clear(); + + foreach (var property in otherRecord.ExtraProperties) + { + this.ExtraProperties.Add(property.Key, property.Value); + } + } + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManagementOptions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManagementOptions.cs index 15da755a33..489ae26e3d 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManagementOptions.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManagementOptions.cs @@ -9,6 +9,16 @@ public class PermissionManagementOptions public Dictionary ProviderPolicies { get; } + /// + /// Default: true. + /// + public bool SaveStaticPermissionsToDatabase { get; set; } = true; + + /// + /// Default: false. + /// + public bool IsDynamicPermissionStoreEnabled { get; set; } + public PermissionManagementOptions() { ManagementProviders = new TypeList(); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManager.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManager.cs index 2e709c49c2..b664e5c92d 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManager.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionManager.cs @@ -62,18 +62,62 @@ public class PermissionManager : IPermissionManager, ISingletonDependency public virtual async Task GetAsync(string permissionName, string providerName, string providerKey) { - return await GetInternalAsync(PermissionDefinitionManager.Get(permissionName), providerName, providerKey); + var permission = await PermissionDefinitionManager.GetOrNullAsync(permissionName); + if (permission == null) + { + return new PermissionWithGrantedProviders(permissionName, false); + } + + return await GetInternalAsync( + permission, + providerName, + providerKey + ); } - public virtual async Task GetAsync(string[] permissionNames, string providerName, string providerKey) + public virtual async Task GetAsync( + string[] permissionNames, + string providerName, + string providerKey) { - var permissionDefinitions = permissionNames.Select(x => PermissionDefinitionManager.Get(x)).ToArray(); - return await GetInternalAsync(permissionDefinitions, providerName, providerKey); + var permissions = new List(); + var undefinedPermissions = new List(); + + foreach (var permissionName in permissionNames) + { + var permission = await PermissionDefinitionManager.GetOrNullAsync(permissionName); + if (permission != null) + { + permissions.Add(permission); + } + else + { + undefinedPermissions.Add(permissionName); + } + } + + if (!permissions.Any()) + { + return new MultiplePermissionWithGrantedProviders(undefinedPermissions.ToArray()); + } + + var result = await GetInternalAsync( + permissions.ToArray(), + providerName, + providerKey + ); + + foreach (var undefinedPermission in undefinedPermissions) + { + result.Result.Add(new PermissionWithGrantedProviders(undefinedPermission, false)); + } + + return result; } public virtual async Task> GetAllAsync(string providerName, string providerKey) { - var permissionDefinitions = PermissionDefinitionManager.GetPermissions().ToArray(); + var permissionDefinitions = (await PermissionDefinitionManager.GetPermissionsAsync()).ToArray(); var multiplePermissionWithGrantedProviders = await GetInternalAsync(permissionDefinitions, providerName, providerKey); @@ -83,7 +127,13 @@ public class PermissionManager : IPermissionManager, ISingletonDependency public virtual async Task SetAsync(string permissionName, string providerName, string providerKey, bool isGranted) { - var permission = PermissionDefinitionManager.Get(permissionName); + var permission = await PermissionDefinitionManager.GetOrNullAsync(permissionName); + if (permission == null) + { + /* Silently ignore undefined permissions, + maybe they were removed from dynamic permission definition store */ + return; + } if (!permission.IsEnabled || !await SimpleStateCheckerManager.IsEnabledAsync(permission)) { @@ -146,14 +196,24 @@ public class PermissionManager : IPermissionManager, ISingletonDependency } } - protected virtual async Task GetInternalAsync(PermissionDefinition permission, string providerName, string providerKey) + protected virtual async Task GetInternalAsync( + PermissionDefinition permission, + string providerName, + string providerKey) { - var multiplePermissionWithGrantedProviders = await GetInternalAsync(new PermissionDefinition[] { permission }, providerName, providerKey); + var multiplePermissionWithGrantedProviders = await GetInternalAsync( + new[] { permission }, + providerName, + providerKey + ); return multiplePermissionWithGrantedProviders.Result.First(); } - protected virtual async Task GetInternalAsync(PermissionDefinition[] permissions, string providerName, string providerKey) + protected virtual async Task GetInternalAsync( + PermissionDefinition[] permissions, + string providerName, + string providerKey) { var permissionNames = permissions.Select(x => x.Name).ToArray(); var multiplePermissionWithGrantedProviders = new MultiplePermissionWithGrantedProviders(permissionNames); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs index 5dd4e14ed0..6eed394a31 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionStore.cs @@ -67,7 +67,7 @@ public class PermissionStore : IPermissionStore, ITransientDependency string currentName, PermissionGrantCacheItem currentCacheItem) { - var permissions = PermissionDefinitionManager.GetPermissions(); + var permissions = await PermissionDefinitionManager.GetPermissionsAsync(); Logger.LogDebug($"Getting all granted permissions from the repository for this provider name,key: {providerName},{providerKey}"); @@ -169,7 +169,8 @@ public class PermissionStore : IPermissionStore, ITransientDependency string providerKey, List notCacheKeys) { - var permissions = PermissionDefinitionManager.GetPermissions().Where(x => notCacheKeys.Any(k => GetPermissionNameFormCacheKeyOrNull(k) == x.Name)).ToList(); + var permissions = (await PermissionDefinitionManager.GetPermissionsAsync()) + .Where(x => notCacheKeys.Any(k => GetPermissionNameFormCacheKeyOrNull(k) == x.Name)).ToList(); Logger.LogDebug($"Getting not cache granted permissions from the repository for this provider name,key: {providerName},{providerKey}"); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/StaticPermissionSaver.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/StaticPermissionSaver.cs new file mode 100644 index 0000000000..ba0be474f8 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/StaticPermissionSaver.cs @@ -0,0 +1,294 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.Options; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Threading; +using Volo.Abp.Uow; + +namespace Volo.Abp.PermissionManagement; + +public class StaticPermissionSaver : IStaticPermissionSaver, ITransientDependency +{ + protected IStaticPermissionDefinitionStore StaticStore { get; } + protected IPermissionGroupDefinitionRecordRepository PermissionGroupRepository { get; } + protected IPermissionDefinitionRecordRepository PermissionRepository { get; } + protected IPermissionDefinitionSerializer PermissionSerializer { get; } + protected IDistributedCache Cache { get; } + protected IApplicationNameAccessor ApplicationNameAccessor { get; } + protected IAbpDistributedLock DistributedLock { get; } + protected AbpPermissionOptions PermissionOptions { get; } + protected ICancellationTokenProvider CancellationTokenProvider { get; } + protected AbpDistributedCacheOptions CacheOptions { get; } + + public StaticPermissionSaver( + IStaticPermissionDefinitionStore staticStore, + IPermissionGroupDefinitionRecordRepository permissionGroupRepository, + IPermissionDefinitionRecordRepository permissionRepository, + IPermissionDefinitionSerializer permissionSerializer, + IDistributedCache cache, + IOptions cacheOptions, + IApplicationNameAccessor applicationNameAccessor, + IAbpDistributedLock distributedLock, + IOptions permissionOptions, + ICancellationTokenProvider cancellationTokenProvider) + { + StaticStore = staticStore; + PermissionGroupRepository = permissionGroupRepository; + PermissionRepository = permissionRepository; + PermissionSerializer = permissionSerializer; + Cache = cache; + ApplicationNameAccessor = applicationNameAccessor; + DistributedLock = distributedLock; + CancellationTokenProvider = cancellationTokenProvider; + PermissionOptions = permissionOptions.Value; + CacheOptions = cacheOptions.Value; + } + + [UnitOfWork] + public virtual async Task SaveAsync() + { + await using var applicationLockHandle = await DistributedLock.TryAcquireAsync( + GetApplicationDistributedLockKey() + ); + + if (applicationLockHandle == null) + { + /* Another application instance is already doing it */ + return; + } + + /* NOTE: This can be further optimized by using 4 cache values for: + * Groups, permissions, deleted groups and deleted permissions. + * But the code would be more complex. This is enough for now. + */ + + var cacheKey = GetApplicationHashCacheKey(); + var cachedHash = await Cache.GetStringAsync(cacheKey, CancellationTokenProvider.Token); + + var (permissionGroupRecords, permissionRecords) = await PermissionSerializer.SerializeAsync( + await StaticStore.GetGroupsAsync() + ); + + var currentHash = CalculateHash( + permissionGroupRecords, + permissionRecords, + PermissionOptions.DeletedPermissionGroups, + PermissionOptions.DeletedPermissions + ); + + if (cachedHash == currentHash) + { + return; + } + + await using (var commonLockHandle = await DistributedLock.TryAcquireAsync( + GetCommonDistributedLockKey(), + TimeSpan.FromMinutes(5))) + { + if (commonLockHandle == null) + { + /* It will re-try */ + throw new AbpException("Could not acquire distributed lock for saving static permissions!"); + } + + var hasChangesInGroups = await UpdateChangedPermissionGroupsAsync(permissionGroupRecords); + var hasChangesInPermissions = await UpdateChangedPermissionsAsync(permissionRecords); + + if (hasChangesInGroups ||hasChangesInPermissions) + { + await Cache.SetStringAsync( + GetCommonStampCacheKey(), + Guid.NewGuid().ToString(), + new DistributedCacheEntryOptions { + SlidingExpiration = TimeSpan.FromDays(30) //TODO: Make it configurable? + }, + CancellationTokenProvider.Token + ); + } + } + + await Cache.SetStringAsync( + cacheKey, + currentHash, + new DistributedCacheEntryOptions { + SlidingExpiration = TimeSpan.FromDays(30) //TODO: Make it configurable? + }, + CancellationTokenProvider.Token + ); + } + + private async Task UpdateChangedPermissionGroupsAsync( + IEnumerable permissionGroupRecords) + { + var newRecords = new List(); + var changedRecords = new List(); + + var permissionGroupRecordsInDatabase = (await PermissionGroupRepository.GetListAsync()) + .ToDictionary(x => x.Name); + + foreach (var permissionGroupRecord in permissionGroupRecords) + { + var permissionGroupRecordInDatabase = permissionGroupRecordsInDatabase.GetOrDefault(permissionGroupRecord.Name); + if (permissionGroupRecordInDatabase == null) + { + /* New group */ + newRecords.Add(permissionGroupRecord); + continue; + } + + if (permissionGroupRecord.HasSameData(permissionGroupRecordInDatabase)) + { + /* Not changed */ + continue; + } + + /* Changed */ + permissionGroupRecordInDatabase.Patch(permissionGroupRecord); + changedRecords.Add(permissionGroupRecordInDatabase); + } + + /* Deleted */ + var deletedRecords = PermissionOptions.DeletedPermissionGroups.Any() + ? permissionGroupRecordsInDatabase.Values + .Where(x => PermissionOptions.DeletedPermissionGroups.Contains(x.Name)) + .ToArray() + : Array.Empty(); + + if (newRecords.Any()) + { + await PermissionGroupRepository.InsertManyAsync(newRecords); + } + + if (changedRecords.Any()) + { + await PermissionGroupRepository.UpdateManyAsync(changedRecords); + } + + if (deletedRecords.Any()) + { + await PermissionGroupRepository.DeleteManyAsync(deletedRecords); + } + + return newRecords.Any() || changedRecords.Any() || deletedRecords.Any(); + } + + private async Task UpdateChangedPermissionsAsync( + IEnumerable permissionRecords) + { + var newRecords = new List(); + var changedRecords = new List(); + + var permissionRecordsInDatabase = (await PermissionRepository.GetListAsync()) + .ToDictionary(x => x.Name); + + foreach (var permissionRecord in permissionRecords) + { + var permissionRecordInDatabase = permissionRecordsInDatabase.GetOrDefault(permissionRecord.Name); + if (permissionRecordInDatabase == null) + { + /* New group */ + newRecords.Add(permissionRecord); + continue; + } + + if (permissionRecord.HasSameData(permissionRecordInDatabase)) + { + /* Not changed */ + continue; + } + + /* Changed */ + permissionRecordInDatabase.Patch(permissionRecord); + changedRecords.Add(permissionRecordInDatabase); + } + + /* Deleted */ + var deletedRecords = new List(); + + if (PermissionOptions.DeletedPermissions.Any()) + { + deletedRecords.AddRange( + permissionRecordsInDatabase.Values + .Where(x => PermissionOptions.DeletedPermissions.Contains(x.Name)) + ); + } + + if (PermissionOptions.DeletedPermissionGroups.Any()) + { + deletedRecords.AddIfNotContains( + permissionRecordsInDatabase.Values + .Where(x => PermissionOptions.DeletedPermissionGroups.Contains(x.GroupName)) + ); + } + + if (newRecords.Any()) + { + await PermissionRepository.InsertManyAsync(newRecords); + } + + if (changedRecords.Any()) + { + await PermissionRepository.UpdateManyAsync(changedRecords); + } + + if (deletedRecords.Any()) + { + await PermissionRepository.DeleteManyAsync(deletedRecords); + } + + return newRecords.Any() || changedRecords.Any() || deletedRecords.Any(); + } + + private string GetApplicationDistributedLockKey() + { + return $"{CacheOptions.KeyPrefix}_{ApplicationNameAccessor.ApplicationName}_AbpPermissionUpdateLock"; + } + + private string GetCommonDistributedLockKey() + { + return $"{CacheOptions.KeyPrefix}_Common_AbpPermissionUpdateLock"; + } + + private string GetApplicationHashCacheKey() + { + return $"{CacheOptions.KeyPrefix}_{ApplicationNameAccessor.ApplicationName}_AbpPermissionsHash"; + } + + private string GetCommonStampCacheKey() + { + return $"{CacheOptions.KeyPrefix}_AbpInMemoryPermissionCacheStamp"; + } + + private static string CalculateHash( + PermissionGroupDefinitionRecord[] permissionGroupRecords, + PermissionDefinitionRecord[] permissionRecords, + IEnumerable deletedPermissionGroups, + IEnumerable deletedPermissions) + { + var stringBuilder = new StringBuilder(); + + stringBuilder.Append("PermissionGroupRecords:"); + stringBuilder.AppendLine(JsonSerializer.Serialize(permissionGroupRecords)); + + stringBuilder.Append("PermissionRecords:"); + stringBuilder.AppendLine(JsonSerializer.Serialize(permissionRecords)); + + stringBuilder.Append("DeletedPermissionGroups:"); + stringBuilder.AppendLine(deletedPermissionGroups.JoinAsString(",")); + + stringBuilder.Append("DeletedPermission:"); + stringBuilder.Append(deletedPermissions.JoinAsString(",")); + + return stringBuilder + .ToString() + .ToMd5(); + } +} diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs index bf9aa570a7..c901cbeb7f 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementDbContextModelBuilderExtensions.cs @@ -1,5 +1,6 @@ using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; +using Volo.Abp.Authorization.Permissions; using Volo.Abp.EntityFrameworkCore.Modeling; namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; @@ -17,11 +18,44 @@ public static class AbpPermissionManagementDbContextModelBuilderExtensions b.ConfigureByConvention(); - b.Property(x => x.Name).HasMaxLength(PermissionGrantConsts.MaxNameLength).IsRequired(); + b.Property(x => x.Name).HasMaxLength(PermissionDefinitionRecordConsts.MaxNameLength).IsRequired(); b.Property(x => x.ProviderName).HasMaxLength(PermissionGrantConsts.MaxProviderNameLength).IsRequired(); b.Property(x => x.ProviderKey).HasMaxLength(PermissionGrantConsts.MaxProviderKeyLength).IsRequired(); - b.HasIndex(x => new { x.TenantId, x.Name, x.ProviderName, x.ProviderKey }).IsUnique(true); + b.HasIndex(x => new { x.TenantId, x.Name, x.ProviderName, x.ProviderKey }).IsUnique(); + + b.ApplyObjectExtensionMappings(); + }); + + builder.Entity(b => + { + b.ToTable(AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGroups", AbpPermissionManagementDbProperties.DbSchema); + + b.ConfigureByConvention(); + + b.Property(x => x.Name).HasMaxLength(PermissionGroupDefinitionRecordConsts.MaxNameLength).IsRequired(); + b.Property(x => x.DisplayName).HasMaxLength(PermissionGroupDefinitionRecordConsts.MaxDisplayNameLength).IsRequired(); + + b.HasIndex(x => new { x.Name }).IsUnique(); + + b.ApplyObjectExtensionMappings(); + }); + + builder.Entity(b => + { + b.ToTable(AbpPermissionManagementDbProperties.DbTablePrefix + "Permissions", AbpPermissionManagementDbProperties.DbSchema); + + b.ConfigureByConvention(); + + b.Property(x => x.GroupName).HasMaxLength(PermissionGroupDefinitionRecordConsts.MaxNameLength).IsRequired(); + b.Property(x => x.Name).HasMaxLength(PermissionDefinitionRecordConsts.MaxNameLength).IsRequired(); + b.Property(x => x.ParentName).HasMaxLength(PermissionDefinitionRecordConsts.MaxNameLength); + b.Property(x => x.DisplayName).HasMaxLength(PermissionDefinitionRecordConsts.MaxDisplayNameLength).IsRequired(); + b.Property(x => x.Providers).HasMaxLength(PermissionDefinitionRecordConsts.MaxProvidersLength); + b.Property(x => x.StateCheckers).HasMaxLength(PermissionDefinitionRecordConsts.MaxStateCheckersLength); + + b.HasIndex(x => new { x.Name }).IsUnique(); + b.HasIndex(x => new { x.GroupName }); b.ApplyObjectExtensionMappings(); }); diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs index 6d7451c5e9..ebcc8527c1 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs @@ -14,6 +14,8 @@ public class AbpPermissionManagementEntityFrameworkCoreModule : AbpModule { options.AddDefaultRepositories(); + options.AddRepository(); + options.AddRepository(); options.AddRepository(); }); } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionDefinitionRecordRepository.cs new file mode 100644 index 0000000000..09cf408f7d --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionDefinitionRecordRepository.cs @@ -0,0 +1,29 @@ +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; + +public class EfCorePermissionDefinitionRecordRepository : + EfCoreRepository, + IPermissionDefinitionRecordRepository +{ + public EfCorePermissionDefinitionRecordRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + + public async Task FindByNameAsync( + string name, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .OrderBy(x => x.Id) + .FirstOrDefaultAsync(r => r.Name == name, cancellationToken); + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs index 6345f69735..a080d39d87 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGrantRepository.cs @@ -9,7 +9,8 @@ using Volo.Abp.EntityFrameworkCore; namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; -public class EfCorePermissionGrantRepository : EfCoreRepository, +public class EfCorePermissionGrantRepository : + EfCoreRepository, IPermissionGrantRepository { public EfCorePermissionGrantRepository(IDbContextProvider dbContextProvider) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGroupDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGroupDefinitionRecordRepository.cs new file mode 100644 index 0000000000..923d238761 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/EfCorePermissionGroupDefinitionRecordRepository.cs @@ -0,0 +1,16 @@ +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; + +public class EfCorePermissionGroupDefinitionRecordRepository : + EfCoreRepository, + IPermissionGroupDefinitionRecordRepository +{ + public EfCorePermissionGroupDefinitionRecordRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/IPermissionManagementDbContext.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/IPermissionManagementDbContext.cs index 174ba1762a..c294c1b248 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/IPermissionManagementDbContext.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/IPermissionManagementDbContext.cs @@ -7,5 +7,9 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; [ConnectionStringName(AbpPermissionManagementDbProperties.ConnectionStringName)] public interface IPermissionManagementDbContext : IEfCoreDbContext { + DbSet PermissionGroups { get; } + + DbSet Permissions { get; } + DbSet PermissionGrants { get; } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/PermissionManagementDbContext.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/PermissionManagementDbContext.cs index f1183eec16..fe143fa8ae 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/PermissionManagementDbContext.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/PermissionManagementDbContext.cs @@ -7,6 +7,8 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; [ConnectionStringName(AbpPermissionManagementDbProperties.ConnectionStringName)] public class PermissionManagementDbContext : AbpDbContext, IPermissionManagementDbContext { + public DbSet PermissionGroups { get; set; } + public DbSet Permissions { get; set; } public DbSet PermissionGrants { get; set; } public PermissionManagementDbContext(DbContextOptions options) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs index a3d1461e58..9c7c90af58 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbContextExtensions.cs @@ -9,6 +9,16 @@ public static class AbpPermissionManagementMongoDbContextExtensions { Check.NotNull(builder, nameof(builder)); + builder.Entity(b => + { + b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGroups"; + }); + + builder.Entity(b => + { + b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "Permissions"; + }); + builder.Entity(b => { b.CollectionName = AbpPermissionManagementDbProperties.DbTablePrefix + "PermissionGrants"; diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs index b62d651bf1..80831660f8 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs @@ -16,6 +16,8 @@ public class AbpPermissionManagementMongoDbModule : AbpModule { options.AddDefaultRepositories(); + options.AddRepository(); + options.AddRepository(); options.AddRepository(); }); } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/IPermissionManagementMongoDbContext.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/IPermissionManagementMongoDbContext.cs index 0826003628..98015484fb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/IPermissionManagementMongoDbContext.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/IPermissionManagementMongoDbContext.cs @@ -7,5 +7,9 @@ namespace Volo.Abp.PermissionManagement.MongoDB; [ConnectionStringName(AbpPermissionManagementDbProperties.ConnectionStringName)] public interface IPermissionManagementMongoDbContext : IAbpMongoDbContext { + IMongoCollection PermissionGroups { get; } + + IMongoCollection Permissions { get; } + IMongoCollection PermissionGrants { get; } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionDefinitionRecordRepository.cs new file mode 100644 index 0000000000..e4894a1442 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionDefinitionRecordRepository.cs @@ -0,0 +1,32 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using MongoDB.Driver.Linq; +using Volo.Abp.Domain.Repositories.MongoDB; +using Volo.Abp.MongoDB; + +namespace Volo.Abp.PermissionManagement.MongoDB; + +public class MongoPermissionDefinitionRecordRepository : + MongoDbRepository, + IPermissionDefinitionRecordRepository +{ + public MongoPermissionDefinitionRecordRepository( + IMongoDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } + + public async Task FindByNameAsync( + string name, + CancellationToken cancellationToken = default) + { + cancellationToken = GetCancellationToken(cancellationToken); + return await (await GetMongoQueryableAsync(cancellationToken)) + .OrderBy(x => x.Id) + .FirstOrDefaultAsync( + s => s.Name == name, + cancellationToken + ); + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs index 908f258a47..aa7694b7d5 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGrantRepository.cs @@ -10,7 +10,9 @@ using Volo.Abp.MongoDB; namespace Volo.Abp.PermissionManagement.MongoDB; -public class MongoPermissionGrantRepository : MongoDbRepository, IPermissionGrantRepository +public class MongoPermissionGrantRepository : + MongoDbRepository, + IPermissionGrantRepository { public MongoPermissionGrantRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGroupDefinitionRecordRepository.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGroupDefinitionRecordRepository.cs new file mode 100644 index 0000000000..0b6b5550b9 --- /dev/null +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/MongoPermissionGroupDefinitionRecordRepository.cs @@ -0,0 +1,16 @@ +using System; +using Volo.Abp.Domain.Repositories.MongoDB; +using Volo.Abp.MongoDB; + +namespace Volo.Abp.PermissionManagement.MongoDB; + +public class MongoPermissionGroupDefinitionRecordRepository : + MongoDbRepository, + IPermissionGroupDefinitionRecordRepository +{ + public MongoPermissionGroupDefinitionRecordRepository( + IMongoDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoDbContext.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoDbContext.cs index e8ef18f162..c62db52c11 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoDbContext.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/PermissionManagementMongoDbContext.cs @@ -7,6 +7,8 @@ namespace Volo.Abp.PermissionManagement.MongoDB; [ConnectionStringName(AbpPermissionManagementDbProperties.ConnectionStringName)] public class PermissionManagementMongoDbContext : AbpMongoDbContext, IPermissionManagementMongoDbContext { + public IMongoCollection PermissionGroups => Collection(); + public IMongoCollection Permissions => Collection(); public IMongoCollection PermissionGrants => Collection(); protected override void CreateModel(IMongoModelBuilder modelBuilder) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs index 5f1ca18fc0..9d91fc573e 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs @@ -3,9 +3,11 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; using Volo.Abp.EventBus.Local; +using Volo.Abp.Localization; using Volo.Abp.PermissionManagement.Web.Utils; namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement; @@ -37,15 +39,18 @@ public class PermissionManagementModal : AbpPageModel protected IPermissionAppService PermissionAppService { get; } protected ILocalEventBus LocalEventBus { get; } + public AbpLocalizationOptions LocalizationOptions { get; } public PermissionManagementModal( - IPermissionAppService permissionAppService, - ILocalEventBus localEventBus) + IPermissionAppService permissionAppService, + ILocalEventBus localEventBus, + IOptions localizationOptions) { ObjectMapperContext = typeof(AbpPermissionManagementWebModule); PermissionAppService = permissionAppService; LocalEventBus = localEventBus; + LocalizationOptions = localizationOptions.Value; } public virtual async Task OnGetAsync() diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj index 9b0cd2f1c0..8e77b2d56c 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo.Abp.PermissionManagement.Domain.Tests.csproj @@ -12,6 +12,8 @@ + + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs index 24945f83b0..bf32af126d 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs @@ -2,6 +2,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Features; +using Volo.Abp.GlobalFeatures; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.Uow; @@ -10,7 +12,10 @@ namespace Volo.Abp.PermissionManagement; [DependsOn( typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpPermissionManagementTestBaseModule))] + typeof(AbpPermissionManagementTestBaseModule), + typeof(AbpFeaturesModule), + typeof(AbpGlobalFeaturesModule) + )] public class AbpPermissionManagementTestModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs index aa9e7ecca9..78ab5d0af9 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionChecker_Basic_Tests.cs @@ -15,11 +15,9 @@ public class PermissionChecker_Basic_Tests : PermissionTestBase } [Fact] - public async Task Should_Throw_Exception_If_Permission_Is_Not_Defined() + public async Task Should_Return_Prohibited_If_Permission_Is_Not_Defined() { - await Assert.ThrowsAsync(async () => - await _permissionChecker.IsGrantedAsync("UndefinedPermissionName") - ); + (await _permissionChecker.IsGrantedAsync("UndefinedPermissionName")).ShouldBeFalse(); } [Fact] diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionRecordRepository_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionRecordRepository_Tests.cs new file mode 100644 index 0000000000..20f9f7e21f --- /dev/null +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionRecordRepository_Tests.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace Volo.Abp.PermissionManagement; + +public abstract class PermissionDefinitionRecordRepository_Tests : PermissionTestBase +{ + protected IPermissionDefinitionRecordRepository PermissionDefinitionRecordRepository { get; set; } + + protected PermissionDefinitionRecordRepository_Tests() + { + PermissionDefinitionRecordRepository = GetRequiredService(); + } + + [Fact] + public async Task FindByNameAsync() + { + var permission = await PermissionDefinitionRecordRepository.FindByNameAsync("MyPermission1"); + permission.ShouldNotBeNull(); + permission.Name.ShouldBe("MyPermission1"); + + permission = await PermissionDefinitionRecordRepository.FindByNameAsync("MyPermission2"); + permission.ShouldNotBeNull(); + permission.Name.ShouldBe("MyPermission2"); + } +} diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer_Tests.cs new file mode 100644 index 0000000000..1e7c04580c --- /dev/null +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionDefinitionSerializer_Tests.cs @@ -0,0 +1,93 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.Features; +using Volo.Abp.GlobalFeatures; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; +using Volo.Abp.PermissionManagement.Localization; +using Xunit; + +namespace Volo.Abp.PermissionManagement; + +public class PermissionDefinitionSerializer_Tests : PermissionTestBase +{ + private readonly IPermissionDefinitionSerializer _serializer; + + public PermissionDefinitionSerializer_Tests() + { + _serializer = GetRequiredService(); + } + + [Fact] + public async Task Serialize_Permission_Group_Definition() + { + // Arrange + + var context = new PermissionDefinitionContext(null); + var group1 = CreatePermissionGroup1(context); + + // Act + + var permissionGroupRecord = await _serializer.SerializeAsync(group1); + + //Assert + + permissionGroupRecord.Name.ShouldBe("Group1"); + permissionGroupRecord.DisplayName.ShouldBe("F:Group one"); + permissionGroupRecord.GetProperty("CustomProperty1").ShouldBe("CustomValue1"); + } + + [Fact] + public async Task Serialize_Complex_Permission_Definition() + { + // Arrange + + var context = new PermissionDefinitionContext(null); + var group1 = CreatePermissionGroup1(context); + var permission1 = group1.AddPermission( + "Permission1", + new LocalizableString(typeof(AbpPermissionManagementResource), "Permission1"), + MultiTenancySides.Tenant + ) + .WithProviders("ProviderA", "ProviderB") + .WithProperty("CustomProperty2", "CustomValue2") + .RequireAuthenticated() //For for testing, not so meaningful + .RequireGlobalFeatures("GlobalFeature1", "GlobalFeature2") + .RequireFeatures("Feature1", "Feature2") + .RequirePermissions(requiresAll: false, batchCheck: false,"Permission2", "Permission3"); + + // Act + + var permissionRecord = await _serializer.SerializeAsync( + permission1, + group1 + ); + + //Assert + + permissionRecord.Name.ShouldBe("Permission1"); + permissionRecord.GroupName.ShouldBe("Group1"); + permissionRecord.DisplayName.ShouldBe("L:AbpPermissionManagement,Permission1"); + permissionRecord.GetProperty("CustomProperty2").ShouldBe("CustomValue2"); + permissionRecord.Providers.ShouldBe("ProviderA,ProviderB"); + permissionRecord.MultiTenancySide.ShouldBe(MultiTenancySides.Tenant); + permissionRecord.StateCheckers.ShouldBe("[{\"T\":\"A\"},{\"T\":\"G\",\"A\":true,\"N\":[\"GlobalFeature1\",\"GlobalFeature2\"]},{\"T\":\"F\",\"A\":true,\"N\":[\"Feature1\",\"Feature2\"]},{\"T\":\"P\",\"A\":false,\"N\":[\"Permission2\",\"Permission3\"]}]"); + } + + private static PermissionGroupDefinition CreatePermissionGroup1( + IPermissionDefinitionContext context) + { + var group = context.AddGroup( + "Group1", + displayName: new FixedLocalizableString("Group one") + ); + + group["CustomProperty1"] = "CustomValue1"; + + return group; + } +} \ No newline at end of file diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs index 06e245046c..1f771bdb3b 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/PermissionManager_Tests.cs @@ -72,12 +72,12 @@ public class PermissionManager_Tests : PermissionTestBase } [Fact] - public async Task Get_Should_Exception_When_Permission_Undefined() + public async Task Get_Should_Return_Not_Granted_When_Permission_Undefined() { - await Assert.ThrowsAsync(async () => await _permissionManager.GetAsync( - "MyPermission1NotExist", - "Test", - "Test")); + var result = await _permissionManager.GetAsync("MyPermission1NotExist", "Test", "Test"); + result.Name.ShouldBe("MyPermission1NotExist"); + result.Providers.ShouldBeEmpty(); + result.IsGranted.ShouldBeFalse(); } [Fact] @@ -126,13 +126,13 @@ public class PermissionManager_Tests : PermissionTestBase } [Fact] - public async Task Set_Should_Exception_When_Permission_Undefined() + public async Task Set_Should_Silently_Ignore_When_Permission_Undefined() { - await Assert.ThrowsAsync(async () => await _permissionManager.SetAsync( + await _permissionManager.SetAsync( "MyPermission1NotExist", "Test", "Test", - true)); + true); } [Fact] diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/StaticPermissionSaver_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/StaticPermissionSaver_Tests.cs new file mode 100644 index 0000000000..28fa57b034 --- /dev/null +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Domain.Tests/Volo/Abp/PermissionManagement/StaticPermissionSaver_Tests.cs @@ -0,0 +1,13 @@ +namespace Volo.Abp.PermissionManagement; + +public class StaticPermissionSaver_Tests : PermissionTestBase +{ + private readonly IStaticPermissionSaver _saver; + + public StaticPermissionSaver_Tests() + { + _saver = GetRequiredService(); + } + + +} diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj index 034ee303da..2caab81eb6 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests.csproj @@ -13,6 +13,7 @@ + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/EFCorePermissionDefinitionRecordRepository_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/EFCorePermissionDefinitionRecordRepository_Tests.cs new file mode 100644 index 0000000000..5429d2e772 --- /dev/null +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/EFCorePermissionDefinitionRecordRepository_Tests.cs @@ -0,0 +1,6 @@ +namespace Volo.Abp.PermissionManagement.EntityFrameworkCore; + +public class EFCorePermissionDefinitionRecordRepository_Tests : PermissionDefinitionRecordRepository_Tests +{ + +} diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj index 93b14e484f..9a23915ee8 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj @@ -13,6 +13,7 @@ + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbPermissionDefinitionRecordRepository_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbPermissionDefinitionRecordRepository_Tests.cs new file mode 100644 index 0000000000..d43634cdb9 --- /dev/null +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbPermissionDefinitionRecordRepository_Tests.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace Volo.Abp.PermissionManagement.MongoDB; + +[Collection(MongoTestCollection.Name)] +public class MongoDbPermissionDefinitionRecordRepository_Tests : PermissionGrantRepository_Tests +{ + +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json index cc88fc4412..878ca22fc3 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json @@ -5,6 +5,16 @@ "SuccessfullySaved": "Sikeresen mentve", "Permission:SettingManagement": "Beállításkezelés", "Permission:Emailing": "E-mailezés", + "Permission:EmailingTest": "E-mail teszt", + "SendTestEmail": "Küldj teszt e-mailt", + "SenderEmailAddress": "Feladó e-mail címe", + "TargetEmailAddress": "Cél e-mail cím", + "Subject": "Tantárgy", + "Body": "Test", + "TestEmailSubject": "Teszt e-mail {0}", + "TestEmailBody": "Itt tesztelheti az e-mail törzsüzenetét", + "SuccessfullySent": "Sikeresen elküldve", + "Send": "Küld", "Menu:Emailing": "E-mailezés", "SmtpHost": "Házigazda", "SmtpPort": "Kikötő", @@ -21,4 +31,4 @@ "Feature:AllowChangingEmailSettings": "Az e-mail beállítások módosításának engedélyezése.", "Feature:AllowChangingEmailSettingsDescription": "Az e-mail beállítások módosításának engedélyezése." } -} +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/SettingManager.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/SettingManager.cs index 14629b988e..570c99925b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/SettingManager.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/SettingManager.cs @@ -27,7 +27,7 @@ public class SettingManager : ISettingManager, ISingletonDependency SettingEncryptionService = settingEncryptionService; Options = options.Value; - //TODO: Instead, use IHybridServiceScopeFactory and create a scope..? + //TODO: Instead, use IServiceScopeFactory and create a scope..? _lazyProviders = new Lazy>( () => Options diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs index 11daa3fb4a..5969237a21 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs @@ -61,11 +61,6 @@ public partial class TenantManagement protected override ValueTask SetToolbarItemsAsync() { - Toolbar.AddButton(L["ManageHostFeatures"], - async () => await FeatureManagementModal.OpenAsync(FeatureProviderName), - "fa fa-cog", - requiredPolicyName: FeatureManagementPermissions.ManageHostFeatures); - Toolbar.AddButton(L["NewTenant"], OpenCreateModalAsync, IconName.Add, diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ar.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ar.json index 829a326d24..8146974400 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ar.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ar.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Default Connection String", "DisplayName:UseSharedDatabase": "استخدام قاعدة البيانات المشتركة", - "ManageHostFeatures": "إدارة ميزات المضيف", "Permission:TenantManagement": "إدارة المستأجر", "Permission:Create": "إنشاء", "Permission:Edit": "تحرير", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/cs.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/cs.json index 754b66d081..001d5d71fb 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/cs.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/cs.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Connection stringy", "DisplayName:DefaultConnectionString": "Výchozí connection string", "DisplayName:UseSharedDatabase": "Použít sdílenou databázi", - "ManageHostFeatures": "Správa funkcí hostitele", "Permission:TenantManagement": "Správa tenantů", "Permission:Create": "Vytvořit", "Permission:Edit": "Upravit", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de-DE.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de-DE.json index 2033fdf1ed..58d71c9252 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de-DE.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de-DE.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Standard-Connection String", "DisplayName:UseSharedDatabase": "Verwenden Sie die freigegebene Datenbank", - "ManageHostFeatures": "Host-Features verwalten", "Permission:TenantManagement": "Mandantenverwaltung", "Permission:Create": "Erstellen", "Permission:Edit": "Bearbeiten", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/el.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/el.json index 026bcb0b76..bc75c34e03 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/el.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/el.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Συμβολοσειρές σύνδεσης", "DisplayName:DefaultConnectionString": "Προεπιλεγμένη συμβολοσειρά σύνδεσης", "DisplayName:UseSharedDatabase": "Χρησιμοποιήστε την Κοινόχρηστη βάση δεδομένων", - "ManageHostFeatures": "Διαχείριση δυνατοτήτων του Οικοδεσπότη", "Permission:TenantManagement": "Διαχείριση ενοικιαστών", "Permission:Create": "Δημιουργία", "Permission:Edit": "Επεξεργασία", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en-GB.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en-GB.json index 4d6075ff74..8b4e4c185b 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en-GB.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en-GB.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Default Connection String", "DisplayName:UseSharedDatabase": "Use the Shared Database", - "ManageHostFeatures": "Manage Host features", "Permission:TenantManagement": "Tenant management", "Permission:Create": "Create", "Permission:Edit": "Edit", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en.json index 1a10c5b77a..e639feb5f3 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/en.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Default Connection String", "DisplayName:UseSharedDatabase": "Use the Shared Database", - "ManageHostFeatures": "Manage Host features", "Permission:TenantManagement": "Tenant management", "Permission:Create": "Create", "Permission:Edit": "Edit", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/es.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/es.json index 774201178b..bcbfc98852 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/es.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/es.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Connection String predeterminado", "DisplayName:UseSharedDatabase": "Usar la base de datos compartida", - "ManageHostFeatures": "Administrar funciones de host", "Permission:TenantManagement": "Gestión de tenants", "Permission:Create": "Crear", "Permission:Edit": "Editar", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fa.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fa.json index f0a804c073..c67a9c070b 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fa.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fa.json @@ -10,7 +10,6 @@ "ConnectionStrings": "کانکشن استرینگها", "DisplayName:DefaultConnectionString": "کانکشن استرینگ پیش فرض", "DisplayName:UseSharedDatabase": "استفاده از پایگاه داده مشترک", - "ManageHostFeatures": "مدیریت ویژگی های میزبان", "Permission:TenantManagement": "مدیریت تننت", "Permission:Create": "ایجاد", "Permission:Edit": "ویرایش", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fi.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fi.json index b24d67135e..179ec3c1d6 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fi.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fi.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Yhteysjonot", "DisplayName:DefaultConnectionString": "Oletusyhteysmerkkijono", "DisplayName:UseSharedDatabase": "Käytä jaettua tietokantaa", - "ManageHostFeatures": "Hallinnoi isäntäominaisuuksia", "Permission:TenantManagement": "Vuokralaisten hallinta", "Permission:Create": "Luoda", "Permission:Edit": "Muokata", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fr.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fr.json index 4d6ccd76b0..3537ca8ca6 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fr.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/fr.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Chaînes de connexion", "DisplayName:DefaultConnectionString": "Chaîne de connexion par défaut", "DisplayName:UseSharedDatabase": "Utiliser la base de données partagée", - "ManageHostFeatures": "Gérer les fonctionnalités de l’hôte", "Permission:TenantManagement": "Gestion des locataires", "Permission:Create": "Créer", "Permission:Edit": "Modifier", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hi.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hi.json index 93f4a1a1ad..70367305a9 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hi.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hi.json @@ -11,7 +11,6 @@ "ConnectionStrings": "कनेक्शन स्ट्रिंग्स", "DisplayName:DefaultConnectionString": "डिफ़ॉल्ट कनेक्शन स्ट्रिंग", "DisplayName:UseSharedDatabase": "साझा डेटाबेस का उपयोग करें", - "ManageHostFeatures": "होस्ट सुविधाएँ प्रबंधित करें", "Permission:TenantManagement": "किरायेदार प्रबंधन", "Permission:Create": "सृजन करना", "Permission:Edit": "संपादित करें", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hu.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hu.json index 60c61c15cf..26787bca90 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hu.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/hu.json @@ -1,24 +1,23 @@ { - "culture": "hu", - "texts": { - "Menu:TenantManagement": "Bérlő menedzsment", - "Tenants": "Bérlők", - "NewTenant": "Új bérlő", - "TenantName": "Bérlő neve", - "DisplayName:TenantName": "Bérlő neve", - "TenantDeletionConfirmationMessage": "A '{0}' bérlő törlésre kerül. Megerősíti a műveletet?", - "ConnectionStrings": "Kapcsolat beállítás", - "DisplayName:DefaultConnectionString": "Alapértelmezettt kapcsolati beállítás", - "DisplayName:UseSharedDatabase": "Használjon megosztott adatbázist", - "ManageHostFeatures": "Host funkciók kezelése", - "Permission:TenantManagement": "Bérlő menedzsment", - "Permission:Create": "Létrehozás", - "Permission:Edit": "Szerkesztés", - "Permission:Delete": "Törlés", - "Permission:ManageConnectionStrings": "Kapcsolati beállítások kezelése", - "Permission:ManageFeatures": "Funkciók kezelése", - "DisplayName:AdminEmailAddress": "Admin email cím", - "DisplayName:AdminPassword": "Admin jelszó" - } + "culture": "hu", + "texts": { + "Volo.Abp.TenantManagement:DuplicateTenantName": "A bérlő neve már létezik: {Name}", + "Menu:TenantManagement": "Bérlő menedzsment", + "Tenants": "Bérlők", + "NewTenant": "Új bérlő", + "TenantName": "Bérlő neve", + "DisplayName:TenantName": "Bérlő neve", + "TenantDeletionConfirmationMessage": "A '{0}' bérlő törlésre kerül. Megerősíti a műveletet?", + "ConnectionStrings": "Kapcsolat beállítás", + "DisplayName:DefaultConnectionString": "Alapértelmezettt kapcsolati beállítás", + "DisplayName:UseSharedDatabase": "Használjon megosztott adatbázist", + "Permission:TenantManagement": "Bérlő menedzsment", + "Permission:Create": "Létrehozás", + "Permission:Edit": "Szerkesztés", + "Permission:Delete": "Törlés", + "Permission:ManageConnectionStrings": "Kapcsolati beállítások kezelése", + "Permission:ManageFeatures": "Funkciók kezelése", + "DisplayName:AdminEmailAddress": "Admin email cím", + "DisplayName:AdminPassword": "Admin jelszó" } - \ No newline at end of file +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/is.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/is.json index 25c6a86ca3..ca2a8cb7a9 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/is.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/is.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Tengi strengir", "DisplayName:DefaultConnectionString": "Sjálfgefin tengistrengur", "DisplayName:UseSharedDatabase": "Notaðu samnýttan gagnagrunn", - "ManageHostFeatures": "Stjórna Gestgjafa Eiginleikum", "Permission:TenantManagement": "Tenant umsjá", "Permission:Create": "Búa til", "Permission:Edit": "Breyta", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/it.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/it.json index 6deff1bd54..5d95e2039c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/it.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/it.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Stringhe di connessione", "DisplayName:DefaultConnectionString": "Stringa di connessione predefinita", "DisplayName:UseSharedDatabase": "Usa il database condiviso", - "ManageHostFeatures": "Gestisci le funzionalità dell'host", "Permission:TenantManagement": "Gestione Tenant", "Permission:Create": "Crea", "Permission:Edit": "Modifica", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/nl.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/nl.json index d4c45b8aad..1aeb208560 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/nl.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/nl.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Standaard Connection String", "DisplayName:UseSharedDatabase": "Gebruik de gedeelde database", - "ManageHostFeatures": "Beheer host functies", "Permission:TenantManagement": "Klanten beheer", "Permission:Create": "Maak aan", "Permission:Edit": "Bewerk", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pl-PL.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pl-PL.json index c62c67123e..6ec40c7310 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pl-PL.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pl-PL.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Domyślny Connection String", "DisplayName:UseSharedDatabase": "Użyj współdzielonej bazy danych", - "ManageHostFeatures": "Zarządzaj funkcjami hosta", "Permission:TenantManagement": "Zarządzanie tenantami", "Permission:Create": "Utwórz", "Permission:Edit": "Edytuj", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pt-BR.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pt-BR.json index d2c3ceecf1..d9f6b14a69 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pt-BR.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/pt-BR.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Cadeia de Conexão", "DisplayName:DefaultConnectionString": "Cadeia de Conexão Padrão", "DisplayName:UseSharedDatabase": "Use o banco de dados compartilhado", - "ManageHostFeatures": "Gerenciar recursos do Host", "Permission:TenantManagement": "Inquilinos", "Permission:Create": "Criar", "Permission:Edit": "Editar", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ro-RO.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ro-RO.json index 70147d9921..18bf9fb74e 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ro-RO.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ro-RO.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Connection String implicit", "DisplayName:UseSharedDatabase": "Folosiţi baza de date partajată", - "ManageHostFeatures": "Administraţi caracteristicile de host", "Permission:TenantManagement": "Administrarea clienţilor", "Permission:Create": "Creează", "Permission:Edit": "Editează", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ru.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ru.json index b3585c20a4..2204cf35cf 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ru.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/ru.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Строки подключения", "DisplayName:DefaultConnectionString": "Строка подключения по умолчанию", "DisplayName:UseSharedDatabase": "Использование общей базы данных", - "ManageHostFeatures": "Управление функциями хоста", "Permission:TenantManagement": "Управление арендаторами", "Permission:Create": "Создать", "Permission:Edit": "Редактировать", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sk.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sk.json index e37d605d16..1aff65e71c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sk.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sk.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection stringy", "DisplayName:DefaultConnectionString": "Predvolený connection string", "DisplayName:UseSharedDatabase": "Použiť zdieľanú databázu", - "ManageHostFeatures": "Spravovať funkcie poskytovateľa", "Permission:TenantManagement": "Správa tenantov", "Permission:Create": "Vytvoriť", "Permission:Edit": "Upraviť", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sl.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sl.json index 9e5d1c215a..a21cfa702a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sl.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/sl.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Connection Strings", "DisplayName:DefaultConnectionString": "Privzeti Connection String", "DisplayName:UseSharedDatabase": "Uporabi skupno bazo", - "ManageHostFeatures": "Upravljajte funkcije gostitelja", "Permission:TenantManagement": "Upravljanje najemnikov", "Permission:Create": "Ustvarjanje", "Permission:Edit": "Urejanje", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json index ffbab818f2..409aa40795 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/tr.json @@ -11,7 +11,6 @@ "ConnectionStrings": "Bağlantı cümlesi", "DisplayName:DefaultConnectionString": "Varsayılan bağlantı cümlesi", "DisplayName:UseSharedDatabase": "Paylaşılan veritabanını kullan", - "ManageHostFeatures": "Host özelliklerini yönetin", "Permission:TenantManagement": "Müşteri yönetimi", "Permission:Create": "Oluşturma", "Permission:Edit": "Düzenleme", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/vi.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/vi.json index 025ec04eb6..4fafa9cc72 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/vi.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/vi.json @@ -10,7 +10,6 @@ "ConnectionStrings": "Chuỗi kết nối", "DisplayName:DefaultConnectionString": "Chuỗi kết nối mặc định", "DisplayName:UseSharedDatabase": "Sử dụng cơ sở dữ liệu dùng chung", - "ManageHostFeatures": "Quản lý các tính năng của Máy chủ lưu trữ", "Permission:TenantManagement": "Quản lý khách thuê", "Permission:Create": "Tạo", "Permission:Edit": "Sửa", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hans.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hans.json index 94ef8abba1..0367489a5a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hans.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hans.json @@ -11,7 +11,6 @@ "ConnectionStrings": "连接字符串", "DisplayName:DefaultConnectionString": "默认连接字符串", "DisplayName:UseSharedDatabase": "使用共享数据库", - "ManageHostFeatures": "管理Host特性", "Permission:TenantManagement": "租户管理", "Permission:Create": "创建", "Permission:Edit": "编辑", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hant.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hant.json index 1403cb79d5..59519aff67 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hant.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/zh-Hant.json @@ -11,7 +11,6 @@ "ConnectionStrings": "資料庫連線字串", "DisplayName:DefaultConnectionString": "預設資料庫連線字串", "DisplayName:UseSharedDatabase": "使用共用資料庫", - "ManageHostFeatures": "管理Host功能", "Permission:TenantManagement": "租戶管理", "Permission:Create": "新增", "Permission:Edit": "編輯", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index 1ac62db5e2..b3a63fb8ae 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -69,13 +69,6 @@ public class AbpTenantManagementWebModule : AbpModule options.Configure( toolbar => { - toolbar.AddButton( - LocalizableString.Create("ManageHostFeatures"), - icon: "cog", - name: "ManageHostFeatures", - requiredPolicyName: FeatureManagementPermissions.ManageHostFeatures - ); - toolbar.AddButton( LocalizableString.Create("NewTenant"), icon: "plus", diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js index e990b8fc37..a9cf094c6c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js @@ -113,12 +113,5 @@ e.preventDefault(); _createModal.open(); }); - - _$wrapper.find('button[name=ManageHostFeatures]').click(function (e) { - e.preventDefault(); - _featuresModal.open({ - providerName: 'T' - }); - }); }); })(); diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs index 3e90b7d32c..e99befa225 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs @@ -1,11 +1,12 @@ using System; using Volo.Abp.Data; using Volo.Abp.EventBus; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.Users; [EventName("Volo.Abp.Users.User")] -public class UserEto : IUserData, IHasExtraProperties +public class UserEto : IUserData, IHasExtraProperties, IMultiTenant { public Guid Id { get; set; } diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/hu.json b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/hu.json index 8d11e0be78..9a6dddb460 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/hu.json +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/hu.json @@ -1,15 +1,14 @@ { - "culture": "hu", - "texts": { - "VirtualFileExplorer" : "Virtuális file böngésző", - "VirtualFileType" : "Virtuális file típus", - "Menu:VirtualFileExplorer" : "Virtuális file böngésző", - "LastUpdateTime" : "Utolsó módosítás ideje", - "VirtualFileName" : "Virtuális file neve", - "FileContent" : "File tartalma", - "Size" : "Méret", - "BackToRoot" : "Vissza a fő mappába", - "EmptyFileInfoList" : "Nem találhatóak virtuális fileok" - } + "culture": "hu", + "texts": { + "VirtualFileExplorer": "Virtuális file böngésző", + "VirtualFileType": "Virtuális file típus", + "Menu:VirtualFileExplorer": "Virtuális file böngésző", + "LastUpdateTime": "Utolsó módosítás ideje", + "VirtualFileName": "Virtuális file neve", + "FileContent": "File tartalma", + "Size": "Méret", + "BackToRoot": "Vissza a fő mappába", + "EmptyFileInfoList": "Nem találhatóak virtuális fileok" } - \ No newline at end of file +} \ No newline at end of file diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json index d6fb96ed4e..f4b0675210 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Localization/Resources/pt-BR.json @@ -8,7 +8,7 @@ "VirtualFileName": "Nome do arquivo virtual", "FileContent": "Conteúdo do arquivo", "Size": "Tamanho", - "BackToRoot": "De volta à raiz", + "BackToRoot": "Voltar à raiz", "EmptyFileInfoList": "Não há arquivos virtuais" } } \ No newline at end of file diff --git a/npm/packs/core/src/abp.js b/npm/packs/core/src/abp.js index 0348069bec..074d4f0f50 100644 --- a/npm/packs/core/src/abp.js +++ b/npm/packs/core/src/abp.js @@ -72,8 +72,61 @@ var abp = abp || {}; /* LOCALIZATION ***********************************************/ abp.localization = abp.localization || {}; - + abp.localization.internal = abp.localization.internal || {}; abp.localization.values = abp.localization.values || {}; + abp.localization.resources = abp.localization.resources || {}; + + abp.localization.internal.getResource = function (resourceName) { + var resource = abp.localization.resources[resourceName]; + if (resource) { + return resource; + } + + var legacySource = abp.localization.values[resourceName]; + if (legacySource) { + return { + texts: abp.localization.values[resourceName], + baseResources: [] + }; + } + + abp.log.warn('Could not find localization source: ' + resourceName); + return null; + }; + + abp.localization.internal.localize = function (key, sourceName) { + var resource = abp.localization.internal.getResource(sourceName); + if (!resource){ + return { + value: key, + found: false + }; + } + + var value = resource.texts[key]; + if (value === undefined) { + for (var i = 0; i < resource.baseResources.length; i++){ + var result = abp.localization.internal.localize(key, resource.baseResources[i]); + if (result.found){ + return result; + } + } + + return { + value: key, + found: false + }; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return { + value: abp.utils.formatString.apply(this, copiedArguments), + found: true + }; + }; abp.localization.localize = function (key, sourceName) { if (sourceName === '_') { //A convention to suppress the localization @@ -86,22 +139,7 @@ var abp = abp || {}; return key; } - var source = abp.localization.values[sourceName]; - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); + return abp.localization.internal.localize(key, sourceName).value; }; abp.localization.isLocalized = function (key, sourceName) { @@ -114,17 +152,7 @@ var abp = abp || {}; return false; } - var source = abp.localization.values[sourceName]; - if (!source) { - return false; - } - - var value = source[key]; - if (value === undefined) { - return false; - } - - return true; + return abp.localization.internal.localize(key, sourceName).found; }; abp.localization.getResource = function (name) { @@ -687,7 +715,7 @@ var abp = abp || {}; } /** - * Escape HTML to help prevent XSS attacks. + * Escape HTML to help prevent XSS attacks. */ abp.utils.htmlEscape = function (html) { return typeof html === 'string' ? html.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"') : html; @@ -759,7 +787,7 @@ var abp = abp || {}; return toUtc(date); } }; - + /* FEATURES *************************************************/ abp.features = abp.features || {}; @@ -774,7 +802,7 @@ var abp = abp || {}; abp.features.get = function (name) { return abp.features.values[name]; }; - + /* GLOBAL FEATURES *************************************************/ abp.globalFeatures = abp.globalFeatures || {}; diff --git a/npm/scripts/yarn.lock b/npm/scripts/yarn.lock index bae2201646..2feefc9b8a 100644 --- a/npm/scripts/yarn.lock +++ b/npm/scripts/yarn.lock @@ -1144,9 +1144,9 @@ locate-path@^6.0.0: p-locate "^5.0.0" lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 2050ef35c5..ee2671c044 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -98,6 +98,8 @@ $projects = ( "framework/src/Volo.Abp.AspNetCore.Authentication.OAuth", "framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect", "framework/src/Volo.Abp.AspNetCore", + "framework/src/Volo.Abp.AspNetCore.Mvc.Dapr", + "framework/src/Volo.Abp.AspNetCore.Mvc.Dapr.EventBus", "framework/src/Volo.Abp.AspNetCore.Components", "framework/src/Volo.Abp.AspNetCore.Components.Server", "framework/src/Volo.Abp.AspNetCore.Components.Web", @@ -154,12 +156,14 @@ $projects = ( "framework/src/Volo.Abp.Core", "framework/src/Volo.Abp", "framework/src/Volo.Abp.Dapper", + "framework/src/Volo.Abp.Dapr", "framework/src/Volo.Abp.Data", "framework/src/Volo.Abp.Ddd.Application", "framework/src/Volo.Abp.Ddd.Application.Contracts", "framework/src/Volo.Abp.Ddd.Domain", "framework/src/Volo.Abp.DistributedLocking.Abstractions", "framework/src/Volo.Abp.DistributedLocking", + "framework/src/Volo.Abp.DistributedLocking.Dapr", "framework/src/Volo.Abp.Emailing", "framework/src/Volo.Abp.EntityFrameworkCore", "framework/src/Volo.Abp.EntityFrameworkCore.MySQL", @@ -174,6 +178,7 @@ $projects = ( "framework/src/Volo.Abp.EventBus.Kafka", "framework/src/Volo.Abp.EventBus.Rebus", "framework/src/Volo.Abp.EventBus.Azure", + "framework/src/Volo.Abp.EventBus.Dapr", "framework/src/Volo.Abp.ExceptionHandling", "framework/src/Volo.Abp.Features", "framework/src/Volo.Abp.FluentValidation", @@ -183,7 +188,8 @@ $projects = ( "framework/src/Volo.Abp.HangFire", "framework/src/Volo.Abp.Http.Abstractions", "framework/src/Volo.Abp.Http.Client", - "framework/src/Volo.Abp.Http.Client.Web", + "framework/src/Volo.Abp.Http.Client.Dapr", + "framework/src/Volo.Abp.Http.Client.Web", "framework/src/Volo.Abp.Http.Client.IdentityModel", "framework/src/Volo.Abp.Http.Client.IdentityModel.Web", "framework/src/Volo.Abp.Http.Client.IdentityModel.WebAssembly", diff --git a/templates/NuGet.Config b/templates/NuGet.Config new file mode 100644 index 0000000000..d595c5314d --- /dev/null +++ b/templates/NuGet.Config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/templates/app-nolayers/angular/package.json b/templates/app-nolayers/angular/package.json index c25cbd9fe7..6197986477 100644 --- a/templates/app-nolayers/angular/package.json +++ b/templates/app-nolayers/angular/package.json @@ -19,7 +19,7 @@ "@abp/ng.setting-management": "~6.0.0-rc.4", "@abp/ng.tenant-management": "~6.0.0-rc.4", "@abp/ng.theme.shared": "~6.0.0-rc.4", - "@abp/ng.theme.lepton-x": "~1.0.0-rc.4", + "@abp/ng.theme.lepton-x": "~2.0.0-preview20220912", "@angular/animations": "~13.1.1", "@angular/common": "~13.1.1", "@angular/compiler": "~13.1.1", diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj index b96ca830b6..a55de568b6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs index d922551429..fb3c83f100 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs @@ -1,7 +1,7 @@ -using MyCompanyName.MyProjectName.Blazor.Server; using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -36,6 +36,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json index 0afb189e0d..0dd715d6b6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.components.server.leptonxlitetheme": "~1.0.0-rc.4" + "@abp/aspnetcore.components.server.leptonxlitetheme": "~2.0.0-preview20220912" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.Designer.cs similarity index 90% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.Designer.cs index 9e1a8f9cd8..2a8eeb5c4c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20220617083820_Initial")] + [Migration("20220913013927_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,95 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1273,6 +1362,59 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1307,6 +1449,34 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.cs similarity index 89% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.cs index 85d36d8b57..2f17d2eeba 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220617083820_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20220913013927_Initial.cs @@ -63,6 +63,42 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -678,6 +748,23 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -714,6 +801,23 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -838,6 +942,12 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -850,6 +960,12 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs index 0a32c8664e..4df66c04ca 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1271,6 +1360,59 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1305,6 +1447,34 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj index b915262a65..8df64cc659 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs index 8787d01b8e..ec8097460d 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs @@ -1,8 +1,7 @@ -using System; -using MyCompanyName.MyProjectName.Blazor.Server; using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -42,6 +41,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json index f04502147c..846190577e 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/package.json @@ -3,7 +3,7 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4", - "@abp/aspnetcore.components.server.leptonxlitetheme": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912", + "@abp/aspnetcore.components.server.leptonxlitetheme": "~2.0.0-preview20220912" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj index 6d700763c7..a4cd35e914 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj @@ -69,7 +69,7 @@ - + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs index d09fba6395..fb3c83f100 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs @@ -1,6 +1,7 @@ using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -35,6 +36,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.Designer.cs similarity index 90% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.Designer.cs index 5b55ca75a9..bc2a256ed3 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Host.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20220617083539_Initial")] + [Migration("20220913013918_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,95 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1273,6 +1362,59 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1307,6 +1449,34 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.cs similarity index 89% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.cs index 29cc53b046..d34c67552d 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220617083539_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/20220913013918_Initial.cs @@ -63,6 +63,42 @@ namespace MyCompanyName.MyProjectName.Host.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Host.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -678,6 +748,23 @@ namespace MyCompanyName.MyProjectName.Host.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -714,6 +801,23 @@ namespace MyCompanyName.MyProjectName.Host.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -838,6 +942,12 @@ namespace MyCompanyName.MyProjectName.Host.Migrations migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -850,6 +960,12 @@ namespace MyCompanyName.MyProjectName.Host.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs index 2597920679..b4acd389c1 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1271,6 +1360,59 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1305,6 +1447,34 @@ namespace MyCompanyName.MyProjectName.Host.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj index 782a0b7afb..e39893b7c3 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj @@ -70,7 +70,7 @@ - + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs index c762c9b245..ec8097460d 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs @@ -1,7 +1,7 @@ -using System; using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -41,6 +41,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj index 694178b55b..0b7707245a 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj @@ -17,7 +17,7 @@ - + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs index ac3634377d..fb3c83f100 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs @@ -1,7 +1,7 @@ using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; - +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -36,6 +36,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/ar.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/ar.json index 1ee94530fb..153f571276 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/ar.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/ar.json @@ -3,6 +3,6 @@ "texts": { "Welcome_Title": "مرحبا", "Welcome_Text": "هذا هو قالب بدء تشغيل تطبيق ذو طبقة واحدة مبسط لإطار عمل ABP.", - "Menu:Home": "الرئيسية" + "Menu:Home": "الصفحة الرئيسية" } } diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/hu.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/hu.json index fa6f372175..5833dcb415 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/hu.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Localization/MyProjectName/hu.json @@ -5,4 +5,4 @@ "Welcome_Text": "Ez egy minimalista, egyrétegű alkalmazásindítási sablon az ABP-keretrendszerhez.", "Menu:Home": "Kezdőlap" } -} +} \ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.Designer.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.Designer.cs similarity index 90% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.Designer.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.Designer.cs index 213ce02572..2cbf8a2a3c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.Designer.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Mvc.Migrations { [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20220617083649_Initial")] + [Migration("20220913013911_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,95 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1273,6 +1362,59 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1307,6 +1449,34 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.cs similarity index 89% rename from templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.cs rename to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.cs index 2a30fba759..3ac474ad9c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220617083649_Initial.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/20220913013911_Initial.cs @@ -63,6 +63,42 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -678,6 +748,23 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -714,6 +801,23 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -838,6 +942,12 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -850,6 +960,12 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs index 350f086968..c0470fe523 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1271,6 +1360,59 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1305,6 +1447,34 @@ namespace MyCompanyName.MyProjectName.Mvc.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj index d942bd74a0..692c05efa8 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj @@ -17,7 +17,7 @@ - + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs index 8a6393168c..ec8097460d 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs @@ -1,8 +1,7 @@ -using System; using MyCompanyName.MyProjectName.Data; using Serilog; using Serilog.Events; - +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName; @@ -42,6 +41,10 @@ public class Program .UseAutofac() .UseSerilog(); await builder.AddApplicationAsync(); + if (IsMigrateDatabase(args)) + { + builder.Services.AddDataMigrationEnvironment(); + } var app = builder.Build(); await app.InitializeApplicationAsync(); diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app/angular/package.json b/templates/app/angular/package.json index 75824dfc9c..bea2b83835 100644 --- a/templates/app/angular/package.json +++ b/templates/app/angular/package.json @@ -19,7 +19,7 @@ "@abp/ng.setting-management": "~6.0.0-rc.4", "@abp/ng.tenant-management": "~6.0.0-rc.4", "@abp/ng.theme.shared": "~6.0.0-rc.4", - "@abp/ng.theme.lepton-x": "~1.0.0-rc.4", + "@abp/ng.theme.lepton-x": "~2.0.0-preview20220912", "@angular/animations": "~13.3.3", "@angular/common": "~13.3.3", "@angular/compiler": "~13.3.3", diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj index 47e3d8abfc..92fb889665 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyCompanyName.MyProjectName.AuthServer.csproj @@ -43,7 +43,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json index b6958d08fa..b289be237c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/package.json @@ -3,6 +3,6 @@ "name": "my-app-authserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj index 91dab1bff0..9b83a0e083 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json index f04502147c..846190577e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/package.json @@ -3,7 +3,7 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4", - "@abp/aspnetcore.components.server.leptonxlitetheme": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912", + "@abp/aspnetcore.components.server.leptonxlitetheme": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj index de7bc577a6..9a0d99022c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json index f04502147c..846190577e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/package.json @@ -3,7 +3,7 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4", - "@abp/aspnetcore.components.server.leptonxlitetheme": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912", + "@abp/aspnetcore.components.server.leptonxlitetheme": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj index 8cd4c0d3c8..f6ebc44fba 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj @@ -23,7 +23,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs index 0b31a64ddd..92e723ba59 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Hosting; using MyCompanyName.MyProjectName.Data; using Serilog; using Volo.Abp; +using Volo.Abp.Data; namespace MyCompanyName.MyProjectName.DbMigrator; @@ -27,6 +28,7 @@ public class DbMigratorHostedService : IHostedService options.Services.ReplaceConfiguration(_configuration); options.UseAutofac(); options.Services.AddLogging(c => c.AddSerilog()); + options.AddDataMigrationEnvironment(); })) { await application.InitializeAsync(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs index 51bc87cd52..06c4b3d1b5 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyProjectNameDbMigratorModule.cs @@ -1,6 +1,5 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore; using Volo.Abp.Autofac; -using Volo.Abp.BackgroundJobs; using Volo.Abp.Modularity; namespace MyCompanyName.MyProjectName.DbMigrator; @@ -12,8 +11,5 @@ namespace MyCompanyName.MyProjectName.DbMigrator; )] public class MyProjectNameDbMigratorModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => options.IsJobExecutionEnabled = false); - } + } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/ar.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/ar.json index 3e5227a915..96bbf80b40 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/ar.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/ar.json @@ -2,7 +2,7 @@ "culture": "ar", "texts": { "Menu:Home": "الرئيسية", - "Welcome": "مرحبا", + "Menu:Home": "الصفحة الرئيسية", "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." } -} \ No newline at end of file +} diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.Designer.cs similarity index 88% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.Designer.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.Designer.cs index ae32d5daa9..0bde26a8f0 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.Designer.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.Designer.cs @@ -12,8 +12,8 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { - [DbContext(typeof(AuthServerDbContext))] - [Migration("20220617083652_Initial")] + [DbContext(typeof(MyProjectNameDbContext))] + [Migration("20220913013531_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,153 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -324,7 +471,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") @@ -371,7 +517,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("SourceTenantId") @@ -398,7 +543,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") @@ -475,7 +619,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Action") @@ -550,7 +693,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessFailedCount") @@ -834,7 +976,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Code") @@ -1273,6 +1414,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1307,6 +1501,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") @@ -1343,7 +1565,6 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.cs similarity index 87% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.cs index cbc01e3dfe..66d0345c4d 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220617083652_Initial.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220913013531_Initial.cs @@ -43,6 +43,27 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + JobName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "nvarchar(max)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "datetime2", nullable: false), + NextTryTime = table.Column(type: "datetime2", nullable: false), + LastTryTime = table.Column(type: "datetime2", nullable: true), + IsAbandoned = table.Column(type: "bit", nullable: false, defaultValue: false), + Priority = table.Column(type: "tinyint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpClaimTypes", columns: table => new @@ -63,6 +84,42 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +194,40 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -663,6 +754,11 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpAuditLogs", columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_AuditLogId", table: "AbpEntityChanges", @@ -678,6 +774,23 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -714,6 +827,23 @@ namespace MyCompanyName.MyProjectName.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -832,12 +962,21 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpAuditLogActions"); + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + migrationBuilder.DropTable( name: "AbpClaimTypes"); migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -850,6 +989,12 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs index 781691a3d2..886d835d39 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs @@ -344,6 +344,95 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpBackgroundJobs", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1323,6 +1412,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1357,6 +1499,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj index 1df4ec3e02..0d954718d8 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj @@ -25,7 +25,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj index 5b12cb50f3..382abd0d7c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj @@ -27,7 +27,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj index 4f2b5e268e..81e5609f91 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj @@ -41,7 +41,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json index f87d0b6ed1..c4ed9e7271 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~1.0.0-rc.4" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~2.0.0-preview20220912" } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.Designer.cs similarity index 91% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.Designer.cs index 1ea724aa5b..9a631c7b43 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.Designer.cs @@ -12,8 +12,8 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { - [DbContext(typeof(MyProjectNameDbContext))] - [Migration("20220617083228_Initial")] + [DbContext(typeof(AuthServerDbContext))] + [Migration("20220913013849_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,62 +288,93 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); - modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("nvarchar(40)") - .HasColumnName("ConcurrencyStamp"); + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); - b.Property("IsAbandoned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("JobArgs") + b.Property("GroupName") .IsRequired() - .HasMaxLength(1048576) - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); - b.Property("JobName") + b.Property("Name") .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); - b.Property("LastTryTime") - .HasColumnType("datetime2"); + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); - b.Property("NextTryTime") - .HasColumnType("datetime2"); + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); - b.Property("Priority") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint") - .HasDefaultValue((byte)15); + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); - b.Property("TryCount") + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)0); + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); - b.HasIndex("IsAbandoned", "NextTryTime"); + b.HasIndex("Name") + .IsUnique(); - b.ToTable("AbpBackgroundJobs", (string)null); + b.ToTable("AbpFeatureGroups", (string)null); }); modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => @@ -382,6 +413,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") @@ -428,6 +460,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("SourceTenantId") @@ -454,6 +487,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") @@ -530,6 +564,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Action") @@ -604,6 +639,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("AccessFailedCount") @@ -887,6 +923,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Code") @@ -1325,6 +1362,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1359,6 +1449,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") @@ -1395,6 +1513,7 @@ namespace MyCompanyName.MyProjectName.Migrations modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => { b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.cs similarity index 90% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.cs index 55ae609199..0f04de7baf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20220617083228_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/20220913013849_Initial.cs @@ -44,44 +44,59 @@ namespace MyCompanyName.MyProjectName.Migrations }); migrationBuilder.CreateTable( - name: "AbpBackgroundJobs", + name: "AbpClaimTypes", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - JobName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - JobArgs = table.Column(type: "nvarchar(max)", maxLength: 1048576, nullable: false), - TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), - CreationTime = table.Column(type: "datetime2", nullable: false), - NextTryTime = table.Column(type: "datetime2", nullable: false), - LastTryTime = table.Column(type: "datetime2", nullable: true), - IsAbandoned = table.Column(type: "bit", nullable: false, defaultValue: false), - Priority = table.Column(type: "tinyint", nullable: false, defaultValue: (byte)15), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "bit", nullable: false), + IsStatic = table.Column(type: "bit", nullable: false), + Regex = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) }, constraints: table => { - table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); migrationBuilder.CreateTable( - name: "AbpClaimTypes", + name: "AbpFeatureGroups", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - Required = table.Column(type: "bit", nullable: false), - IsStatic = table.Column(type: "bit", nullable: false), - Regex = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - RegexDescription = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - ValueType = table.Column(type: "int", nullable: false), - ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), - ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { - table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + table.PrimaryKey("PK_AbpFeatures", x => x.Id); }); migrationBuilder.CreateTable( @@ -158,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -684,11 +733,6 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpAuditLogs", columns: new[] { "TenantId", "UserId", "ExecutionTime" }); - migrationBuilder.CreateIndex( - name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", - table: "AbpBackgroundJobs", - columns: new[] { "IsAbandoned", "NextTryTime" }); - migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_AuditLogId", table: "AbpEntityChanges", @@ -704,6 +748,23 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -740,6 +801,23 @@ namespace MyCompanyName.MyProjectName.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -858,15 +936,18 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpAuditLogActions"); - migrationBuilder.DropTable( - name: "AbpBackgroundJobs"); - migrationBuilder.DropTable( name: "AbpClaimTypes"); migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -879,6 +960,12 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs index e483e20a49..f8618ceb41 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/Migrations/AuthServerDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -1271,6 +1360,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("OpenIddictTokens", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1305,6 +1447,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.Designer.cs similarity index 88% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.Designer.cs index da5ce77b3f..be2db0118e 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20220617083658_Initial")] + [Migration("20220913013738_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,95 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -932,6 +1021,59 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpOrganizationUnitRoles", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -966,6 +1108,34 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.cs similarity index 87% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.cs index f575db2142..9ea6264819 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220617083658_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/20220913013738_Initial.cs @@ -63,6 +63,42 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -545,6 +615,23 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -581,6 +668,23 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -675,6 +779,12 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -687,6 +797,12 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs index 7ef4a80da0..4075c6614f 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -930,6 +1019,59 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpOrganizationUnitRoles", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -964,6 +1106,34 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.Designer.cs similarity index 88% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.Designer.cs index e9f1df7c94..3f4920a34b 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20220617083659_Initial")] + [Migration("20220913013700_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -288,6 +288,95 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -932,6 +1021,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpOrganizationUnitRoles", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -966,6 +1108,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.cs similarity index 87% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.cs index b02029a8cd..b24184d7d4 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220617083659_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20220913013700_Initial.cs @@ -63,6 +63,42 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "bit", nullable: false), + IsAvailableToHost = table.Column(type: "bit", nullable: false), + AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new @@ -137,6 +173,40 @@ namespace MyCompanyName.MyProjectName.Migrations table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new @@ -545,6 +615,23 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpEntityPropertyChanges", column: "EntityChangeId"); + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", @@ -581,6 +668,23 @@ namespace MyCompanyName.MyProjectName.Migrations unique: true, filter: "[TenantId] IS NOT NULL"); + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", @@ -675,6 +779,12 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + migrationBuilder.DropTable( name: "AbpFeatureValues"); @@ -687,6 +797,12 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpPermissionGrants"); + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + migrationBuilder.DropTable( name: "AbpRoleClaims"); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index 39b8871ef6..2329a1d737 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -286,6 +286,95 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpEntityPropertyChanges", (string)null); }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => { b.Property("Id") @@ -930,6 +1019,59 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpOrganizationUnitRoles", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -964,6 +1106,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id")