From 69f919d7aa81ade6377a07c7653cf8b16c44b726 Mon Sep 17 00:00:00 2001 From: Necati Meral Date: Mon, 6 Jul 2020 10:07:26 +0200 Subject: [PATCH 01/41] german language files encoding --- .../Localization/Resources/AbpDdd/de.json | 2 +- .../Volo/Abp/Emailing/Localization/de.json | 12 +-- .../Localization/Resources/AbpUi/de.json | 36 ++++---- .../Volo/Abp/Validation/Localization/de.json | 46 +++++------ .../Mvc/Localization/Resource/de.json | 2 +- .../Account/Localization/Resources/de.json | 24 +++--- .../Blogging/ApplicationContracts/de.json | 2 +- .../Blogging/Localization/Resources/de.json | 12 +-- .../Localization/Domain/de.json | 2 +- .../Volo/Abp/Identity/Localization/de.json | 82 +++++++++---------- .../Localization/Domain/de.json | 2 +- .../Localization/Resources/de.json | 4 +- 12 files changed, 113 insertions(+), 113 deletions(-) diff --git a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/de.json b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/de.json index b96b58c2b3..42bc7edb13 100644 --- a/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/de.json +++ b/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Localization/Resources/AbpDdd/de.json @@ -1,6 +1,6 @@ { "culture": "de", "texts": { - "MaxResultCountExceededExceptionMessage": "{0} kann nicht mehr als {1} sein! Erhöhen Sie {2}.{3} auf der Serverseite, um mehr Ergebnisse zu ermöglichen." + "MaxResultCountExceededExceptionMessage": "{0} kann nicht mehr als {1} sein! Erhöhen Sie {2}.{3} auf der Serverseite, um mehr Ergebnisse zu ermöglichen." } } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/de.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/de.json index 8d6ae8c9ff..b2de67d39e 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/de.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/de.json @@ -12,12 +12,12 @@ "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Standard-Anmeldeinformationen verwenden", "Description:Abp.Mailing.DefaultFromAddress": "Die Standard-Absenderadresse", "Description:Abp.Mailing.DefaultFromDisplayName": "Der Standard-Absendername", - "Description:Abp.Mailing.Smtp.Host": "Der Name oder die IP-Adresse des für SMTP-Transaktionen verwendeten Hosts.", - "Description:Abp.Mailing.Smtp.Port": "Der für SMTP-Transaktionen verwendete Port.", - "Description:Abp.Mailing.Smtp.UserName": "Benutzername, der mit den Anmeldedaten verknüpft ist.", - "Description:Abp.Mailing.Smtp.Password": "Das Passwort für den Benutzernamen, der mit den Anmeldeinformationen verknüpft ist.", - "Description:Abp.Mailing.Smtp.Domain": "Die Domäne oder der Computername, der die Anmeldeinformationen verifiziert.", - "Description:Abp.Mailing.Smtp.EnableSsl": "Bestimmt, ob der SmptClient Secure Sockets Layer (SSL) zur Verschlüsselung der Verbindung verwendet.", + "Description:Abp.Mailing.Smtp.Host": "Der Name oder die IP-Adresse des für SMTP-Transaktionen verwendeten Hosts.", + "Description:Abp.Mailing.Smtp.Port": "Der für SMTP-Transaktionen verwendete Port.", + "Description:Abp.Mailing.Smtp.UserName": "Benutzername, der mit den Anmeldedaten verknüpft ist.", + "Description:Abp.Mailing.Smtp.Password": "Das Passwort für den Benutzernamen, der mit den Anmeldeinformationen verknüpft ist.", + "Description:Abp.Mailing.Smtp.Domain": "Die Domäne oder der Computername, der die Anmeldeinformationen verifiziert.", + "Description:Abp.Mailing.Smtp.EnableSsl": "Bestimmt, ob der SmptClient Secure Sockets Layer (SSL) zur Verschlüsselung der Verbindung verwendet.", "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Bestimmt, ob die DefaultCredentials mit Anfragen gesendet werden." } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json index a663b772be..c5de3f200c 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json @@ -1,18 +1,18 @@ { "culture": "de", "texts": { - "InternalServerErrorMessage": "Während Ihrer Anfrage ist ein interner Fehler aufgetreten!", - "ValidationErrorMessage": "Ihre Anfrage ist nicht gültig!", + "InternalServerErrorMessage": "Während Ihrer Anfrage ist ein interner Fehler aufgetreten!", + "ValidationErrorMessage": "Ihre Anfrage ist nicht gültig!", "ValidationNarrativeErrorMessageTitle": "Die folgenden Fehler wurden bei der Validierung entdeckt.", "DefaultErrorMessage": "Ein Fehler ist aufgetreten!", "DefaultErrorMessageDetail": "Es wurden keine Fehlerdetails vom Server gesendet.", "DefaultErrorMessage401": "Sie sind nicht authentifiziert.", - "DefaultErrorMessage401Detail": "Sie sollten sich anmelden, um diese Operation durchzuführen.", + "DefaultErrorMessage401Detail": "Sie sollten sich anmelden, um diese Operation durchzuführen.", "DefaultErrorMessage403": "Sie sind nicht autorisiert!", - "DefaultErrorMessage403Detail": "Es ist Ihnen nicht erlaubt, diese Operation durchzuführen!", + "DefaultErrorMessage403Detail": "Es ist Ihnen nicht erlaubt, diese Operation durchzuführen!", "DefaultErrorMessage404": "Ressource nicht gefunden!", "DefaultErrorMessage404Detail": "Die angeforderte Ressource konnte auf dem Server nicht gefunden werden!", - "EntityNotFoundErrorMessage": "Es gibt keine Entität {0} mit id = {1}!", + "EntityNotFoundErrorMessage": "Es gibt keine Entität {0} mit id = {1}!", "Languages": "Sprachen", "Error": "Fehler", "AreYouSure": "Sind Sie sicher?", @@ -20,11 +20,11 @@ "Yes": "Ja", "No": "Nein", "Ok": "Ok", - "Close": "Schließen", + "Close": "Schließen", "Save": "Speichern", "SavingWithThreeDot": "Speichere...", "Actions": "Aktionen", - "Delete": "Löschen", + "Delete": "Löschen", "Edit": "Bearbeiten", "Refresh": "Aktualisieren", "Language": "Sprache", @@ -36,28 +36,28 @@ "Register": "Registrieren", "Logout": "Abmelden", "Submit": "Absenden", - "Back": "Zurück", + "Back": "Zurück", "PagerSearch": "Suchen", - "PagerNext": "Nächste", + "PagerNext": "Nächste", "PagerPrevious": "Vorherige", "PagerFirst": "Erste", "PagerLast": "Letzte", - "PagerInfo": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen", - "PagerInfo{0}{1}{2}": "Zeige {0} bis {1} von {2} Einträgen", - "PagerInfoEmpty": "Zeige 0 bis 0 von 0 Einträgen", - "PagerInfoFiltered": "(gefiltert von _MAX_ Einträgen insgesamt)", - "NoDataAvailableInDatatable": "Keine Daten verfügbar", - "PagerShowMenuEntries": "Zeige _MENU_ Einträge", + "PagerInfo": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen", + "PagerInfo{0}{1}{2}": "Zeige {0} bis {1} von {2} Einträgen", + "PagerInfoEmpty": "Zeige 0 bis 0 von 0 Einträgen", + "PagerInfoFiltered": "(gefiltert von _MAX_ Einträgen insgesamt)", + "NoDataAvailableInDatatable": "Keine Daten verfügbar", + "PagerShowMenuEntries": "Zeige _MENU_ Einträge", "DatatableActionDropdownDefaultText": "Aktionen", - "ChangePassword": "Passwort ändern", + "ChangePassword": "Passwort ändern", "PersonalInfo": "Mein Profil", - "AreYouSureYouWantToCancelEditingWarningMessage": "Sie haben ungespeicherte Änderungen.", + "AreYouSureYouWantToCancelEditingWarningMessage": "Sie haben ungespeicherte Änderungen.", "UnhandledException": "Unerwartete Ausnahme!", "401Message": "Unauthorisiert", "403Message": "Verboten", "404Message": "Seite nicht gefunden", "500Message": "Internet Server Fehler", "GoHomePage": "Zur Startseite", - "GoBack": "Zurück" + "GoBack": "Zurück" } } diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/de.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/de.json index 1e0e10716a..6c48a6c1fa 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/de.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/de.json @@ -1,34 +1,34 @@ { "culture": "de", "texts": { - "'{0}' and '{1}' do not match.": "'{0}' und '{1}' stimmen nicht überein.", - "The {0} field is not a valid credit card number.": "Das Feld {0} ist keine gültige Kreditkartennummer.", - "{0} is not valid.": "{0} ist nicht gültig.", - "The {0} field is not a valid e-mail address.": "Das Feld {0} ist keine gültige E-Mail-Adresse.", + "'{0}' and '{1}' do not match.": "'{0}' und '{1}' stimmen nicht überein.", + "The {0} field is not a valid credit card number.": "Das Feld {0} ist keine gültige Kreditkartennummer.", + "{0} is not valid.": "{0} ist nicht gültig.", + "The {0} field is not a valid e-mail address.": "Das Feld {0} ist keine gültige E-Mail-Adresse.", "The {0} field only accepts files with the following extensions: {1}": "Das Feld {0} akzeptiert nur Dateien mit den folgenden Erweiterungen: {1}", - "The field {0} must be a string or array type with a maximum length of '{1}'.": "Das Feld {0} muss eine Zeichenfolge oder Auflistung mit einer maximalen Länge von '{1}' sein.", - "The field {0} must be a string or array type with a minimum length of '{1}'.": "Das Feld {0} muss eine Zeichenfolge oder Auflistung mit einer Mindestlänge von '{1}' sein.", - "The {0} field is not a valid phone number.": "Das Feld {0} ist keine gültige Telefonnummer.", + "The field {0} must be a string or array type with a maximum length of '{1}'.": "Das Feld {0} muss eine Zeichenfolge oder Auflistung mit einer maximalen Länge von '{1}' sein.", + "The field {0} must be a string or array type with a minimum length of '{1}'.": "Das Feld {0} muss eine Zeichenfolge oder Auflistung mit einer Mindestlänge von '{1}' sein.", + "The {0} field is not a valid phone number.": "Das Feld {0} ist keine gültige Telefonnummer.", "The field {0} must be between {1} and {2}.": "Das Feld {0} muss zwischen {1} und {2} liegen.", - "The field {0} must match the regular expression '{1}'.": "Das Feld {0} muss dem regulären Ausdruck '{1}' entsprechen.", + "The field {0} must match the regular expression '{1}'.": "Das Feld {0} muss dem regulären Ausdruck '{1}' entsprechen.", "The {0} field is required.": "Das Feld {0} ist erforderlich.", - "The field {0} must be a string with a maximum length of {1}.": "Das Feld {0} muss eine Zeichenfolge mit einer maximalen Länge von {1} sein.", - "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "Das Feld {0} muss eine Zeichenfolge mit einer minimalen Länge von {2} und einer maximalen Länge von {1} sein.", - "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "Das {0}-Feld ist keine gültige vollqualifizierte http-, https- oder ftp-URL.", - "The field {0} is invalid.": "Das Feld {0} ist ungültig.", - "ThisFieldIsNotAValidCreditCardNumber.": "Dieses Feld ist keine gültige Kreditkartennummer.", - "ThisFieldIsNotValid.": "Dieses Feld ist nicht gültig.", - "ThisFieldIsNotAValidEmailAddress.": "Dieses Feld ist keine gültige E-Mail-Adresse.", + "The field {0} must be a string with a maximum length of {1}.": "Das Feld {0} muss eine Zeichenfolge mit einer maximalen Länge von {1} sein.", + "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "Das Feld {0} muss eine Zeichenfolge mit einer minimalen Länge von {2} und einer maximalen Länge von {1} sein.", + "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "Das {0}-Feld ist keine gültige vollqualifizierte http-, https- oder ftp-URL.", + "The field {0} is invalid.": "Das Feld {0} ist ungültig.", + "ThisFieldIsNotAValidCreditCardNumber.": "Dieses Feld ist keine gültige Kreditkartennummer.", + "ThisFieldIsNotValid.": "Dieses Feld ist nicht gültig.", + "ThisFieldIsNotAValidEmailAddress.": "Dieses Feld ist keine gültige E-Mail-Adresse.", "ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "Dieses Feld akzeptiert nur Dateien mit den folgenden Erweiterungen: {0}", - "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge oder Auflistung mit einer maximalen Länge von '{0}' sein.", - "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge oder Auflistung mit einer Mindestlänge von '{0}' sein.", - "ThisFieldIsNotAValidPhoneNumber.": "Dieses Feld ist keine gültige Telefonnummer.", + "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge oder Auflistung mit einer maximalen Länge von '{0}' sein.", + "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge oder Auflistung mit einer Mindestlänge von '{0}' sein.", + "ThisFieldIsNotAValidPhoneNumber.": "Dieses Feld ist keine gültige Telefonnummer.", "ThisFieldMustBeBetween{0}And{1}": "Dieses Feld muss zwischen {0} und {1} liegen.", - "ThisFieldMustMatchTheRegularExpression{0}": "Dieses Feld muss dem regulären Ausdruck '{0}' entsprechen.", + "ThisFieldMustMatchTheRegularExpression{0}": "Dieses Feld muss dem regulären Ausdruck '{0}' entsprechen.", "ThisFieldIsRequired.": "Dieses Feld ist erforderlich.", - "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge mit einer maximalen Länge von {0} sein.", - "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge mit einer Mindestlänge von '{0}' sein.", - "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "Dieses Feld ist keine gültige vollqualifizierte http-, https- oder ftp-URL.", - "ThisFieldIsInvalid.": "Dieses Feld ist ungültig." + "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge mit einer maximalen Länge von {0} sein.", + "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Dieses Feld muss eine Zeichenfolge mit einer Mindestlänge von '{0}' sein.", + "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "Dieses Feld ist keine gültige vollqualifizierte http-, https- oder ftp-URL.", + "ThisFieldIsInvalid.": "Dieses Feld ist ungültig." } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/de.json b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/de.json index e5b59a1915..f5c2e651b5 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/de.json +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/de.json @@ -2,6 +2,6 @@ "culture": "de", "texts": { "BirthDate": "Geburtsdatum", - "Value1": "Wert Eins" + "Value1": "Wert Eins" } } \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json index 935fff56a6..d772f2e801 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json @@ -8,22 +8,22 @@ "RememberMe": "Angemeldet bleiben", "UseAnotherServiceToLogin": "Einen anderen Dienst zum Anmelden verwenden", "UserLockedOutMessage": "Das Benutzerkonto wurde aufgrund fehlgeschlagener Anmeldeversuche gesperrt. Bitte warten Sie eine Weile und versuchen Sie es erneut.", - "InvalidUserNameOrPassword": "Ungültiger Benutzername oder Passwort!", - "LoginIsNotAllowed": "Sie dürfen sich nicht anmelden! Sie müssen Ihre E-Mail/Telefonnummer bestätigen.", - "SelfRegistrationDisabledMessage": "Die Selbstregistrierung ist für diese Anwendung deaktiviert. Bitte wenden Sie sich an den Anwendungsadministrator, um einen neuen Benutzer zu registrieren.", - "LocalLoginDisabledMessage": "Die lokale Anmeldung ist für diese Anwendung deaktiviert.", + "InvalidUserNameOrPassword": "Ungültiger Benutzername oder Passwort!", + "LoginIsNotAllowed": "Sie dürfen sich nicht anmelden! Sie müssen Ihre E-Mail/Telefonnummer bestätigen.", + "SelfRegistrationDisabledMessage": "Die Selbstregistrierung ist für diese Anwendung deaktiviert. Bitte wenden Sie sich an den Anwendungsadministrator, um einen neuen Benutzer zu registrieren.", + "LocalLoginDisabledMessage": "Die lokale Anmeldung ist für diese Anwendung deaktiviert.", "Login": "Anmelden", "Cancel": "Abbrechen", "Register": "Registrieren", "AreYouANewUser": "Neuer Benutzer?", "AlreadyRegistered": "Bereits registriert?", - "InvalidLoginRequest": "Ungültige Login-Anfrage", - "ThereAreNoLoginSchemesConfiguredForThisClient": "Es sind keine Anmeldeschemata für diesen Client konfiguriert.", + "InvalidLoginRequest": "Ungültige Login-Anfrage", + "ThereAreNoLoginSchemesConfiguredForThisClient": "Es sind keine Anmeldeschemata für diesen Client konfiguriert.", "LogInUsingYourProviderAccount": "Melden Sie sich mit Ihrem {0}-Konto an", "DisplayName:CurrentPassword": "Aktuelles Passwort", "DisplayName:NewPassword": "Neues Passwort", - "DisplayName:NewPasswordConfirm": "Neues Passwort bestätigen", - "PasswordChangedMessage": "Ihr Passwort wurde erfolgreich geändert.", + "DisplayName:NewPasswordConfirm": "Neues Passwort bestätigen", + "PasswordChangedMessage": "Ihr Passwort wurde erfolgreich geändert.", "DisplayName:UserName": "Benutzername", "DisplayName:Email": "E-Mail", "DisplayName:Name": "Name", @@ -31,10 +31,10 @@ "DisplayName:Password": "Passwort", "DisplayName:EmailAddress": "E-Mail-Adresse", "DisplayName:PhoneNumber": "Telefonnummer", - "PersonalSettings": "Persönliche Einstellungen", - "PersonalSettingsSaved": "Persönliche Einstellungen gespeichert", - "PasswordChanged": "Passwort geändert", - "NewPasswordConfirmFailed": "Bitte bestätigen Sie das neue Passwort.", + "PersonalSettings": "Persönliche Einstellungen", + "PersonalSettingsSaved": "Persönliche Einstellungen gespeichert", + "PasswordChanged": "Passwort geändert", + "NewPasswordConfirmFailed": "Bitte bestätigen Sie das neue Passwort.", "Manage": "Verwalten", "ManageYourProfile": "Ihr profil verwalten", "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Ist die Selbstregistrierung aktiviert", diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json index 9f2a7d4510..148ad9bd63 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json @@ -3,7 +3,7 @@ "texts": { "Permission:Blogging": "Blog", "Permission:Blogs": "Blogs", - "Permission:Posts": "Beitr�ge", + "Permission:Posts": "Beiträge", "Permission:Tags": "Tags", "Permission:Comments": "Kommentare" } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/de.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/de.json index 6489396692..3fbc74285e 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/de.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/de.json @@ -4,7 +4,7 @@ "Menu:Blogs": "Blogs", "Menu:BlogManagement": "Blog-Verwaltung", "Title": "Titel", - "Delete": "Löschen", + "Delete": "Löschen", "Reply": "Antwort", "ReplyTo": "Antwort auf {0}", "ContinueReading": "Weiterlesen", @@ -20,15 +20,15 @@ "SeeAll": "Alle anzeigen", "PopularTags": "Beliebte Tags", "WiewsWithCount": "{0} Aufrufe", - "LastPosts": "Letzte Beiträge", + "LastPosts": "Letzte Beiträge", "LeaveComment": "Kommentar hinterlassen", "TagsInThisArticle": "Tags in diesem Artikel", - "Posts": "Beiträge", + "Posts": "Beiträge", "Edit": "Bearbeiten", "BLOG": "BLOG", - "CommentDeletionWarningMessage": "Kommentar wird gelöscht.", - "PostDeletionWarningMessage": "Beitrag wird gelöscht.", - "BlogDeletionWarningMessage": "Blog wird gelöscht.", + "CommentDeletionWarningMessage": "Kommentar wird gelöscht.", + "PostDeletionWarningMessage": "Beitrag wird gelöscht.", + "BlogDeletionWarningMessage": "Blog wird gelöscht.", "AreYouSure": "Sind Sie sicher?", "CommentWithCount": "{0} Kommentare", "Comment": "Kommentar", diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json index 848bd4bb28..12a4e1aef0 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain.Shared/Volo/Abp/FeatureManagement/Localization/Domain/de.json @@ -2,6 +2,6 @@ "culture": "de", "texts": { "Features": "Funktionen", - "NoFeatureFoundMessage": "Es ist keine Funktion verfügbar." + "NoFeatureFoundMessage": "Es ist keine Funktion verfügbar." } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json index 0c8ba47b66..ccd2b60cfc 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/de.json @@ -1,7 +1,7 @@ { "culture": "de", "texts": { - "Menu:IdentityManagement": "Identitätsverwaltung", + "Menu:IdentityManagement": "Identitätsverwaltung", "Users": "Benutzer", "NewUser": "Neuer Benutzer", "UserName": "Benutzername", @@ -10,13 +10,13 @@ "UserInformations": "Benutzerinformationen", "DisplayName:IsDefault": "Standard", "DisplayName:IsStatic": "Statisch", - "DisplayName:IsPublic": "Öffentlich", + "DisplayName:IsPublic": "Öffentlich", "Roles": "Rollen", "Password": "Passwort", "PersonalInfo": "Mein Profil", - "PersonalSettings": "Persönliche Einstellungen", - "UserDeletionConfirmationMessage": "Der Benutzer '{0}' wird gelöscht. Sind Sie sicher?", - "RoleDeletionConfirmationMessage": "Die Rolle '{0}' wird gelöscht. Sind Sie sicher?", + "PersonalSettings": "Persönliche Einstellungen", + "UserDeletionConfirmationMessage": "Der Benutzer '{0}' wird gelöscht. Sind Sie sicher?", + "RoleDeletionConfirmationMessage": "Die Rolle '{0}' wird gelöscht. Sind Sie sicher?", "DisplayName:RoleName": "Rollenname", "DisplayName:UserName": "Benutzername", "DisplayName:Name": "Name", @@ -32,72 +32,72 @@ "Permissions": "Berechtigungen", "DisplayName:CurrentPassword": "Aktuelles Passwort", "DisplayName:NewPassword": "Neues Passwort", - "DisplayName:NewPasswordConfirm": "Neues Passwort bestätigen", - "PasswordChangedMessage": "Ihr Passwort wurde erfolgreich geändert.", - "PersonalSettingsSavedMessage": "Ihre persönlichen Einstellungen wurden erfolgreich gespeichert.", + "DisplayName:NewPasswordConfirm": "Neues Passwort bestätigen", + "PasswordChangedMessage": "Ihr Passwort wurde erfolgreich geändert.", + "PersonalSettingsSavedMessage": "Ihre persönlichen Einstellungen wurden erfolgreich gespeichert.", "Identity.DefaultError": "Ein unbekannter Fehler ist aufgetreten.", - "Identity.ConcurrencyFailure": "Optimistischer Nebenläufigkeitsfehler, Objekt wurde geändert.", + "Identity.ConcurrencyFailure": "Optimistischer Nebenläufigkeitsfehler, Objekt wurde geändert.", "Identity.DuplicateEmail": "E-Mail '{0}' ist bereits vergeben.", "Identity.DuplicateRoleName": "Der Rollenname '{0}' ist bereits vergeben.", "Identity.DuplicateUserName": "Der Benutzername '{0}' ist bereits vergeben.", - "Identity.InvalidEmail": "E-Mail '{0}' ist ungültig.", - "Identity.InvalidPasswordHasherCompatibilityMode": "Der angegebene PasswordHasherCompatibilityMode ist ungültig.", + "Identity.InvalidEmail": "E-Mail '{0}' ist ungültig.", + "Identity.InvalidPasswordHasherCompatibilityMode": "Der angegebene PasswordHasherCompatibilityMode ist ungültig.", "Identity.InvalidPasswordHasherIterationCount": "Die Iterationszahl muss eine positive Ganzzahl sein.", - "Identity.InvalidRoleName": "Der Rollenname '{0}' ist ungültig.", - "Identity.InvalidToken": "Ungültiges Token.", - "Identity.InvalidUserName": "Benutzername '{0}' ist ungültig, kann nur Buchstaben oder Ziffern enthalten.", + "Identity.InvalidRoleName": "Der Rollenname '{0}' ist ungültig.", + "Identity.InvalidToken": "Ungültiges Token.", + "Identity.InvalidUserName": "Benutzername '{0}' ist ungültig, kann nur Buchstaben oder Ziffern enthalten.", "Identity.LoginAlreadyAssociated": "Ein Benutzer mit diesem Login existiert bereits.", "Identity.PasswordMismatch": "Falsches Passwort.", - "Identity.PasswordRequiresDigit": "Passwörter müssen mindestens eine Ziffer ('0'-'9') enthalten.", - "Identity.PasswordRequiresLower": "Passwörter müssen mindestens einen Kleinbuchstaben ('a'-'z') enthalten.", - "Identity.PasswordRequiresNonAlphanumeric": "Passwörter müssen mindestens ein Sonderzeichen enthalten.", - "Identity.PasswordRequiresUpper": "Passwörter müssen mindestens einen Großbuchstaben ('A'-'Z') enthalten.", - "Identity.PasswordTooShort": "Passwörter müssen mindestens {0} Zeichen enthalten.", + "Identity.PasswordRequiresDigit": "Passwörter müssen mindestens eine Ziffer ('0'-'9') enthalten.", + "Identity.PasswordRequiresLower": "Passwörter müssen mindestens einen Kleinbuchstaben ('a'-'z') enthalten.", + "Identity.PasswordRequiresNonAlphanumeric": "Passwörter müssen mindestens ein Sonderzeichen enthalten.", + "Identity.PasswordRequiresUpper": "Passwörter müssen mindestens einen Großbuchstaben ('A'-'Z') enthalten.", + "Identity.PasswordTooShort": "Passwörter müssen mindestens {0} Zeichen enthalten.", "Identity.RoleNotFound": "Die Rolle {0} existiert nicht.", "Identity.UserAlreadyHasPassword": "Der Benutzer hat bereits ein Passwort gesetzt.", "Identity.UserAlreadyInRole": "Benutzer ist bereits in der Rolle '{0}'.", "Identity.UserLockedOut": "Benutzer ist ausgesperrt.", - "Identity.UserLockoutNotEnabled": "Aussperrung ist für diesen Benutzer nicht aktiviert.", + "Identity.UserLockoutNotEnabled": "Aussperrung ist für diesen Benutzer nicht aktiviert.", "Identity.UserNameNotFound": "Benutzer {0} existiert nicht.", "Identity.UserNotInRole": "Benutzer ist nicht in der Rolle '{0}'.", - "Identity.PasswordConfirmationFailed": "Passwort stimmt nicht mit dem Bestätigungspasswort überein.", - "Identity.StaticRoleRenamingErrorMessage": "Statische Rollen können nicht umbenannt werden.", - "Identity.StaticRoleDeletionErrorMessage": "Statische Rollen können nicht gelöscht werden.", - "Volo.Abp.Identity:010001": "Sie können Ihr eigenes Konto nicht löschen!", - "Permission:IdentityManagement": "Identitätsverwaltung", + "Identity.PasswordConfirmationFailed": "Passwort stimmt nicht mit dem Bestätigungspasswort überein.", + "Identity.StaticRoleRenamingErrorMessage": "Statische Rollen können nicht umbenannt werden.", + "Identity.StaticRoleDeletionErrorMessage": "Statische Rollen können nicht gelöscht werden.", + "Volo.Abp.Identity:010001": "Sie können Ihr eigenes Konto nicht löschen!", + "Permission:IdentityManagement": "Identitätsverwaltung", "Permission:RoleManagement": "Rollenverwaltung", "Permission:Create": "Erstellen", "Permission:Edit": "Bearbeiten", - "Permission:Delete": "Löschen", - "Permission:ChangePermissions": "Berechtigungen ändern", + "Permission:Delete": "Löschen", + "Permission:ChangePermissions": "Berechtigungen ändern", "Permission:UserManagement": "Benutzerverwaltung", "Permission:UserLookup": "Benutzer-Lookup", - "DisplayName:Abp.Identity.Password.RequiredLength": "Erforderliche Länge", + "DisplayName:Abp.Identity.Password.RequiredLength": "Erforderliche Länge", "DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Erforderliche eindeutige Zeichenanzahl", "DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Erforderliches Sonderzeichen", "DisplayName:Abp.Identity.Password.RequireLowercase": "Erforderliche Kleinbuchstaben", - "DisplayName:Abp.Identity.Password.RequireUppercase": "Erforderliche Großbuchstaben", + "DisplayName:Abp.Identity.Password.RequireUppercase": "Erforderliche Großbuchstaben", "DisplayName:Abp.Identity.Password.RequireDigit": "Erforderliche Ziffer", - "DisplayName:Abp.Identity.Lockout.AllowedForNewUsers": "Aktiviert für neue Benutzer", + "DisplayName:Abp.Identity.Lockout.AllowedForNewUsers": "Aktiviert für neue Benutzer", "DisplayName:Abp.Identity.Lockout.LockoutDuration": "Aussperrdauer (Sekunden)", "DisplayName:Abp.Identity.Lockout.MaxFailedAccessAttempts": "Max fehlgeschlagene Zugriffsversuche", - "DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail": "Bestätigte E-Mail erforderlich", - "DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Telefonnummer-Bestätigung aktivieren", - "DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Bestätigte Telefonnummer erforderlich", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedEmail": "Bestätigte E-Mail erforderlich", + "DisplayName:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Telefonnummer-Bestätigung aktivieren", + "DisplayName:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Bestätigte Telefonnummer erforderlich", "DisplayName:Abp.Identity.User.IsUserNameUpdateEnabled": "Ist die Aktualisierung des Benutzernamens aktiviert?", "DisplayName:Abp.Identity.User.IsEmailUpdateEnabled": "Ist die E-Mail-Aktualisierung aktiviert?", - "Description:Abp.Identity.Password.RequiredLength": "Die Mindestlänge, die ein Passwort haben muss.", + "Description:Abp.Identity.Password.RequiredLength": "Die Mindestlänge, die ein Passwort haben muss.", "Description:Abp.Identity.Password.RequiredUniqueChars": "Die Mindestanzahl eindeutiger Zeichen, die ein Passwort enthalten muss.", - "Description:Abp.Identity.Password.RequireNonAlphanumeric": "Ob Passwörter ein nicht-alphanumerisches Zeichen enthalten müssen.", - "Description:Abp.Identity.Password.RequireLowercase": "Ob Passwörter ein kleingeschriebenes ASCII-Zeichen enthalten müssen.", - "Description:Abp.Identity.Password.RequireUppercase": "Ob Passwörter ein ASCII-Zeichen in Großbuchstaben enthalten müssen.", - "Description:Abp.Identity.Password.RequireDigit": "Ob Passwörter eine Ziffer enthalten müssen.", + "Description:Abp.Identity.Password.RequireNonAlphanumeric": "Ob Passwörter ein nicht-alphanumerisches Zeichen enthalten müssen.", + "Description:Abp.Identity.Password.RequireLowercase": "Ob Passwörter ein kleingeschriebenes ASCII-Zeichen enthalten müssen.", + "Description:Abp.Identity.Password.RequireUppercase": "Ob Passwörter ein ASCII-Zeichen in Großbuchstaben enthalten müssen.", + "Description:Abp.Identity.Password.RequireDigit": "Ob Passwörter eine Ziffer enthalten müssen.", "Description:Abp.Identity.Lockout.AllowedForNewUsers": "Ob ein neuer Benutzer ausgesperrt werden kann.", - "Description:Abp.Identity.Lockout.LockoutDuration": "Die Dauer, für die ein Benutzer ausgesperrt ist, wenn eine Sperre auftritt.", + "Description:Abp.Identity.Lockout.LockoutDuration": "Die Dauer, für die ein Benutzer ausgesperrt ist, wenn eine Sperre auftritt.", "Description:Abp.Identity.Lockout.MaxFailedAccessAttempts": "Die Anzahl der fehlgeschlagenen Zugriffsversuche, die erlaubt sind, bevor ein Benutzer gesperrt wird, vorausgesetzt, die Sperre ist aktiviert.", "Description:Abp.Identity.SignIn.RequireConfirmedEmail": "Whether a confirmed email address is required to sign in.", - "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Ob für die Anmeldung eine bestätigte E-Mail-Adresse erforderlich ist.", - "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Ob für die Anmeldung eine bestätigte Telefonnummer erforderlich ist.", + "Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Ob für die Anmeldung eine bestätigte E-Mail-Adresse erforderlich ist.", + "Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Ob für die Anmeldung eine bestätigte Telefonnummer erforderlich ist.", "Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Ob der Benutzername vom Benutzer aktualisiert werden kann.", "Description:Abp.Identity.User.IsEmailUpdateEnabled": "Ob die E-Mail durch den Benutzer aktualisiert werden kann." } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/de.json b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/de.json index c556183e4c..434b6cc772 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/de.json +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/Localization/Domain/de.json @@ -5,6 +5,6 @@ "OnlyProviderPermissons": "Nur dieser Anbieter", "All": "Alle", "SelectAllInAllTabs": "Alle Berechtigungen erteilen", - "SelectAllInThisTab": "Alle auswählen" + "SelectAllInThisTab": "Alle auswählen" } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de.json b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de.json index e0a7730933..d011f8391f 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de.json +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/Localization/Resources/de.json @@ -6,14 +6,14 @@ "NewTenant": "Neuer Mandant", "TenantName": "Mandantenname", "DisplayName:TenantName": "Mandantenname", - "TenantDeletionConfirmationMessage": "Der Mandant '{0}' wird gelöscht. Sind Sie sicher?", + "TenantDeletionConfirmationMessage": "Der Mandant '{0}' wird gelöscht. Sind Sie sicher?", "ConnectionStrings": "Verbindungszeichenfolgen", "DisplayName:DefaultConnectionString": "Standard Verbindungszeichenfolge", "DisplayName:UseSharedDatabase": "Nutze die gemeinsame Datenbank", "Permission:TenantManagement": "Mandantenverwaltung", "Permission:Create": "Erstellen", "Permission:Edit": "Bearbeiten", - "Permission:Delete": "Löschen", + "Permission:Delete": "Löschen", "Permission:ManageConnectionStrings": "Verbindungszeichenfolgen verwalten", "Permission:ManageFeatures": "Funktionen verwalten", "DisplayName:AdminEmailAddress": "Admin E-Mail-Adresse", From c47e990b1fff626e9ff782b7d72f7ea9685e632b Mon Sep 17 00:00:00 2001 From: Necati Meral Date: Mon, 6 Jul 2020 10:07:55 +0200 Subject: [PATCH 02/41] Added a test for special characters --- .../Volo/Abp/Localization/AbpLocalization_Tests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 71c2fafe2e..475629b4f0 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 @@ -148,7 +148,10 @@ namespace Volo.Abp.Localization _localizer["MaxLenghtErrorMessage", 42].Value.ShouldBe("El campo puede tener un máximo de '42' caracteres"); //Overriden in Source/es.json } - + using (CultureHelper.Use("de")) + { + _localizer["MaxLenghtErrorMessage", 42].Value.ShouldBe("Die Länge dieses Feldes kann maximal '42'-Zeichen betragen"); //Overriden in Source/es.json + } } [Fact] From cdd2573033180602535b3a0d53bbb3a410e21897 Mon Sep 17 00:00:00 2001 From: Necati Meral Date: Mon, 6 Jul 2020 10:13:06 +0200 Subject: [PATCH 03/41] dutch localization files encoding --- .../Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/nl.json | 2 +- .../Abp/Localization/TestResources/Base/CountryNames/nl.json | 2 +- .../Abp/Localization/TestResources/Base/Validation/nl.json | 2 +- .../Volo/Abp/Localization/TestResources/Source/nl.json | 2 +- .../Volo/Abp/Localization/TestResources/SourceExt/nl.json | 2 +- .../VoloDocs.Web/Localization/Resources/VoloDocs/Web/nl.json | 2 +- .../Localization/Resources/Docs/ApplicationContracts/nl.json | 2 +- .../Volo.Docs.Domain/Volo/Docs/Localization/Domain/nl.json | 2 +- .../Volo/Abp/IdentityServer/Localization/Resources/nl.json | 2 +- .../Volo/Abp/TenantManagement/Localization/Resources/nl.json | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/nl.json b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/nl.json index 2e3971055e..ea15166b9e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/nl.json +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "GivenTenantIsNotAvailable": "Gegeven klant is niet beschikbaar: {0}", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/nl.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/nl.json index 849d1b0df6..3bf13dda13 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/nl.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "USA": "Verenigde Staten van Amerika", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/nl.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/nl.json index 5875cf7a12..825c54ffec 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/nl.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "ThisFieldIsRequired": "Dit veld is verplicht", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/nl.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/nl.json index 0e0ba67ef6..804eaf76c9 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/nl.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "Hello {0}.": "Hallo {0}.", diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/nl.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/nl.json index 7e7354d11b..4072732d62 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/nl.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "SeeYou": "Tot ziens" diff --git a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/nl.json b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/nl.json index b787dd4474..ccb3446246 100644 --- a/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/nl.json +++ b/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "DocsTitle": "VoloDocs", 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 1be125e486..fad3137f04 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 @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "Permission:DocumentManagement": "Document beheer", diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/nl.json b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/nl.json index 56e6800f9f..26aa1b614c 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/nl.json +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "Documents": "Documenten", diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/nl.json b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/nl.json index 01cccfc567..0ae2ba8cd9 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/nl.json +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Localization/Resources/nl.json @@ -1,4 +1,4 @@ -{ +{ "culture": "nl", "texts": { "Volo.IdentityServer:DuplicateIdentityResourceName": "Identiteitsbronnaam bestaat al: {Name}", 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 c187ad3976..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 @@ -16,7 +16,7 @@ "Permission:Delete": "Verwijder", "Permission:ManageConnectionStrings": "Beheer connection strings", "Permission:ManageFeatures": "Beheer functies", - "DisplayName:AdminEmailAddress": "Admin e-mail adres", - "DisplayName:AdminPassword": "Admin wachtwoord" + "DisplayName:AdminEmailAddress": "Admin e-mail adres", + "DisplayName:AdminPassword": "Admin wachtwoord" } } \ No newline at end of file From 07af4c499a4c2141fa10f7c538ca95060cd17312 Mon Sep 17 00:00:00 2001 From: Necati Meral Date: Mon, 6 Jul 2020 10:43:43 +0200 Subject: [PATCH 04/41] Fixed grammar --- .../Volo/Abp/Account/Localization/Resources/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json index d772f2e801..82c9ae3ba8 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/de.json @@ -36,7 +36,7 @@ "PasswordChanged": "Passwort geändert", "NewPasswordConfirmFailed": "Bitte bestätigen Sie das neue Passwort.", "Manage": "Verwalten", - "ManageYourProfile": "Ihr profil verwalten", + "ManageYourProfile": "Ihr Profil verwalten", "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Ist die Selbstregistrierung aktiviert", "Description:Abp.Account.IsSelfRegistrationEnabled": "Gibt an, ob ein Benutzer das Konto selbst registrieren kann.", "DisplayName:Abp.Account.EnableLocalLogin": "Authentifizierung mit einem lokalen Konto", From fe9814c92cdded26f9dbde814f65f1ff71922e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levent=20Arman=20=C3=96zak?= Date: Thu, 9 Jul 2020 13:53:49 +0300 Subject: [PATCH 05/41] update node and yarn versions --- docs/en/Getting-Started.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/en/Getting-Started.md b/docs/en/Getting-Started.md index ac9cd2dcb9..00e8206cff 100644 --- a/docs/en/Getting-Started.md +++ b/docs/en/Getting-Started.md @@ -20,19 +20,20 @@ First things first! Let's setup your development environment before creating the The following tools should be installed on your development machine: -* [Visual Studio 2019 (v16.4+)](https://visualstudio.microsoft.com/vs/) for Windows / [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/).* +* [Visual Studio 2019 (v16.4+)](https://visualstudio.microsoft.com/vs/) for Windows / [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/). [1](#f-yarn) * [.NET Core 3.1+](https://www.microsoft.com/net/download/dotnet-core/) -* [Node v12+](https://nodejs.org) -* [Yarn v1.19+](https://classic.yarnpkg.com/) +* [Node v12 or v14](https://nodejs.org/en/) +* [Yarn v1.20+ (not v2)](https://classic.yarnpkg.com/en/docs/install) [2](#f-yarn) or npm v6+ (installed with Node) {{ if Tiered == "Yes" }} * [Redis](https://redis.io/) (the startup solution uses the Redis as the [distributed cache](Caching.md)). {{ end }} +1 _You can use another editor instead of Visual Studio as long as it supports .NET Core and ASP.NET Core._ [↩](#a-editor) -> *You can use another editor instead of Visual Studio as long as it supports .NET Core and ASP.NET Core. +2 _Yarn v2 works differently and is not supported._ [↩](#a-yarn) ### Install the ABP CLI @@ -348,4 +349,4 @@ See the "[Getting Started with the React Native](Getting-Started-React-Native.md ## Next -* [Web Application Development Tutorial](Tutorials/Part-1.md) \ No newline at end of file +* [Web Application Development Tutorial](Tutorials/Part-1.md) From 48be49845ab23631955fc73a356a52910af021d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levent=20Arman=20=C3=96zak?= Date: Thu, 9 Jul 2020 13:55:48 +0300 Subject: [PATCH 06/41] update editor footnote link --- docs/en/Getting-Started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Getting-Started.md b/docs/en/Getting-Started.md index 00e8206cff..57981d3233 100644 --- a/docs/en/Getting-Started.md +++ b/docs/en/Getting-Started.md @@ -20,7 +20,7 @@ First things first! Let's setup your development environment before creating the The following tools should be installed on your development machine: -* [Visual Studio 2019 (v16.4+)](https://visualstudio.microsoft.com/vs/) for Windows / [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/). [1](#f-yarn) +* [Visual Studio 2019 (v16.4+)](https://visualstudio.microsoft.com/vs/) for Windows / [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/). [1](#f-editor) * [.NET Core 3.1+](https://www.microsoft.com/net/download/dotnet-core/) * [Node v12 or v14](https://nodejs.org/en/) From 4e8516b8ed682de7c1dcf7690c85e86a41dd61f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:43:52 +0300 Subject: [PATCH 07/41] Identity Module - prettier settings added and js files reformatted --- modules/identity/.prettierrc | 4 + .../Pages/Identity/Roles/index.js | 192 ++++++++++-------- .../Pages/Identity/Users/index.js | 169 ++++++++------- 3 files changed, 200 insertions(+), 165 deletions(-) create mode 100644 modules/identity/.prettierrc diff --git a/modules/identity/.prettierrc b/modules/identity/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/identity/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js index 8332a95ac7..c5c15136e3 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js @@ -1,94 +1,114 @@ (function ($) { + var l = abp.localization.getResource('AbpIdentity'); - var l = abp.localization.getResource('AbpIdentity'); + var _identityRoleAppService = volo.abp.identity.identityRole; + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/CreateModal' + ); - var _identityRoleAppService = volo.abp.identity.identityRole; - var _permissionsModal = new abp.ModalManager(abp.appPath + 'AbpPermissionManagement/PermissionManagementModal'); - var _editModal = new abp.ModalManager(abp.appPath + 'Identity/Roles/EditModal'); - var _createModal = new abp.ModalManager(abp.appPath + 'Identity/Roles/CreateModal'); + $(function () { + var _$wrapper = $('#IdentityRolesWrapper'); + var _$table = _$wrapper.find('table'); - $(function () { + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + searching: false, + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted('AbpIdentity.Roles.Update'), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Roles.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'R', + providerKey: data.record.name, + }); + }, + }, + { + text: l('Delete'), + visible: function (data) { + return ( + !data.isStatic && + abp.auth.isGranted('AbpIdentity.Roles.Delete') + ); //TODO: Check permission + }, + confirmMessage: function (data) { + return l( + 'RoleDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _identityRoleAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + render: function (data, type, row) { + var name = '' + data + ''; + if (row.isDefault) { + name += + '' + + l('DisplayName:IsDefault') + + ''; + } + if (row.isPublic) { + name += + '' + + l('DisplayName:IsPublic') + + ''; + } + return name; + }, + }, + ], + }) + ); - var _$wrapper = $('#IdentityRolesWrapper'); - var _$table = _$wrapper.find('table'); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - var _dataTable = _$table.DataTable(abp.libs.datatables.normalizeConfiguration({ - order: [[1, "asc"]], - searching: false, - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Roles.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted('AbpIdentity.Roles.ManagePermissions'), - action: function (data) { - _permissionsModal.open({ - providerName: 'R', - providerKey: data.record.name - }); - } - }, - { - text: l('Delete'), - visible: function (data) { - return !data.isStatic && abp.auth.isGranted('AbpIdentity.Roles.Delete'); //TODO: Check permission - }, - confirmMessage: function (data) { return l('RoleDeletionConfirmationMessage', data.record.name)}, - action: function (data) { - _identityRoleAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { - data: "name", - render: function (data, type, row) { - var name = '' + data + ''; - if (row.isDefault) { - name += '' + l('DisplayName:IsDefault') + ''; - } - if (row.isPublic) { - name += '' + l('DisplayName:IsPublic') + ''; - } - return name; - } - } - ] - })); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _$wrapper.find('button[name=CreateRole]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); + _$wrapper.find('button[name=CreateRole]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 64505509ba..40e1c1b3c1 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -1,86 +1,97 @@ (function ($) { + var l = abp.localization.getResource('AbpIdentity'); - var l = abp.localization.getResource('AbpIdentity'); + var _identityUserAppService = volo.abp.identity.identityUser; + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/CreateModal' + ); + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); - var _identityUserAppService = volo.abp.identity.identityUser; - var _editModal = new abp.ModalManager(abp.appPath + 'Identity/Users/EditModal'); - var _createModal = new abp.ModalManager(abp.appPath + 'Identity/Users/CreateModal'); - var _permissionsModal = new abp.ModalManager(abp.appPath + 'AbpPermissionManagement/PermissionManagementModal'); + $(function () { + var _$wrapper = $('#IdentityUsersWrapper'); + var _$table = _$wrapper.find('table'); + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted('AbpIdentity.Users.Update'), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'U', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('AbpIdentity.Users.Delete'), + confirmMessage: function (data) { + return l( + 'UserDeletionConfirmationMessage', + data.record.userName + ); + }, + action: function (data) { + _identityUserAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'userName', + }, + { + data: 'email', + }, + { + data: 'phoneNumber', + }, + ], + }) + ); - $(function () { + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - var _$wrapper = $('#IdentityUsersWrapper'); - var _$table = _$wrapper.find('table'); - var _dataTable = _$table.DataTable(abp.libs.datatables.normalizeConfiguration({ - order: [[1, "asc"]], - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Users.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted('AbpIdentity.Users.ManagePermissions'), - action: function (data) { - _permissionsModal.open({ - providerName: 'U', - providerKey: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('AbpIdentity.Users.Delete'), - confirmMessage: function (data) { return l('UserDeletionConfirmationMessage', data.record.userName); }, - action: function (data) { - _identityUserAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { - data: "userName" - }, - { - data: "email" - }, - { - data: "phoneNumber" - } - ] - })); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _$wrapper.find('button[name=CreateUser]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); + _$wrapper.find('button[name=CreateUser]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); From b72d903412bcb09d7cf3520f878026bdd2f39bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:44:14 +0300 Subject: [PATCH 08/41] Permission Management Module - prettier settings added and js files reformatted --- modules/permission-management/.prettierrc | 4 + .../permission-management-modal.js | 495 ++++++++++-------- 2 files changed, 269 insertions(+), 230 deletions(-) create mode 100644 modules/permission-management/.prettierrc diff --git a/modules/permission-management/.prettierrc b/modules/permission-management/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/permission-management/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index 860d6f8bfb..6cba3cdb35 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -1,233 +1,268 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; - - abp.modals.PermissionManagement = function () { - function checkParents($tab, $checkBox) { - var parentName = $checkBox.closest('.custom-checkbox').attr('data-parent-name'); - if (!parentName) { - return; - } - - $tab.find('.custom-checkbox') - .filter('[data-permission-name="' + parentName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $parent = $(this); - $parent.prop('checked', true); - checkParents($tab, $parent); - }); - } - - function uncheckChildren($tab, $checkBox) { - var permissionName = $checkBox.closest('.custom-checkbox').attr('data-permission-name'); - if (!permissionName) { - return; - } - - $tab.find('.custom-checkbox') - .filter('[data-parent-name="' + permissionName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $child = $(this); - $child.prop('checked', false); - uncheckChildren($tab, $child); - }); - } - - function handleTabCheckedCheckboxCount($tab) { - var newCount = 0; - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - newCount++; - } - }); - - var $tabTitle = $('#' + $tab.attr('id') + '-tab'); - var title = $tabTitle.html() - .replace('','').replace('','') - .replace('','').replace('',''); - - var titleSplitted = title.split(' '); - if (titleSplitted[titleSplitted.length-1].startsWith('(')){ - titleSplitted.pop(); - } - var titleWithoutCount = titleSplitted.join(' '); - var newTitle = titleWithoutCount + ' (' + (newCount) + ')'; - if (newCount > 0){ - newTitle = '' + newTitle + '' - } - else { - newTitle = '' + newTitle + '' - } - $tabTitle.html(newTitle) - }; - - function handleUncheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - - if ($checkBox.is(':checked')) { - if ($tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').length > 1) { - $($checkBox).prop('indeterminate', true); - } else { - $checkBox.prop('checked', false); - } - } else if ($checkBox.is(':indeterminate')) { - var allUnchecked = true; - - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - allUnchecked = false; - } - }); - - if (allUnchecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', false); - } - } - } - - function handleCheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - - var allChecked = true; - - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === false) { - allChecked = false; - } - }); - - if (allChecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', true); - } else { - $($checkBox).prop('indeterminate', true); - } - } - - - function initSelectAllInThisTab() { - var tabs = $('.tab-pane'); - for (var i = 0; i < tabs.length; i++) { - var $tab = $(tabs[i]); - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - - var allChecked = true; - var allUnChecked = true; - - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } - }); - - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } - } - - function setSelectAllInAllTabs() { - var $checkBox = $('#SelectAllInAllTabs'); - - var anyIndeterminate = false; - var allChecked = true; - var allUnChecked = true; - - $('input[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } - - if ($(this).is(':indeterminate') === true) { - anyIndeterminate = true; - } - }); - - if (anyIndeterminate) { - $($checkBox).prop('indeterminate', true); - return; - } else { - $($checkBox).prop('indeterminate', false); - } - - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } - - this.initDom = function ($el) { - $el.find('.tab-pane').each(function () { - var $tab = $(this); - handleTabCheckedCheckboxCount($tab); - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () { - var $checkBox = $(this); - $checkBox.change(function () { - if ($checkBox.is(':checked')) { - checkParents($tab, $checkBox); - handleCheck($tab); - } else { - uncheckChildren($tab, $checkBox); - handleUncheck($tab); - } - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab); - }); - }); - }); - - $('input[name="SelectAllInThisTab"]').change(function () { - var $checkBox = $(this); - var $tab = $('#' + $checkBox.attr('data-tab-id')); - if ($checkBox.is(':checked')) { - $tab.find('input[type="checkbox"]').not(':disabled').prop('checked', true); - } else { - $tab.find('input[type="checkbox"]').not(':disabled').prop('checked', false); - } - $($checkBox).prop('indeterminate', false); - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab) - }); - - $('input[name="SelectAllInAllTabs"]').change(function () { - var $checkBox = $(this); - if ($checkBox.is(':checked')) { - $('.tab-pane input[type="checkbox"]').not(':disabled').prop('checked', true); - } else { - $('.tab-pane input[type="checkbox"]').not(':disabled').prop('checked', false); - } - $($checkBox).prop('indeterminate', false); - - $el.find('.tab-pane').each(function () { - handleTabCheckedCheckboxCount($(this)) - }); - }); - - $(function () { - $(".custom-scroll-content").mCustomScrollbar({ - theme: "minimal-dark" - }); - $(".custom-scroll-container > .col-4").mCustomScrollbar({ - theme: "minimal-dark" - }); - }); - - initSelectAllInThisTab(); - setSelectAllInAllTabs(); - }; - }; + abp.modals = abp.modals || {}; + + abp.modals.PermissionManagement = function () { + function checkParents($tab, $checkBox) { + var parentName = $checkBox + .closest('.custom-checkbox') + .attr('data-parent-name'); + if (!parentName) { + return; + } + + $tab + .find('.custom-checkbox') + .filter('[data-permission-name="' + parentName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $parent = $(this); + $parent.prop('checked', true); + checkParents($tab, $parent); + }); + } + + function uncheckChildren($tab, $checkBox) { + var permissionName = $checkBox + .closest('.custom-checkbox') + .attr('data-permission-name'); + if (!permissionName) { + return; + } + + $tab + .find('.custom-checkbox') + .filter('[data-parent-name="' + permissionName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $child = $(this); + $child.prop('checked', false); + uncheckChildren($tab, $child); + }); + } + + function handleTabCheckedCheckboxCount($tab) { + var newCount = 0; + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + newCount++; + } + }); + + var $tabTitle = $('#' + $tab.attr('id') + '-tab'); + var title = $tabTitle + .html() + .replace('', '') + .replace('', '') + .replace('', '') + .replace('', ''); + + var titleSplitted = title.split(' '); + if (titleSplitted[titleSplitted.length - 1].startsWith('(')) { + titleSplitted.pop(); + } + var titleWithoutCount = titleSplitted.join(' '); + var newTitle = titleWithoutCount + ' (' + newCount + ')'; + if (newCount > 0) { + newTitle = '' + newTitle + ''; + } else { + newTitle = '' + newTitle + ''; + } + $tabTitle.html(newTitle); + } + + function handleUncheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + if ($checkBox.is(':checked')) { + if ( + $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]') + .length > 1 + ) { + $($checkBox).prop('indeterminate', true); + } else { + $checkBox.prop('checked', false); + } + } else if ($checkBox.is(':indeterminate')) { + var allUnchecked = true; + + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnchecked = false; + } + }); + + if (allUnchecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', false); + } + } + } + + function handleCheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + var allChecked = true; + + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === false) { + allChecked = false; + } + }); + + if (allChecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', true); + } else { + $($checkBox).prop('indeterminate', true); + } + } + + function initSelectAllInThisTab() { + var tabs = $('.tab-pane'); + for (var i = 0; i < tabs.length; i++) { + var $tab = $(tabs[i]); + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + + var allChecked = true; + var allUnChecked = true; + + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + }); + + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } + } + + function setSelectAllInAllTabs() { + var $checkBox = $('#SelectAllInAllTabs'); + + var anyIndeterminate = false; + var allChecked = true; + var allUnChecked = true; + + $('input[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + + if ($(this).is(':indeterminate') === true) { + anyIndeterminate = true; + } + }); + + if (anyIndeterminate) { + $($checkBox).prop('indeterminate', true); + return; + } else { + $($checkBox).prop('indeterminate', false); + } + + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } + + this.initDom = function ($el) { + $el.find('.tab-pane').each(function () { + var $tab = $(this); + handleTabCheckedCheckboxCount($tab); + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + var $checkBox = $(this); + $checkBox.change(function () { + if ($checkBox.is(':checked')) { + checkParents($tab, $checkBox); + handleCheck($tab); + } else { + uncheckChildren($tab, $checkBox); + handleUncheck($tab); + } + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); + }); + }); + + $('input[name="SelectAllInThisTab"]').change(function () { + var $checkBox = $(this); + var $tab = $('#' + $checkBox.attr('data-tab-id')); + if ($checkBox.is(':checked')) { + $tab + .find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $tab + .find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); + + $('input[name="SelectAllInAllTabs"]').change(function () { + var $checkBox = $(this); + if ($checkBox.is(':checked')) { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + + $el.find('.tab-pane').each(function () { + handleTabCheckedCheckboxCount($(this)); + }); + }); + + $(function () { + $('.custom-scroll-content').mCustomScrollbar({ + theme: 'minimal-dark', + }); + $('.custom-scroll-container > .col-4').mCustomScrollbar({ + theme: 'minimal-dark', + }); + }); + + initSelectAllInThisTab(); + setSelectAllInAllTabs(); + }; + }; })(jQuery); From f2032ff7a4436871fdb9302662e495356afb3ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:48:02 +0300 Subject: [PATCH 09/41] Account Module - prettier settings added and js files reformatted --- modules/account/.prettierrc | 4 + .../Pages/Account/LoggedOut.js | 10 ++- .../Pages/Account/Manage.js | 73 +++++++++---------- 3 files changed, 45 insertions(+), 42 deletions(-) create mode 100644 modules/account/.prettierrc diff --git a/modules/account/.prettierrc b/modules/account/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/account/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js index 950bf65719..6b5d0bb0af 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js @@ -1,5 +1,7 @@ -document.addEventListener("DOMContentLoaded", function (event) { - setTimeout(function () { - window.location = document.getElementById("redirectButton").getAttribute("href"); - }, 3000) +document.addEventListener('DOMContentLoaded', function (event) { + setTimeout(function () { + window.location = document + .getElementById('redirectButton') + .getAttribute('href'); + }, 3000); }); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js index 844151c71b..015d481df4 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js @@ -1,50 +1,47 @@ (function ($) { + var l = abp.localization.getResource('AbpAccount'); - var l = abp.localization.getResource('AbpAccount'); + var _profileService = volo.abp.identity.profile; - var _profileService = volo.abp.identity.profile; + $('#ChangePasswordForm').submit(function (e) { + e.preventDefault(); - $("#ChangePasswordForm").submit(function (e) { - e.preventDefault(); + if (!$('#ChangePasswordForm').valid()) { + return false; + } - if (!$("#ChangePasswordForm").valid()) { - return false; - } + var input = $('#ChangePasswordForm').serializeFormToObject() + .changePasswordInfoModel; - var input = $("#ChangePasswordForm").serializeFormToObject().changePasswordInfoModel; + if ( + input.newPassword != input.newPasswordConfirm || + input.currentPassword == '' + ) { + abp.message.error(l('NewPasswordConfirmFailed')); + return; + } - if (input.newPassword != input.newPasswordConfirm || input.currentPassword == '') { - abp.message.error(l("NewPasswordConfirmFailed")); - return; - } + if (input.currentPassword == '') { + return; + } - if (input.currentPassword == '') { - return; - } + _profileService.changePassword(input).then(function (result) { + abp.message.success(l('PasswordChanged')); + }); + }); - _profileService.changePassword( - input - ).then(function (result) { - abp.message.success(l("PasswordChanged")); - }); + $('#PersonalSettingsForm').submit(function (e) { + e.preventDefault(); - }); + if (!$('#PersonalSettingsForm').valid()) { + return false; + } - $("#PersonalSettingsForm").submit(function (e) { - e.preventDefault(); + var input = $('#PersonalSettingsForm').serializeFormToObject() + .personalSettingsInfoModel; - if (!$("#PersonalSettingsForm").valid()) { - return false; - } - - var input = $("#PersonalSettingsForm").serializeFormToObject().personalSettingsInfoModel; - - _profileService.update( - input - ).then(function (result) { - abp.notify.success(l("PersonalSettingsSaved")); - }); - - }); - -})(jQuery); \ No newline at end of file + _profileService.update(input).then(function (result) { + abp.notify.success(l('PersonalSettingsSaved')); + }); + }); +})(jQuery); From 2606520715faa807911fe608034128136c0ffd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:49:21 +0300 Subject: [PATCH 10/41] Blogging Module - prettier settings added and js files reformatted --- modules/blogging/.prettierrc | 4 + .../Pages/Blogging/Admin/Blogs/create.js | 20 +- .../Pages/Blogging/Admin/Blogs/edit.js | 20 +- .../Pages/Blogging/Admin/Blogs/index.js | 158 ++++---- .../Pages/Blogs/Posts/detail.js | 350 +++++++++--------- .../Pages/Blogs/Posts/edit.js | 247 ++++++------ .../Pages/Blogs/Shared/Scripts/blog.js | 122 +++--- 7 files changed, 469 insertions(+), 452 deletions(-) create mode 100644 modules/blogging/.prettierrc diff --git a/modules/blogging/.prettierrc b/modules/blogging/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/blogging/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js index 276523c14d..7e6c7117e9 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js @@ -1,14 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); + abp.modals.blogCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - - }; - - return { - initModal: initModal - } - }; -}); \ No newline at end of file + return { + initModal: initModal, + }; + }; +}); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js index 8d3cffb6c8..dd0712ec27 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js @@ -1,14 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); + abp.modals.blogEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - - }; - - return { - initModal: initModal - } - }; -}); \ No newline at end of file + return { + initModal: initModal, + }; + }; +}); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js index 74ca458614..46751de899 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js @@ -1,82 +1,88 @@ $(function () { + var l = abp.localization.getResource('Blogging'); + var _createModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Create' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Edit' + ); - var l = abp.localization.getResource('Blogging'); - var _createModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Create'); - var _editModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Edit'); + var _dataTable = $('#BlogsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: false, + info: false, + scrollX: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[3, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.blogging.admin.blogManagement.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted('Blogging.Blog.Update'), + action: function (data) { + _editModal.open({ + blogId: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('Blogging.Blog.Delete'), + confirmMessage: function (data) { + return l('BlogDeletionWarningMessage'); + }, + action: function (data) { + volo.blogging.admin.blogManagement + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'creationTime', + render: function (date) { + return date; + }, + }, + { + target: 4, + data: 'description', + }, + ], + }) + ); - var _dataTable = $('#BlogsTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: false, - info: false, - scrollX: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[3, "desc"]], - ajax: abp.libs.datatables.createAjax(volo.blogging.admin.blogManagement.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Blogging.Blog.Update'), - action: function (data) { - _editModal.open({ - blogId: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Blogging.Blog.Delete'), - confirmMessage: function (data) { return l('BlogDeletionWarningMessage') }, - action: function (data) { - volo.blogging.admin.blogManagement - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { - target: 1, - data: "name" - }, - { - target: 2, - data: "shortName" - }, - { - target: 3, - data: "creationTime", - render: function (date) { - return date; - } - }, - { - target: 4, - data: "description" - } - ] - })); + $('#CreateNewBlogButtonId').click(function () { + _createModal.open(); + }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - $("#CreateNewBlogButtonId").click(function () { - _createModal.open(); - }); - - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index 571484bdac..a5061457d0 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -1,170 +1,184 @@ (function ($) { - - var l = abp.localization.getResource('Blogging'); - - var initSocialShareLinks = function () { - - var re = new RegExp(/^.*\//); - var rootUrl = re.exec(window.location.href); - - var pageHeader = $("#PostTitle").text(); - var blogName = $('#BlogFullName').attr('name'); - - $('#TwitterShareLink').attr('href', - 'https://twitter.com/intent/tweet?text=' + encodeURI(pageHeader + " | " + blogName + " | " + window.location.href) - ); - - $('#LinkedinShareLink').attr('href', - 'https://www.linkedin.com/shareArticle?' - + 'url=' + encodeURI(window.location.href) + '&' - + 'mini=true&' - + "summary=" + encodeURI(blogName) + '&' - + "title=" + encodeURI(pageHeader) + '&' - + "source=" + encodeURI(rootUrl) - ); - - $('#EmailShareLink').attr('href', - 'mailto:?' - + 'body=' + encodeURI('I want you to look at ' + window.location.href) + '&' - + "subject=" + encodeURI(pageHeader + ' | ' + blogName) + '&' - ); - }; - - $('div .replyForm').hide(); - - $('div .editForm').hide(); - - $('form[class="editFormClass"]').submit(function (event) { - event.preventDefault(); - var form = $(this).serializeFormToObject(); - - $.ajax({ - type: "POST", - url: "/Blog/Comments/Update", - data: { - id: form.commentId, - commentDto: { - text: form.text - } - }, - success: function (response) { - $('div .editForm').hide(); - $('#' + form.commentId).text(form.text); - } - }); - }); - - $('.editCancelButton').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - }); - - $('.replyCancelButton').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - }); - - $('.replyLink').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - var linkElement = $(this); - var replyCommentId = linkElement.attr('data-relpyid'); - - if (replyCommentId != '' && replyCommentId !== undefined) { - var div = linkElement.parent().next(); - - if (div.is(":hidden")) { - $('div .replyForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - $('.deleteLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-deleteid'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('CommentDeletionWarningMessage'), // TODO: localize - l('Are you sure?'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: "POST", - url: "/Blog/Comments/Delete", - data: { id: deleteCommentId }, - success: function (response) { - linkElement.parent().parent().parent().remove(); - } - }); - } - } - ); - } - }); - - $('#DeletePostLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-postid'); - var blogShortName = linkElement.attr('data-blogShortName'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('PostDeletionWarningMessage'), - l('AreYouSure'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: "POST", - url: "/Blog/Posts/Delete", - data: { id: deleteCommentId }, - success: function () { - var url = window.location.pathname; - var postNameBeginning = url.lastIndexOf('/'); - window.location.replace(url.substring(0, postNameBeginning)); - } - }); - } - } - ); - } - }); - - $('.updateLink').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - - var linkElement = $(this); - var updateCommentId = $(this).attr('data-updateid'); - - if (updateCommentId != '' && updateCommentId !== undefined) { - - var div = linkElement.parent().next().next(); - - if (div.is(":hidden")) { - $('div .editForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { - $('html, body').animate({ - scrollTop: ($('#' + $('#FocusCommentId').val()).offset().top - 150) - }, 500); - } - - $(".post-content a[href^='http']").attr('target', '_blank'); - - initSocialShareLinks(); - + var l = abp.localization.getResource('Blogging'); + + var initSocialShareLinks = function () { + var re = new RegExp(/^.*\//); + var rootUrl = re.exec(window.location.href); + + var pageHeader = $('#PostTitle').text(); + var blogName = $('#BlogFullName').attr('name'); + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI(pageHeader + ' | ' + blogName + ' | ' + window.location.href) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(blogName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI(rootUrl) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + blogName) + + '&' + ); + }; + + $('div .replyForm').hide(); + + $('div .editForm').hide(); + + $('form[class="editFormClass"]').submit(function (event) { + event.preventDefault(); + var form = $(this).serializeFormToObject(); + + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Update', + data: { + id: form.commentId, + commentDto: { + text: form.text, + }, + }, + success: function (response) { + $('div .editForm').hide(); + $('#' + form.commentId).text(form.text); + }, + }); + }); + + $('.editCancelButton').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + }); + + $('.replyCancelButton').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + }); + + $('.replyLink').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + var linkElement = $(this); + var replyCommentId = linkElement.attr('data-relpyid'); + + if (replyCommentId != '' && replyCommentId !== undefined) { + var div = linkElement.parent().next(); + + if (div.is(':hidden')) { + $('div .replyForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + $('.deleteLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-deleteid'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('CommentDeletionWarningMessage'), // TODO: localize + l('Are you sure?'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Delete', + data: { id: deleteCommentId }, + success: function (response) { + linkElement.parent().parent().parent().remove(); + }, + }); + } + } + ); + } + }); + + $('#DeletePostLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-postid'); + var blogShortName = linkElement.attr('data-blogShortName'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('PostDeletionWarningMessage'), + l('AreYouSure'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Posts/Delete', + data: { id: deleteCommentId }, + success: function () { + var url = window.location.pathname; + var postNameBeginning = url.lastIndexOf('/'); + window.location.replace(url.substring(0, postNameBeginning)); + }, + }); + } + } + ); + } + }); + + $('.updateLink').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + + var linkElement = $(this); + var updateCommentId = $(this).attr('data-updateid'); + + if (updateCommentId != '' && updateCommentId !== undefined) { + var div = linkElement.parent().next().next(); + + if (div.is(':hidden')) { + $('div .editForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { + $('html, body').animate( + { + scrollTop: $('#' + $('#FocusCommentId').val()).offset().top - 150, + }, + 500 + ); + } + + $(".post-content a[href^='http']").attr('target', '_blank'); + + initSocialShareLinks(); })(jQuery); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js index 8d668019c3..c8d0bb9b26 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js @@ -1,127 +1,124 @@ $(function () { - - var $container = $("#edit-post-container"); - var $editorContainer = $container.find(".edit-post-editor"); - var $submitButton = $container.find("button[type=submit]"); - var $form = $container.find("form#edit-post-form"); - var editorDataKey = "tuiEditor"; - var $titleLengthWarning = $("#title-length-warning"); - var maxTitleLength = parseInt($titleLengthWarning.data("max-length")); - - var $title = $('#Post_Title'); - var $coverImage = $("#CoverImage"); - var $postCoverImage = $('#Post_CoverImage'); - var $coverImageFile = $('#CoverImageFile'); - var $postFormSubmitButton = $('#PostFormSubmitButton'); - - var setCoverImage = function (file) { - $postCoverImage.val(file.fileUrl); - $coverImage.attr("src", file.fileUrl); - $postFormSubmitButton.removeAttr('disabled'); - }; - - var uploadCoverImage = function (file) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", - data: formData, - contentType: false, - processData: false, - success: function (response) { - setCoverImage(response); - } - }); - }; - - var checkTitleLength = function () { - var title = $title.val(); - - if (title.length > maxTitleLength) { - $titleLengthWarning.show(); - } else { - $titleLengthWarning.hide(); - } - }; - - checkTitleLength(); - - $title.on("change paste keyup", function () { - checkTitleLength(); - }); - - $coverImageFile.change(function () { - if (!$coverImageFile.prop('files').length) { - return; - } - - $postFormSubmitButton.attr('disabled',true); - var file = $coverImageFile.prop('files')[0]; - uploadCoverImage(file); - }); - - - var uploadImage = function (file, callbackFn) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", - data: formData, - contentType: false, - processData: false, - success: function (response) { - callbackFn(response.fileUrl); - } - }); - }; - - var newPostEditor = $editorContainer.tuiEditor({ - usageStatistics: false, - initialEditType: 'markdown', - previewStyle: 'tab', - height: "auto", - initialValue: $form.find("input[name='Post.Content']").val(), - hooks: { - addImageBlobHook: function (blob, callback, source) { - var imageAltText = blob.name; - - uploadImage(blob, - function (fileUrl) { - callback(fileUrl, imageAltText); - }); - } - }, - events: { - load: function () { - $editorContainer.find(".loading-cover").remove(); - $submitButton.prop("disabled", false); - $form.data("validator").settings.ignore = '.ignore'; - $editorContainer.find(':input').addClass('ignore'); - } - } - }).data(editorDataKey); - - $container.find("form#edit-post-form").submit(function (e) { - var $postTextInput = $form.find("input[name='Post.Content']"); - - var postText = newPostEditor.getMarkdown(); - $postTextInput.val(postText); - - if (!$form.valid()) { - var validationResult = $form.validate(); - abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. - e.preventDefault(); - return false; //for old browsers - } - - $submitButton.buttonBusy(); - $(this).off('submit').submit(); - return true; - }); - + var $container = $('#edit-post-container'); + var $editorContainer = $container.find('.edit-post-editor'); + var $submitButton = $container.find('button[type=submit]'); + var $form = $container.find('form#edit-post-form'); + var editorDataKey = 'tuiEditor'; + var $titleLengthWarning = $('#title-length-warning'); + var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); + + var $title = $('#Post_Title'); + var $coverImage = $('#CoverImage'); + var $postCoverImage = $('#Post_CoverImage'); + var $coverImageFile = $('#CoverImageFile'); + var $postFormSubmitButton = $('#PostFormSubmitButton'); + + var setCoverImage = function (file) { + $postCoverImage.val(file.fileUrl); + $coverImage.attr('src', file.fileUrl); + $postFormSubmitButton.removeAttr('disabled'); + }; + + var uploadCoverImage = function (file) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + setCoverImage(response); + }, + }); + }; + + var checkTitleLength = function () { + var title = $title.val(); + + if (title.length > maxTitleLength) { + $titleLengthWarning.show(); + } else { + $titleLengthWarning.hide(); + } + }; + + checkTitleLength(); + + $title.on('change paste keyup', function () { + checkTitleLength(); + }); + + $coverImageFile.change(function () { + if (!$coverImageFile.prop('files').length) { + return; + } + + $postFormSubmitButton.attr('disabled', true); + var file = $coverImageFile.prop('files')[0]; + uploadCoverImage(file); + }); + + var uploadImage = function (file, callbackFn) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + callbackFn(response.fileUrl); + }, + }); + }; + + var newPostEditor = $editorContainer + .tuiEditor({ + usageStatistics: false, + initialEditType: 'markdown', + previewStyle: 'tab', + height: 'auto', + initialValue: $form.find("input[name='Post.Content']").val(), + hooks: { + addImageBlobHook: function (blob, callback, source) { + var imageAltText = blob.name; + + uploadImage(blob, function (fileUrl) { + callback(fileUrl, imageAltText); + }); + }, + }, + events: { + load: function () { + $editorContainer.find('.loading-cover').remove(); + $submitButton.prop('disabled', false); + $form.data('validator').settings.ignore = '.ignore'; + $editorContainer.find(':input').addClass('ignore'); + }, + }, + }) + .data(editorDataKey); + + $container.find('form#edit-post-form').submit(function (e) { + var $postTextInput = $form.find("input[name='Post.Content']"); + + var postText = newPostEditor.getMarkdown(); + $postTextInput.val(postText); + + if (!$form.valid()) { + var validationResult = $form.validate(); + abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. + e.preventDefault(); + return false; //for old browsers + } + + $submitButton.buttonBusy(); + $(this).off('submit').submit(); + return true; + }); }); - diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js index b78c8132aa..53eadbf21c 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js @@ -1,67 +1,67 @@ -(function() { - function handleArrows() { - var herosWidth = $(".hero-articles").width(); - var arrowsPosition = (herosWidth / 2 - 90); - $(".owl-next").css("right", arrowsPosition); - $(".owl-prev").css("left", arrowsPosition); - } +(function () { + function handleArrows() { + var herosWidth = $('.hero-articles').width(); + var arrowsPosition = herosWidth / 2 - 90; + $('.owl-next').css('right', arrowsPosition); + $('.owl-prev').css('left', arrowsPosition); + } - function handleImages() { - //if ($(window).width() > 767) { - // $(".box-articles .img-container").each(function () { - // var squareWidth = $(this).width(); - // $(this).css("height", squareWidth); - // }); - //} - //else { - // $(".box-articles .img-container").css("height", "auto"); - //} - } + function handleImages() { + //if ($(window).width() > 767) { + // $(".box-articles .img-container").each(function () { + // var squareWidth = $(this).width(); + // $(this).css("height", squareWidth); + // }); + //} + //else { + // $(".box-articles .img-container").css("height", "auto"); + //} + } - function handleOwlCarousel() { - $('.hero-section .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - //center: true, - autoplay: true, - autoHeight: true, - autoplaySpeed: 1000, - items: 1, - }); - $('.card-article-container .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - autoplay: true, - autoplaySpeed: 1000, - responsive: { - 0: { - items: 1 - } - } - }); - } + function handleOwlCarousel() { + $('.hero-section .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + //center: true, + autoplay: true, + autoHeight: true, + autoplaySpeed: 1000, + items: 1, + }); + $('.card-article-container .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + autoplay: true, + autoplaySpeed: 1000, + responsive: { + 0: { + items: 1, + }, + }, + }); + } - $(function () { - handleImages(); - handleOwlCarousel(); + $(function () { + handleImages(); + handleOwlCarousel(); - $(".nav-link").on("click", function () { - $(this).parent().parent(); - }); + $('.nav-link').on('click', function () { + $(this).parent().parent(); + }); - $(window).resize(function () { - setTimeout(function () { - handleArrows(); - handleImages(); - }, 500); - }); + $(window).resize(function () { + setTimeout(function () { + handleArrows(); + handleImages(); + }, 500); + }); - setTimeout(function () { - handleArrows(); - }, 500); - }); -})(); \ No newline at end of file + setTimeout(function () { + handleArrows(); + }, 500); + }); +})(); From d766d36d6aeb4b183a42e9f3049f3ec1efd3ed79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:50:00 +0300 Subject: [PATCH 11/41] Client Simulation - prettier settings added and js files reformatted --- modules/client-simulation/.prettierrc | 4 +++ .../Pages/ClientSimulation/Index.js | 8 ++--- .../Pages/ClientSimulation/SimulationArea.js | 32 +++++++++---------- 3 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 modules/client-simulation/.prettierrc diff --git a/modules/client-simulation/.prettierrc b/modules/client-simulation/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/client-simulation/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js index 39a9dc61f7..fbdf917f91 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js @@ -1,5 +1,5 @@ (function ($) { - $(function () { - SimulationArea.init($('#SimulationArea')); - }); -})(jQuery); \ No newline at end of file + $(function () { + SimulationArea.init($('#SimulationArea')); + }); +})(jQuery); diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js index 24a4d46460..de15f8a63c 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js @@ -1,21 +1,19 @@ var SimulationArea = {}; (function ($) { + var $mainContainer = null; - var $mainContainer = null; + function refreshSimulationArea() { + $.get('/ClientSimulation/SimulationArea') + .done(function (result) { + $mainContainer.html(result); + }) + .always(function () { + setTimeout(refreshSimulationArea, 1000); + }); + } - function refreshSimulationArea() { - $.get('/ClientSimulation/SimulationArea') - .done(function(result) { - $mainContainer.html(result); - }) - .always(function() { - setTimeout(refreshSimulationArea, 1000); - }); - } - - SimulationArea.init = function ($container) { - $mainContainer = $container; - setTimeout(refreshSimulationArea, 1000); - }; - -})(jQuery); \ No newline at end of file + SimulationArea.init = function ($container) { + $mainContainer = $container; + setTimeout(refreshSimulationArea, 1000); + }; +})(jQuery); From 2c36e51ff3a87e4e6294e7cd16a7ff3b50732e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:51:53 +0300 Subject: [PATCH 12/41] Docs Module - prettier settings added and js files reformatted --- modules/docs/.prettierrc | 4 + .../Pages/Docs/Admin/Documents/index.js | 320 +++++---- .../Pages/Docs/Admin/Projects/Pull.js | 36 +- .../Pages/Docs/Admin/Projects/create.js | 20 +- .../Pages/Docs/Admin/Projects/edit.js | 20 +- .../Pages/Docs/Admin/Projects/index.js | 279 ++++---- .../Pages/Documents/Project/index.js | 652 +++++++++--------- .../Documents/Shared/ErrorComponent/error.js | 32 +- .../Pages/Documents/Shared/Scripts/vs.js | 315 +++++---- 9 files changed, 872 insertions(+), 806 deletions(-) create mode 100644 modules/docs/.prettierrc diff --git a/modules/docs/.prettierrc b/modules/docs/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/docs/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} 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 dc77bbc687..03d6fee850 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 @@ -1,164 +1,178 @@ $(function () { + var l = abp.localization.getResource('Docs'); + var service = window.volo.docs.admin.documentsAdmin; - var l = abp.localization.getResource('Docs'); - var service = window.volo.docs.admin.documentsAdmin; + var getFormattedDate = function ($datePicker) { + return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); + }; - var getFormattedDate = function ($datePicker) { - return $datePicker.data().datepicker.getFormattedDate("yyyy-mm-dd"); - }; + var getFilter = function () { + return { + projectId: $('#ProjectId').val(), + name: $('#Name').val(), + version: $('#Version').val(), + languageCode: $('#LanguageCode').val(), + fileName: $('#FileName').val(), + format: $('#Format').val(), + creationTimeMin: getFormattedDate($('#CreationTimeMin')), + creationTimeMax: getFormattedDate($('#CreationTimeMax')), + lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), + lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), + lastSignificantUpdateTimeMin: getFormattedDate( + $('#LastSignificantUpdateTimeMin') + ), + lastSignificantUpdateTimeMax: getFormattedDate( + $('#LastSignificantUpdateTimeMax') + ), + lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), + lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), + }; + }; - var getFilter = function () { - return { - projectId: $("#ProjectId").val(), - name: $("#Name").val(), - version: $("#Version").val(), - languageCode: $("#LanguageCode").val(), - fileName: $("#FileName").val(), - format: $("#Format").val(), - creationTimeMin: getFormattedDate($("#CreationTimeMin")), - creationTimeMax: getFormattedDate($("#CreationTimeMax")), - lastUpdatedTimeMin: getFormattedDate($("#LastUpdatedTimeMin")), - lastUpdatedTimeMax: getFormattedDate($("#LastUpdatedTimeMax")), - lastSignificantUpdateTimeMin: getFormattedDate($("#LastSignificantUpdateTimeMin")), - lastSignificantUpdateTimeMax: getFormattedDate($("#LastSignificantUpdateTimeMax")), - lastCachedTimeMin: getFormattedDate($("#LastCachedTimeMin")), - lastCachedTimeMax: getFormattedDate($("#LastCachedTimeMax")) - }; - }; + var dataTable = $('#DocumentsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('RemoveFromCache'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + confirmMessage: function (data) { + return l('RemoveFromCacheConfirmation'); + }, + action: function (data) { + service.removeFromCache(data.record.id).then(function () { + abp.message.success(l('RemovedFromCache')); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndex'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + confirmMessage: function (data) { + return l('ReIndexDocumentConfirmation'); + }, + action: function (data) { + service.reindex(data.record.id).then(function () { + abp.message.success(l('ReindexCompleted')); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('DeleteFromDatabase'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + confirmMessage: function (data) { + return l('DeleteDocumentFromDbConfirmation'); + }, + action: function (data) { + service.deleteFromDatabase(data.record.id).then(function () { + abp.message.success(l('Deleted')); + dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'version', + }, + { + target: 3, + data: 'languageCode', + }, + { + target: 4, + data: 'fileName', + }, + { + target: 5, + data: 'format', + }, + { + target: 6, + data: 'creationTime', + render: function (creationTime) { + if (!creationTime) { + return ''; + } - var dataTable = $('#DocumentsTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('RemoveFromCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { return l('RemoveFromCacheConfirmation'); }, - action: function (data) { - service.removeFromCache(data.record.id) - .then(function () { - abp.message.success(l('RemovedFromCache')); - dataTable.ajax.reload(); - }); - } - }, - { - text: l('ReIndex'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { return l('ReIndexDocumentConfirmation'); }, - action: function (data) { - service.reindex(data.record.id) - .then(function () { - abp.message.success(l('ReindexCompleted')); - dataTable.ajax.reload(); - }); - } - }, - { - text: l('DeleteFromDatabase'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { return l('DeleteDocumentFromDbConfirmation'); }, - action: function (data) { - service.deleteFromDatabase(data.record.id) - .then(function () { - abp.message.success(l('Deleted')); - dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { - target: 1, - data: "name" - }, - { - target: 2, - data: "version" - }, - { - target: 3, - data: "languageCode" - }, - { - target: 4, - data: "fileName" - }, - { - target: 5, - data: "format" - }, - { - target: 6, - data: "creationTime", - render: function (creationTime) { - if (!creationTime) { - return ""; - } + var date = Date.parse(creationTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 7, + data: 'lastUpdatedTime', + render: function (lastUpdatedTime) { + if (!lastUpdatedTime) { + return ''; + } - var date = Date.parse(creationTime); - return (new Date(date)).toLocaleDateString(abp.localization.currentCulture.name); - } - }, - { - target: 7, - data: "lastUpdatedTime", - render: function (lastUpdatedTime) { - if (!lastUpdatedTime) { - return ""; - } + var date = Date.parse(lastUpdatedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 8, + data: 'lastSignificantUpdateTime', + render: function (lastSignificantUpdateTime) { + if (!lastSignificantUpdateTime) { + return ''; + } - var date = Date.parse(lastUpdatedTime); - return (new Date(date)).toLocaleDateString(abp.localization.currentCulture.name); - } - }, - { - target: 8, - data: "lastSignificantUpdateTime", - render: function (lastSignificantUpdateTime) { - if (!lastSignificantUpdateTime) { - return ""; - } + var date = Date.parse(lastSignificantUpdateTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 9, + data: 'lastCachedTime', + render: function (lastCachedTime) { + if (!lastCachedTime) { + return ''; + } - var date = Date.parse(lastSignificantUpdateTime); - return (new Date(date)).toLocaleDateString(abp.localization.currentCulture.name); - } - }, - { - target: 9, - data: "lastCachedTime", - render: function (lastCachedTime) { - if (!lastCachedTime) { - return ""; - } + var date = Date.parse(lastCachedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + ], + }) + ); - var date = Date.parse(lastCachedTime); - return (new Date(date)).toLocaleDateString(abp.localization.currentCulture.name); - } - } - ] - })); - - $("#FilterForm input[type='text']").keypress(function (e) { - if (e.which === 13) { - dataTable.ajax.reload(); - } - }); - - $("#SearchButton").click(function (e) { - e.preventDefault(); - dataTable.ajax.reload(); - }); + $("#FilterForm input[type='text']").keypress(function (e) { + if (e.which === 13) { + dataTable.ajax.reload(); + } + }); + $('#SearchButton').click(function (e) { + e.preventDefault(); + dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js index 8c62b5de34..db4fa9b662 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js @@ -1,23 +1,23 @@ var abp = abp || {}; $(function () { - abp.modals.projectPull = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - var fg = $form.find("#PullDocument_Name").parent(); - var nameInput = fg.html(); + abp.modals.projectPull = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + var fg = $form.find('#PullDocument_Name').parent(); + var nameInput = fg.html(); - $form.find("input:checkbox").change(function() { - if ($(this).prop("checked")) { - fg.html(""); - } else { - fg.html(nameInput); - } - }); - }; + $form.find('input:checkbox').change(function () { + if ($(this).prop('checked')) { + fg.html(''); + } else { + fg.html(nameInput); + } + }); + }; - return { - initModal: initModal - }; - }; -}); \ No newline at end of file + return { + initModal: initModal, + }; + }; +}); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js index bf06d0750d..1b78f44791 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js @@ -1,14 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); + abp.modals.projectCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - - }; - - return { - initModal: initModal - } - }; -}); \ No newline at end of file + return { + initModal: initModal, + }; + }; +}); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js index 14987552fb..287ea898d7 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js @@ -1,14 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); + abp.modals.projectEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - - }; - - return { - initModal: initModal - } - }; -}); \ No newline at end of file + return { + initModal: initModal, + }; + }; +}); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js index baf4c6b646..e7b57b116e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js @@ -1,146 +1,155 @@ $(function () { + var l = abp.localization.getResource('Docs'); - var l = abp.localization.getResource('Docs'); + var _createModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', + modalClass: 'projectCreate', + }); - var _createModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', - modalClass: 'projectCreate' - }); + var _editModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', + modalClass: 'projectEdit', + }); - var _editModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', - modalClass: 'projectEdit' - }); + var _pullModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', + modalClass: 'projectPull', + }); - var _pullModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', - modalClass: 'projectPull' - }); + var _dataTable = $('#ProjectsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[2, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.docs.admin.projectsAdmin.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted('Docs.Admin.Projects.Update'), + action: function (data) { + _editModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('Docs.Admin.Projects.Delete'), + confirmMessage: function (data) { + return l('ProjectDeletionWarningMessage'); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('Pull'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + action: function (data) { + _pullModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('ClearCache'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + confirmMessage: function (data) { + return l('ClearCacheConfirmationMessage', data.record.name); + }, + action: function (data) { + volo.docs.admin.documentsAdmin + .clearCache({ projectId: data.record.id }) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndexProject'), + visible: abp.auth.isGranted('Docs.Admin.Documents'), + confirmMessage: function (data) { + return l( + 'ReIndexProjectConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .reindex({ projectId: data.record.id }) + .then(function () { + abp.message.success( + l('SuccessfullyReIndexProject', data.record.name) + ); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'documentStoreType', + }, + { + target: 4, + data: 'format', + render: function (data) { + if (data === 'md') { + return 'markdown'; + } + return data; + }, + }, + ], + }) + ); - var _dataTable = $('#ProjectsTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[2, "desc"]], - ajax: abp.libs.datatables.createAjax(volo.docs.admin.projectsAdmin.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Update'), - action: function (data) { - _editModal.open({ - Id: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Delete'), - confirmMessage: function (data) { return l('ProjectDeletionWarningMessage') }, - action: function (data) { - volo.docs.admin.projectsAdmin - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - }, - { - text: l('Pull'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - action: function (data) { - _pullModal.open({ - Id: data.record.id - }); - } - }, - { - text: l('ClearCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { return l('ClearCacheConfirmationMessage', data.record.name); }, - action: function (data) { - volo.docs.admin.documentsAdmin - .clearCache({ projectId: data.record.id}) - .then(function () { - _dataTable.ajax.reload(); - }); - } - }, - { - text: l('ReIndexProject'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { return l('ReIndexProjectConfirmationMessage', data.record.name); }, - action: function (data) { - volo.docs.admin.projectsAdmin - .reindex({ projectId: data.record.id}) - .then(function () { - abp.message.success(l('SuccessfullyReIndexProject', data.record.name)); - }); - } - } - ] - } - }, - { - target: 1, - data: "name" - }, - { - target: 2, - data: "shortName" - }, - { - target: 3, - data: "documentStoreType" - }, - { - target: 4, - data: "format", - render: function (data) { - if (data === 'md') { - return 'markdown'; - } + $('#CreateNewGithubProjectButtonId').click(function (event) { + event.preventDefault(); + _createModal.open({ source: 'GitHub' }); + }); - return data; - } - } - ] - })); + $('#ReIndexAllProjects').click(function (event) { + abp.message + .confirm(l('ReIndexAllProjectConfirmationMessage')) + .done(function (accepted) { + if (accepted) { + volo.docs.admin.projectsAdmin.reindexAll().then(function () { + abp.message.success(l('SuccessfullyReIndexAllProject')); + }); + } + }); + }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - $("#CreateNewGithubProjectButtonId").click(function (event) { - event.preventDefault(); - _createModal.open({source:"GitHub"}); - }); - - $("#ReIndexAllProjects").click(function (event) { - abp.message.confirm(l('ReIndexAllProjectConfirmationMessage')) - .done(function (accepted) { - if (accepted) { - volo.docs.admin.projectsAdmin - .reindexAll() - .then(function () { - abp.message.success(l('SuccessfullyReIndexAllProject')); - }); - } - }); - }); - - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 71fb550539..915428048f 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -1,311 +1,343 @@ (function ($) { - - $(function () { - var initNavigationFilter = function (navigationContainerId) { - - var $navigation = $("#" + navigationContainerId); - - var getShownDocumentLinks = function () { - return $navigation.find(".mCSB_container > li a:visible").not(".tree-toggle"); - }; - - var gotoFilteredDocumentIfThereIsOnlyOne = function () { - var $links = getShownDocumentLinks(); - if ($links.length === 1) { - var url = $links.first().attr("href"); - if (url === "javascript:;") { - return; - } - - window.location = url; - } - }; - - var filterDocumentItems = function (filterText) { - $navigation.find(".mCSB_container .opened").removeClass("opened"); - $navigation.find(".mCSB_container > li, .mCSB_container > li ul").hide(); - - if (!filterText) { - $navigation.find(".mCSB_container > li").show(); - $navigation.find(".mCSB_container .selected-tree > ul").show(); - return; - } - - var filteredItems = $navigation.find("li > a").filter(function () { - return $(this).text().toUpperCase().indexOf(filterText.toUpperCase()) > -1; - }); - - filteredItems.each(function () { - - var $el = $(this); - $el.show(); - var $parent = $el.parent(); - - var hasParent = true; - while (hasParent) { - if ($parent.attr("id") === navigationContainerId) { - break; - } - - $parent.show(); - $parent.find("> li > label").not(".last-link").addClass("opened"); - - $parent = $parent.parent(); - hasParent = $parent.length > 0; - } - }); - }; - - $("#filter").keyup(function (e) { - filterDocumentItems(e.target.value); - - if (e.key === "Enter") { - gotoFilteredDocumentIfThereIsOnlyOne(); - } - }); - - $("#fullsearch").keyup(function (e) { - if (e.key === "Enter") { - window.open($(this).data("fullsearch-url") + this.value); - } - }); - }; - - var initAnchorTags = function (container) { - anchors.options = { - placement: 'left' - }; - - var anchorTags = ["h1", "h2", "h3", "h4", "h5", "h6"]; - anchorTags.forEach(function (tag) { - anchors.add(container + " " + tag); - }); - }; - - var initSocialShareLinks = function () { - var pageHeader = $(".docs-body").find("h1, h2").first().text(); - - var projectName = $('#ProjectName')[0].innerText; - - $('#TwitterShareLink').attr('href', - 'https://twitter.com/intent/tweet?text=' + encodeURI(pageHeader + " | " + projectName + " | " + window.location.href) - ); - - $('#LinkedinShareLink').attr('href', - 'https://www.linkedin.com/shareArticle?' - + 'url=' + encodeURI(window.location.href) + '&' - + 'mini=true&' - + "summary=" + encodeURI(projectName) + '&' - + "title=" + encodeURI(pageHeader) + '&' - + "source=" + encodeURI($('#GoToMainWebSite').attr('href')) - ); - - $('#EmailShareLink').attr('href', - 'mailto:?' - + 'body=' + encodeURI('I want you to look at ' + window.location.href) + '&' - + "subject=" + encodeURI(pageHeader + ' | ' + projectName) + '&' - ); - }; - - var initSections = function () { - var clearQueryString = function () { - var uri = window.location.href.toString(); - - if (uri.indexOf("?") > 0) { - uri = uri.substring(0, uri.indexOf("?")); - } - - window.history.replaceState({}, document.title, uri); - }; - - var setQueryString = function () { - var comboboxes = $(".doc-section-combobox"); - if (comboboxes.length < 1) { - return; - } - - var hash = document.location.hash; - - clearQueryString(); - - var uri = window.location.href.toString(); - - var new_uri = uri + "?"; - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - new_uri += key + "=" + value; - - if (i !== comboboxes.length - 1) { - new_uri += "&"; - } - } - - window.history.replaceState({}, document.title, new_uri + hash); - }; - - var getTenYearsLater = function () { - var tenYearsLater = new Date(); - tenYearsLater.setTime(tenYearsLater.getTime() + (365 * 10 * 24 * 60 * 60 * 1000)); - return tenYearsLater; - }; - - var setCookies = function () { - var cookie = abp.utils.getCookieValue("AbpDocsPreferences"); - - if (!cookie || cookie == null || cookie === null) { - cookie = ""; - } - var keyValues = cookie.split("|"); - - var comboboxes = $(".doc-section-combobox"); - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - var changed = false; - var keyValueslength = keyValues.length; - for (var k = 0; k < keyValueslength; k++) { - var splitted = keyValues[k].split("="); - - if (splitted.length > 0 && splitted[0] === key) { - keyValues[k] = key + "=" + value; - changed = true; - } - } - - if (!changed) { - keyValues.push(key + "=" + value); - } - } - - abp.utils.setCookieValue("AbpDocsPreferences", keyValues.join('|'), getTenYearsLater(), '/'); - }; - - $(".doc-section-combobox").change(function () { - setCookies(); - clearQueryString(); - location.reload(); - }); - - setQueryString(); - }; - - var initCrawlerLinks = function () { - - var isCrawler = function () { - var crawlers = [ - 'Google', - 'Googlebot', - 'YandexBot', - 'msnbot', - 'Rambler', - 'Yahoo', - 'AbachoBOT', - 'accoona', - 'AcoiRobot', - 'ASPSeek', - 'CrocCrawler', - 'Dumbot', - 'FAST-WebCrawler', - 'GeonaBot', - 'Gigabot', - 'Lycos', - 'MSRBOT', - 'Scooter', - 'AltaVista', - 'IDBot', - 'eStyle', - 'Scrubby', - 'Slurp', - 'DuckDuckBot', - 'Baiduspider', - 'VoilaBot', - 'ExaLead', - 'Search Dog', - 'MSN Bot', - 'BingBot' - ]; - - var agent = navigator.userAgent; - - for (var i = 0; i < crawlers.length; i++) { - - if (agent.indexOf(crawlers[i]) >= 0) { - return true; - } - } - - return false; - }; - - if (!isCrawler()) { - return; - } - - var comboboxes = $(".doc-section-combobox"); - - if (comboboxes.length <= 0) { - return; - } - - $("#crawler_link").show(); - - var html = ''; - - var currentUrl = window.location.href.toString(); - - if (currentUrl.indexOf("?") > 0) { - currentUrl = currentUrl.substring(0, currentUrl.indexOf("?")); - } - - var getQueryStringsFromComboboxes = function (x) { - if (x >= comboboxes.length) { - return []; - } - - var key = $(comboboxes[x]).data("key"); - - var queryStrings = getQueryStringsFromComboboxes(x + 1); - var returnList = []; - - $(comboboxes[x]).find("option").each(function () { - - if (queryStrings.length <= 0) { - returnList.push(key + "=" + $(this).val()); - - } else { - for (var k = 0; k < queryStrings.length; k++) { - returnList.push(key + "=" + $(this).val() + "&" + queryStrings[k]); - } - } - }); - - return returnList; - }; - - var queryStrings = getQueryStringsFromComboboxes(0); - - for (var i = 0; i < queryStrings.length; i++) { - html += "" + queryStrings[i] + " " - } - - $("#crawler_link").html(html); - }; - - initNavigationFilter("sidebar-scroll"); - - initAnchorTags(".docs-page .docs-body"); - - initSocialShareLinks(); - - initSections(); - - initCrawlerLinks(); - - }); - -})(jQuery); \ No newline at end of file + $(function () { + var initNavigationFilter = function (navigationContainerId) { + var $navigation = $('#' + navigationContainerId); + + var getShownDocumentLinks = function () { + return $navigation + .find('.mCSB_container > li a:visible') + .not('.tree-toggle'); + }; + + var gotoFilteredDocumentIfThereIsOnlyOne = function () { + var $links = getShownDocumentLinks(); + if ($links.length === 1) { + var url = $links.first().attr('href'); + if (url === 'javascript:;') { + return; + } + + window.location = url; + } + }; + + var filterDocumentItems = function (filterText) { + $navigation.find('.mCSB_container .opened').removeClass('opened'); + $navigation + .find('.mCSB_container > li, .mCSB_container > li ul') + .hide(); + + if (!filterText) { + $navigation.find('.mCSB_container > li').show(); + $navigation.find('.mCSB_container .selected-tree > ul').show(); + return; + } + + var filteredItems = $navigation.find('li > a').filter(function () { + return ( + $(this).text().toUpperCase().indexOf(filterText.toUpperCase()) > -1 + ); + }); + + filteredItems.each(function () { + var $el = $(this); + $el.show(); + var $parent = $el.parent(); + + var hasParent = true; + while (hasParent) { + if ($parent.attr('id') === navigationContainerId) { + break; + } + + $parent.show(); + $parent.find('> li > label').not('.last-link').addClass('opened'); + + $parent = $parent.parent(); + hasParent = $parent.length > 0; + } + }); + }; + + $('#filter').keyup(function (e) { + filterDocumentItems(e.target.value); + + if (e.key === 'Enter') { + gotoFilteredDocumentIfThereIsOnlyOne(); + } + }); + + $('#fullsearch').keyup(function (e) { + if (e.key === 'Enter') { + window.open($(this).data('fullsearch-url') + this.value); + } + }); + }; + + var initAnchorTags = function (container) { + anchors.options = { + placement: 'left', + }; + + var anchorTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + anchorTags.forEach(function (tag) { + anchors.add(container + ' ' + tag); + }); + }; + + var initSocialShareLinks = function () { + var pageHeader = $('.docs-body').find('h1, h2').first().text(); + + var projectName = $('#ProjectName')[0].innerText; + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI( + pageHeader + ' | ' + projectName + ' | ' + window.location.href + ) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(projectName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI($('#GoToMainWebSite').attr('href')) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + projectName) + + '&' + ); + }; + + var initSections = function () { + var clearQueryString = function () { + var uri = window.location.href.toString(); + + if (uri.indexOf('?') > 0) { + uri = uri.substring(0, uri.indexOf('?')); + } + + window.history.replaceState({}, document.title, uri); + }; + + var setQueryString = function () { + var comboboxes = $('.doc-section-combobox'); + if (comboboxes.length < 1) { + return; + } + + var hash = document.location.hash; + + clearQueryString(); + + var uri = window.location.href.toString(); + + var new_uri = uri + '?'; + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + new_uri += key + '=' + value; + + if (i !== comboboxes.length - 1) { + new_uri += '&'; + } + } + + window.history.replaceState({}, document.title, new_uri + hash); + }; + + var getTenYearsLater = function () { + var tenYearsLater = new Date(); + tenYearsLater.setTime( + tenYearsLater.getTime() + 365 * 10 * 24 * 60 * 60 * 1000 + ); + return tenYearsLater; + }; + + var setCookies = function () { + var cookie = abp.utils.getCookieValue('AbpDocsPreferences'); + + if (!cookie || cookie == null || cookie === null) { + cookie = ''; + } + var keyValues = cookie.split('|'); + + var comboboxes = $('.doc-section-combobox'); + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + var changed = false; + var keyValueslength = keyValues.length; + for (var k = 0; k < keyValueslength; k++) { + var splitted = keyValues[k].split('='); + + if (splitted.length > 0 && splitted[0] === key) { + keyValues[k] = key + '=' + value; + changed = true; + } + } + + if (!changed) { + keyValues.push(key + '=' + value); + } + } + + abp.utils.setCookieValue( + 'AbpDocsPreferences', + keyValues.join('|'), + getTenYearsLater(), + '/' + ); + }; + + $('.doc-section-combobox').change(function () { + setCookies(); + clearQueryString(); + location.reload(); + }); + + setQueryString(); + }; + + var initCrawlerLinks = function () { + var isCrawler = function () { + var crawlers = [ + 'Google', + 'Googlebot', + 'YandexBot', + 'msnbot', + 'Rambler', + 'Yahoo', + 'AbachoBOT', + 'accoona', + 'AcoiRobot', + 'ASPSeek', + 'CrocCrawler', + 'Dumbot', + 'FAST-WebCrawler', + 'GeonaBot', + 'Gigabot', + 'Lycos', + 'MSRBOT', + 'Scooter', + 'AltaVista', + 'IDBot', + 'eStyle', + 'Scrubby', + 'Slurp', + 'DuckDuckBot', + 'Baiduspider', + 'VoilaBot', + 'ExaLead', + 'Search Dog', + 'MSN Bot', + 'BingBot', + ]; + + var agent = navigator.userAgent; + + for (var i = 0; i < crawlers.length; i++) { + if (agent.indexOf(crawlers[i]) >= 0) { + return true; + } + } + + return false; + }; + + if (!isCrawler()) { + return; + } + + var comboboxes = $('.doc-section-combobox'); + + if (comboboxes.length <= 0) { + return; + } + + $('#crawler_link').show(); + + var html = ''; + + var currentUrl = window.location.href.toString(); + + if (currentUrl.indexOf('?') > 0) { + currentUrl = currentUrl.substring(0, currentUrl.indexOf('?')); + } + + var getQueryStringsFromComboboxes = function (x) { + if (x >= comboboxes.length) { + return []; + } + + var key = $(comboboxes[x]).data('key'); + + var queryStrings = getQueryStringsFromComboboxes(x + 1); + var returnList = []; + + $(comboboxes[x]) + .find('option') + .each(function () { + if (queryStrings.length <= 0) { + returnList.push(key + '=' + $(this).val()); + } else { + for (var k = 0; k < queryStrings.length; k++) { + returnList.push( + key + '=' + $(this).val() + '&' + queryStrings[k] + ); + } + } + }); + + return returnList; + }; + + var queryStrings = getQueryStringsFromComboboxes(0); + + for (var i = 0; i < queryStrings.length; i++) { + html += + '' + + queryStrings[i] + + ' '; + } + + $('#crawler_link').html(html); + }; + + initNavigationFilter('sidebar-scroll'); + + initAnchorTags('.docs-page .docs-body'); + + initSocialShareLinks(); + + initSections(); + + initCrawlerLinks(); + }); +})(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js index edc010aa9f..6b4fc7a217 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js @@ -1,20 +1,18 @@ (function ($) { + $(function () { + var errorPageRedirect = function () { + var second = 3; + var close = setInterval(() => { + $('#ErrorRedirectSeconds').text(`(${--second})`); + if (second === 0) { + clearInterval(close); + $('#ErrorRedirect')[0].click(); + } + }, 1000); + }; - $(function () { - var errorPageRedirect = function () { - var second = 3; - var close = setInterval(() => { - $("#ErrorRedirectSeconds").text(`(${--second})`); - if (second === 0) { - clearInterval(close); - $("#ErrorRedirect")[0].click(); - } - }, 1000); - } - - if (document.getElementById("ErrorRedirect")) { - errorPageRedirect(); - } - }); - + if (document.getElementById('ErrorRedirect')) { + errorPageRedirect(); + } + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js index aaffc53ddf..2d185498a1 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js @@ -1,152 +1,165 @@ (function ($) { - $(function () { - $('li:not(.last-link) a.tree-toggle').click(function () { - $(this).parent().children('ul.tree').toggle(100); - $(this).closest("li").toggleClass("selected-tree"); - }); - - $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click(function () { - - var $element = $(this).parent(); - - $element.parent().children('ul.tree').toggle(100); - $element.closest("li").toggleClass("selected-tree"); - }); - - var scrollTopBtn = $(".scroll-top-btn"); - var enoughHeight = $(".docs-sidebar-wrapper > .docs-top").height() + 60; - var enoughHeightPlus = 500; - - $(window).scroll(function () { - var topPos = $(window).scrollTop(); - if (topPos > enoughHeight) { - $(scrollTopBtn).addClass("showup"); - $("body").addClass("scrolled"); - } else { - $(scrollTopBtn).removeClass("showup"); - $("body").removeClass("scrolled"); - } - if (topPos > enoughHeightPlus) { - $("body").addClass("scrolledMore"); - } else { - $("body").removeClass("scrolledMore"); - } - }); - - $(scrollTopBtn).click(function () { - $('html, body').animate({ - scrollTop: 0 - }, 500); - return false; - }); - - var scrollToHashLink = function () { - var hash = window.location.hash; - - if (!hash || hash === "#") { - return; - } - - var $targetElement = $(decodeURIComponent(hash)); - - $targetElement = $targetElement.length ? $targetElement : $('[name=' + this.hash.slice(1) + ']'); - - if (!$targetElement.length) { - return; - } - - $('html,body').stop().animate({ - scrollTop: $targetElement.offset().top - }, 200); - - return; - }; - - $(document).ready(function () { - handleCustomScrolls(); - - var $myNav = $("#docs-sticky-index"); - Toc.init($myNav); - - $("body").scrollspy({ - target: $myNav - }); - - $("#docs-sticky-index a").on('click', function (event) { - if (this.hash !== "") { - event.preventDefault(); - var hash = this.hash; - $('html, body').animate({ - scrollTop: $(decodeURIComponent(hash)).offset().top - }, 500, function () { - window.location.hash = hash; - }); - } - }); - - $(".btn-toggle").on("click", function () { - $(".toggle-row").slideToggle(400); - $(this).toggleClass("less"); - }); - - $(".close-mmenu").on("click", function () { - $(".navbar-collapse").removeClass("show"); - }); - - $(".open-dmenu").on("click", function () { - $(".docs-tree-list").slideToggle(); - }); - - scrollToHashLink(); - }); - - $(window).resize(function () { - handleCustomScrolls(); - }); - }); - - function handleCustomScrolls() { - var wWidth = $(window).width(); - if (wWidth > 766) { - $("#sidebar-scroll").mCustomScrollbar({ - theme: "minimal", - alwaysShowScrollbar: 0, - }); - - $("#scroll-index").mCustomScrollbar({ - theme: "minimal-dark", - alwaysShowScrollbar: 0, - }); - } - } - - window.Toc.helpers.createNavList = function () { - return $(''); - }; - - window.Toc.helpers.createChildNavList = function ($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }; - - window.Toc.helpers.generateNavEl = function (anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $(''); - $li.append($a); - return $li; - }; - - function docsCriteria() { - var docsContentWidth = $(".docs-content").width() - 20; - $(".alert-criteria").width(docsContentWidth); - } - $(document).ready(function () { - docsCriteria(); - }); - $(window).resize(function () { - docsCriteria(); - }); -})(jQuery); \ No newline at end of file + $(function () { + $('li:not(.last-link) a.tree-toggle').click(function () { + $(this).parent().children('ul.tree').toggle(100); + $(this).closest('li').toggleClass('selected-tree'); + }); + + $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click( + function () { + var $element = $(this).parent(); + + $element.parent().children('ul.tree').toggle(100); + $element.closest('li').toggleClass('selected-tree'); + } + ); + + var scrollTopBtn = $('.scroll-top-btn'); + var enoughHeight = $('.docs-sidebar-wrapper > .docs-top').height() + 60; + var enoughHeightPlus = 500; + + $(window).scroll(function () { + var topPos = $(window).scrollTop(); + if (topPos > enoughHeight) { + $(scrollTopBtn).addClass('showup'); + $('body').addClass('scrolled'); + } else { + $(scrollTopBtn).removeClass('showup'); + $('body').removeClass('scrolled'); + } + if (topPos > enoughHeightPlus) { + $('body').addClass('scrolledMore'); + } else { + $('body').removeClass('scrolledMore'); + } + }); + + $(scrollTopBtn).click(function () { + $('html, body').animate( + { + scrollTop: 0, + }, + 500 + ); + return false; + }); + + var scrollToHashLink = function () { + var hash = window.location.hash; + + if (!hash || hash === '#') { + return; + } + + var $targetElement = $(decodeURIComponent(hash)); + + $targetElement = $targetElement.length + ? $targetElement + : $('[name=' + this.hash.slice(1) + ']'); + + if (!$targetElement.length) { + return; + } + + $('html,body').stop().animate( + { + scrollTop: $targetElement.offset().top, + }, + 200 + ); + + return; + }; + + $(document).ready(function () { + handleCustomScrolls(); + + var $myNav = $('#docs-sticky-index'); + Toc.init($myNav); + + $('body').scrollspy({ + target: $myNav, + }); + + $('#docs-sticky-index a').on('click', function (event) { + if (this.hash !== '') { + event.preventDefault(); + var hash = this.hash; + $('html, body').animate( + { + scrollTop: $(decodeURIComponent(hash)).offset().top, + }, + 500, + function () { + window.location.hash = hash; + } + ); + } + }); + + $('.btn-toggle').on('click', function () { + $('.toggle-row').slideToggle(400); + $(this).toggleClass('less'); + }); + + $('.close-mmenu').on('click', function () { + $('.navbar-collapse').removeClass('show'); + }); + + $('.open-dmenu').on('click', function () { + $('.docs-tree-list').slideToggle(); + }); + + scrollToHashLink(); + }); + + $(window).resize(function () { + handleCustomScrolls(); + }); + }); + + function handleCustomScrolls() { + var wWidth = $(window).width(); + if (wWidth > 766) { + $('#sidebar-scroll').mCustomScrollbar({ + theme: 'minimal', + alwaysShowScrollbar: 0, + }); + + $('#scroll-index').mCustomScrollbar({ + theme: 'minimal-dark', + alwaysShowScrollbar: 0, + }); + } + } + + window.Toc.helpers.createNavList = function () { + return $(''); + }; + + window.Toc.helpers.createChildNavList = function ($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }; + + window.Toc.helpers.generateNavEl = function (anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $(''); + $li.append($a); + return $li; + }; + + function docsCriteria() { + var docsContentWidth = $('.docs-content').width() - 20; + $('.alert-criteria').width(docsContentWidth); + } + $(document).ready(function () { + docsCriteria(); + }); + $(window).resize(function () { + docsCriteria(); + }); +})(jQuery); From d8dd4f7468cd53c946ff85a38a0045a6170c68ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:52:16 +0300 Subject: [PATCH 13/41] Feature Management - prettier settings added and js files reformatted --- modules/feature-management/.prettierrc | 4 +++ .../feature-management-modal.js | 25 ++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 modules/feature-management/.prettierrc diff --git a/modules/feature-management/.prettierrc b/modules/feature-management/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/feature-management/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js index 74b66f467d..0df9d50775 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js @@ -1,17 +1,14 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; + abp.modals = abp.modals || {}; - abp.modals.FeatureManagement = function () { - - $('.FeatureValueCheckbox').change(function () { - if (this.checked) { - $(this).val("true"); - } - else { - $(this).val("false"); - } - }); - - }; -})(jQuery); \ No newline at end of file + abp.modals.FeatureManagement = function () { + $('.FeatureValueCheckbox').change(function () { + if (this.checked) { + $(this).val('true'); + } else { + $(this).val('false'); + } + }); + }; +})(jQuery); From 751ee5b77970eeab444d2e29c9007fc10d0dba5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:52:38 +0300 Subject: [PATCH 14/41] Settings Management - prettier settings added and js files reformatted --- modules/setting-management/.prettierrc | 4 ++++ .../Pages/SettingManagement/Index.js | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 modules/setting-management/.prettierrc diff --git a/modules/setting-management/.prettierrc b/modules/setting-management/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/setting-management/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js index 346c2f2ce4..6a72d6872e 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js @@ -1,7 +1,7 @@ (function ($) { - var l = abp.localization.getResource('AbpSettingManagement'); + var l = abp.localization.getResource('AbpSettingManagement'); - $(document).on("AbpSettingSaved", function () { - abp.notify.success(l("SuccessfullySaved")); - }); -})(jQuery); \ No newline at end of file + $(document).on('AbpSettingSaved', function () { + abp.notify.success(l('SuccessfullySaved')); + }); +})(jQuery); From b6f4aef7ef92e7f3e1735547f958bdbf9dd3ba45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:53:11 +0300 Subject: [PATCH 15/41] Tenant Management - prettier settings added and js files reformatted --- modules/tenant-management/.prettierrc | 4 + .../Tenants/ConnectionStringsModal.js | 34 ++-- .../Pages/TenantManagement/Tenants/Index.js | 185 ++++++++++-------- 3 files changed, 120 insertions(+), 103 deletions(-) create mode 100644 modules/tenant-management/.prettierrc diff --git a/modules/tenant-management/.prettierrc b/modules/tenant-management/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/tenant-management/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js index b72d2b3505..0fdba0a660 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js @@ -1,20 +1,18 @@ (function ($) { + abp.modals.TenantConnectionStringManagement = function () { + var initModal = function (publicApi, args) { + publicApi + .getModal() + .find('input[name="Tenant.UseSharedDatabase"]') + .change(function () { + var $this = $(this); + $('#Tenant_DefaultConnectionString_Wrap').toggleClass('d-none'); + $this.val($this.prop('checked')); + }); + }; - abp.modals.TenantConnectionStringManagement = function() { - - var initModal = function (publicApi, args) { - publicApi.getModal() - .find('input[name="Tenant.UseSharedDatabase"]') - .change(function () { - var $this = $(this); - $("#Tenant_DefaultConnectionString_Wrap").toggleClass("d-none"); - $this.val($this.prop("checked")); - }); - }; - - return { - initModal: initModal - }; - }; - -})(jQuery); \ No newline at end of file + return { + initModal: initModal, + }; + }; +})(jQuery); 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 0dc1861790..c3f00dcd24 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 @@ -1,93 +1,108 @@ (function () { + var l = abp.localization.getResource('AbpTenantManagement'); + var _tenantAppService = volo.abp.tenantManagement.tenant; - var l = abp.localization.getResource('AbpTenantManagement'); - var _tenantAppService = volo.abp.tenantManagement.tenant; + var _editModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/CreateModal' + ); + var _featuresModal = new abp.ModalManager( + abp.appPath + 'FeatureManagement/FeatureManagementModal' + ); + var _connectionStringsModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', + modalClass: 'TenantConnectionStringManagement', + }); - var _editModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/EditModal'); - var _createModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/CreateModal'); - var _featuresModal = new abp.ModalManager(abp.appPath + 'FeatureManagement/FeatureManagementModal'); - var _connectionStringsModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', - modalClass: 'TenantConnectionStringManagement' - }); + $(function () { + var _$wrapper = $('#TenantsWrapper'); - $(function () { + var _dataTable = _$wrapper.find('table').DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + paging: true, + scrollX: true, + serverSide: true, + ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('ConnectionStrings'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageConnectionStrings' + ), + action: function (data) { + _connectionStringsModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Features'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageFeatures' + ), + action: function (data) { + _featuresModal.open({ + providerName: 'T', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Delete' + ), + confirmMessage: function (data) { + return l( + 'TenantDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _tenantAppService.delete(data.record.id).then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + }, + ], + }) + ); - var _$wrapper = $('#TenantsWrapper'); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - var _dataTable = _$wrapper.find('table').DataTable(abp.libs.datatables.normalizeConfiguration({ - order: [[1, "asc"]], - processing: true, - paging: true, - scrollX: true, - serverSide: true, - ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpTenantManagement.Tenants.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id - }); - } - }, - { - text: l('ConnectionStrings'), - visible: abp.auth.isGranted('AbpTenantManagement.Tenants.ManageConnectionStrings'), - action: function (data) { - _connectionStringsModal.open({ - id: data.record.id - }); - } - }, - { - text: l('Features'), - visible: abp.auth.isGranted('AbpTenantManagement.Tenants.ManageFeatures'), - action: function (data) { - _featuresModal.open({ - providerName: 'T', - providerKey: data.record.id - }); - } - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('AbpTenantManagement.Tenants.Delete'), - confirmMessage: function (data) { return l('TenantDeletionConfirmationMessage', data.record.name)}, - action: function (data) { - _tenantAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { - data: "name" - } - ] - })); - - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); - - _$wrapper.find('button[name=CreateTenant]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); + _$wrapper.find('button[name=CreateTenant]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(); From d570f5060b7ca3c84e69b21494395e60b10ff1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 9 Jul 2020 14:53:36 +0300 Subject: [PATCH 16/41] Virtual File Explorer - prettier settings added and js files reformatted --- modules/virtual-file-explorer/.prettierrc | 4 ++++ .../Pages/VirtualFileExplorer/index.js | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 modules/virtual-file-explorer/.prettierrc diff --git a/modules/virtual-file-explorer/.prettierrc b/modules/virtual-file-explorer/.prettierrc new file mode 100644 index 0000000000..7d1b8aa721 --- /dev/null +++ b/modules/virtual-file-explorer/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "useTabs": true +} diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js index a67939ca43..e535b810e8 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js @@ -1,7 +1,9 @@ -var _fileContentModal = new abp.ModalManager(abp.appPath + 'VirtualFileExplorer/FileContentModal'); +var _fileContentModal = new abp.ModalManager( + abp.appPath + 'VirtualFileExplorer/FileContentModal' +); function showContent(filePath) { - _fileContentModal.open({ - filePath: filePath - }); + _fileContentModal.open({ + filePath: filePath, + }); } From 0253eeaa72c9c61ef5f42324e6d1ca2c143d5328 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Thu, 9 Jul 2020 22:13:58 +0800 Subject: [PATCH 17/41] Convert special characters in LanguageCode. --- .../FullSearch/Elastic/ElasticDocumentFullSearch.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/ElasticDocumentFullSearch.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/ElasticDocumentFullSearch.cs index cbe5905d3a..05a3f1c4c8 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/ElasticDocumentFullSearch.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/ElasticDocumentFullSearch.cs @@ -72,7 +72,7 @@ namespace Volo.Docs.Documents.FullSearch.Elastic Name = document.Name, FileName = document.FileName, Content = document.Content, - LanguageCode = document.LanguageCode, + LanguageCode = ConvertLanguageCode(document.LanguageCode), Version = document.Version }; @@ -178,7 +178,7 @@ namespace Volo.Docs.Documents.FullSearch.Elastic new TermQuery { Field = "languageCode", - Value = languageCode + Value = ConvertLanguageCode(languageCode) } } } @@ -232,5 +232,10 @@ namespace Volo.Docs.Documents.FullSearch.Elastic throw new BusinessException(DocsDomainErrorCodes.ElasticSearchNotEnabled); } } + + protected string ConvertLanguageCode(string languageCode) + { + return languageCode.Replace("-", "").ToLower(); + } } } From 54394b30f286fb92055e99d04197f479ed5d1054 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Thu, 9 Jul 2020 22:38:19 +0800 Subject: [PATCH 18/41] Filter Navigation and Parameters in the search results. --- .../Volo/Docs/Documents/DocumentAppService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 02bb535f50..6cacf9d3e3 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -176,7 +176,7 @@ namespace Volo.Docs.Documents Version = esDoc.Version, LanguageCode = esDoc.LanguageCode, Highlight = esDoc.Highlight - }).ToList(); + }).Where(x => x.FileName != project.NavigationDocumentName && x.FileName != project.ParametersDocumentName).ToList(); } public async Task FullSearchEnabledAsync() @@ -338,4 +338,4 @@ namespace Volo.Docs.Documents return TimeSpan.Parse(value); } } -} \ No newline at end of file +} From b38ef874681d5d1bdc672e6d27bc4d86dc60308b Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Fri, 10 Jul 2020 09:02:58 +0800 Subject: [PATCH 19/41] Improve search list page and Pull function. --- .../Documents/DocumentAdminAppService.cs | 45 +++++++++++-------- .../Pages/Documents/Search.cshtml.cs | 25 +++++++++-- 2 files changed, 48 insertions(+), 22 deletions(-) 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 cb6443d268..ff6c7bc654 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 @@ -3,7 +3,9 @@ using System.Collections.Generic; using System.Linq; 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; @@ -96,28 +98,35 @@ namespace Volo.Docs.Admin.Documents var source = _documentStoreFactory.Create(project.DocumentStoreType); - var documents = new List(); foreach (var leaf in leafs) { - if (leaf.Path.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || - leaf.Path.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + using (var uow = UnitOfWorkManager.Begin(requiresNew: true)) { - continue; + if (leaf.Path.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || + leaf.Path.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || + (leaf.Path.StartsWith("{{") && leaf.Path.EndsWith("}}"))) + { + continue; + } + + try + { + var sourceDocument = await source.GetDocumentAsync(project, leaf.Path, input.LanguageCode, input.Version); + + await _documentRepository.DeleteAsync(sourceDocument.ProjectId, sourceDocument.Name, + sourceDocument.LanguageCode, + sourceDocument.Version); + + await _documentRepository.InsertAsync(sourceDocument, true); + await UpdateDocumentUpdateInfoCache(sourceDocument); + + await uow.CompleteAsync(); + } + catch (Exception e) + { + Logger.LogException(e); + } } - - var sourceDocument = - await source.GetDocumentAsync(project, leaf.Path, input.LanguageCode, input.Version); - documents.Add(sourceDocument); - } - - foreach (var document in documents) - { - await _documentRepository.DeleteAsync(document.ProjectId, document.Name, - document.LanguageCode, - document.Version); - - await _documentRepository.InsertAsync(document, true); - await UpdateDocumentUpdateInfoCache(document); } } diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml.cs index 702141bc1e..1e4e797e73 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Search.cshtml.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Encodings.Web; using System.Threading.Tasks; +using System.Web; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Volo.Docs.Documents; @@ -29,12 +31,15 @@ namespace Volo.Docs.Pages.Documents private readonly IProjectAppService _projectAppService; private readonly IDocumentAppService _documentAppService; + private readonly HtmlEncoder _encoder; - public SearchModel(IProjectAppService projectAppService, - IDocumentAppService documentAppService) + public SearchModel(IProjectAppService projectAppService, + IDocumentAppService documentAppService, + HtmlEncoder encoder) { _projectAppService = projectAppService; _documentAppService = documentAppService; + _encoder = encoder; } public List SearchOutputs { get; set; } = new List(); @@ -45,7 +50,7 @@ namespace Volo.Docs.Pages.Documents { return RedirectToPage("Index"); } - + KeyWord = keyword; Project = await _projectAppService.GetAsync(ProjectName); @@ -67,7 +72,19 @@ namespace Volo.Docs.Pages.Documents Version = Version }); + var highlightTag1 = Guid.NewGuid().ToString(); + var highlightTag2 = Guid.NewGuid().ToString(); + foreach (var searchOutput in SearchOutputs) + { + for (var i = 0; i < searchOutput.Highlight.Count; i++) + { + searchOutput.Highlight[i] = _encoder + .Encode(searchOutput.Highlight[i].Replace("", highlightTag1).Replace("", highlightTag2)) + .Replace(highlightTag1, "").Replace(highlightTag2, ""); + } + } + return Page(); } } -} \ No newline at end of file +} From 865be7ae78d55052228b4fb0e39955ac09235c84 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Fri, 10 Jul 2020 09:12:56 +0800 Subject: [PATCH 20/41] Update DocumentAdminAppService. --- .../Documents/DocumentAdminAppService.cs | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) 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 ff6c7bc654..c6758127cf 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 @@ -98,35 +98,35 @@ namespace Volo.Docs.Admin.Documents var source = _documentStoreFactory.Create(project.DocumentStoreType); + var documents = new List(); foreach (var leaf in leafs) { - using (var uow = UnitOfWorkManager.Begin(requiresNew: true)) + if (leaf.Path.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || + leaf.Path.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || + (leaf.Path.StartsWith("{{") && leaf.Path.EndsWith("}}"))) { - if (leaf.Path.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || - leaf.Path.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || - (leaf.Path.StartsWith("{{") && leaf.Path.EndsWith("}}"))) - { - continue; - } - - try - { - var sourceDocument = await source.GetDocumentAsync(project, leaf.Path, input.LanguageCode, input.Version); - - await _documentRepository.DeleteAsync(sourceDocument.ProjectId, sourceDocument.Name, - sourceDocument.LanguageCode, - sourceDocument.Version); - - await _documentRepository.InsertAsync(sourceDocument, true); - await UpdateDocumentUpdateInfoCache(sourceDocument); - - await uow.CompleteAsync(); - } - catch (Exception e) - { - Logger.LogException(e); - } + continue; } + + try + { + var sourceDocument = await source.GetDocumentAsync(project, leaf.Path, input.LanguageCode, input.Version); + documents.Add(sourceDocument); + } + catch (Exception e) + { + Logger.LogException(e); + } + } + + foreach (var document in documents) + { + await _documentRepository.DeleteAsync(document.ProjectId, document.Name, + document.LanguageCode, + document.Version); + + await _documentRepository.InsertAsync(document, true); + await UpdateDocumentUpdateInfoCache(document); } } From f568ff84c129d251252aa3ccf224930b0b07b3a4 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 10 Jul 2020 11:17:22 +0800 Subject: [PATCH 21/41] Added form-elements.md --- docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md diff --git a/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md new file mode 100644 index 0000000000..cb82a640d5 --- /dev/null +++ b/docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Form-elements.md @@ -0,0 +1 @@ +TODO... \ No newline at end of file From 0a906bac7e7818b60704aa8968f3e4e50bcd4674 Mon Sep 17 00:00:00 2001 From: Necati Meral Date: Fri, 10 Jul 2020 13:23:56 +0200 Subject: [PATCH 22/41] Fixed typo --- framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json index c5de3f200c..9727a11823 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/de.json @@ -56,7 +56,7 @@ "401Message": "Unauthorisiert", "403Message": "Verboten", "404Message": "Seite nicht gefunden", - "500Message": "Internet Server Fehler", + "500Message": "Interner Server Fehler", "GoHomePage": "Zur Startseite", "GoBack": "Zurück" } From d165dcc2ad794494b503b4ceb2ef7981ae2a5655 Mon Sep 17 00:00:00 2001 From: Hamza Date: Fri, 10 Jul 2020 21:02:48 +0500 Subject: [PATCH 23/41] .browserslistrc typo --- docs/en/UI/Angular/Migration-Guide-v3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/UI/Angular/Migration-Guide-v3.md b/docs/en/UI/Angular/Migration-Guide-v3.md index 6c56536065..0039aa33a6 100644 --- a/docs/en/UI/Angular/Migration-Guide-v3.md +++ b/docs/en/UI/Angular/Migration-Guide-v3.md @@ -18,7 +18,7 @@ This will make the following modifications: - Update your package.json and install new packages - Revise tsconfig.json files to create a "Solution Style" configuration -- Rename `browserlist` as `.browserlistrc` +- Rename `browserlist` as `.browserslistrc` On the other hand, it would be better if you check which packages to update first with `yarn ng update` command alone. Angular will give you a list of packages to update. From 43dd94343647d77bf31ffccc97fbb9758603c304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levent=20Arman=20=C3=96zak?= Date: Sat, 11 Jul 2020 09:13:03 +0300 Subject: [PATCH 24/41] docs: fix browserslist typo --- docs/en/UI/Angular/Migration-Guide-v3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/UI/Angular/Migration-Guide-v3.md b/docs/en/UI/Angular/Migration-Guide-v3.md index 0039aa33a6..725a04c088 100644 --- a/docs/en/UI/Angular/Migration-Guide-v3.md +++ b/docs/en/UI/Angular/Migration-Guide-v3.md @@ -18,7 +18,7 @@ This will make the following modifications: - Update your package.json and install new packages - Revise tsconfig.json files to create a "Solution Style" configuration -- Rename `browserlist` as `.browserslistrc` +- Rename `browserslist` as `.browserslistrc` On the other hand, it would be better if you check which packages to update first with `yarn ng update` command alone. Angular will give you a list of packages to update. From a86d7ad0a5144be7f3d31feed896ed830895124b Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 13 Jul 2020 10:28:45 +0300 Subject: [PATCH 25/41] docs: update generation custom app layout command in component-replacement.md --- docs/en/UI/Angular/Component-Replacement.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/en/UI/Angular/Component-Replacement.md b/docs/en/UI/Angular/Component-Replacement.md index 8c1d45134f..d2c75cd67c 100644 --- a/docs/en/UI/Angular/Component-Replacement.md +++ b/docs/en/UI/Angular/Component-Replacement.md @@ -48,9 +48,7 @@ The example below describes how to replace the `ApplicationLayoutComponent`: Run the following command to generate a layout in `angular` folder: ```bash -yarn ng generate component shared/my-application-layout --export --entryComponent - -# You don't need the --entryComponent option in Angular 9 +yarn ng generate component my-application-layout ``` Add the following code in your layout template (`my-layout.component.html`) where you want the page to be loaded. From 01ed7f9c78a44ef8e0da73150bcb11bfbc096840 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 12:06:36 +0300 Subject: [PATCH 26/41] test: use relative import for ConfigState --- npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts index cb865787fa..96bbc197d0 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts @@ -1,10 +1,10 @@ -import { ConfigState } from '@abp/ng.core'; import { createHttpFactory, HttpMethod, SpectatorHttp, SpyObject } from '@ngneat/spectator/jest'; import { NgxsModule, Store } from '@ngxs/store'; import { of, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { Rest } from '../models'; import { RestService } from '../services/rest.service'; +import { ConfigState } from '../states/config.state'; import { CORE_OPTIONS } from '../tokens'; describe('HttpClient testing', () => { From 4b7c944648710837dd6b7b7cbe1a1b8f8121a457 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 12:06:57 +0300 Subject: [PATCH 27/41] test: update PermissionGuard specs --- .../core/src/lib/guards/permission.guard.ts | 17 ++--- .../src/lib/tests/permission.guard.spec.ts | 74 ++++++++++++++++--- 2 files changed, 69 insertions(+), 22 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts b/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts index 6ba6bd18b5..5de83fef7a 100644 --- a/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts +++ b/npm/ng-packs/packages/core/src/lib/guards/permission.guard.ts @@ -1,12 +1,11 @@ import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, Router } from '@angular/router'; +import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; import { Store } from '@ngxs/store'; import { Observable, of } from 'rxjs'; import { tap } from 'rxjs/operators'; -import snq from 'snq'; import { RestOccurError } from '../actions/rest.actions'; -import { ConfigState } from '../states/config.state'; import { RoutesService } from '../services/routes.service'; +import { ConfigState } from '../states/config.state'; import { findRoute, getRoutePath } from '../utils/route-utils'; @Injectable({ @@ -15,18 +14,16 @@ import { findRoute, getRoutePath } from '../utils/route-utils'; export class PermissionGuard implements CanActivate { constructor(private router: Router, private routes: RoutesService, private store: Store) {} - canActivate( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot, - ): Observable | boolean { + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { let { requiredPolicy } = route.data || {}; if (!requiredPolicy) { - requiredPolicy = findRoute(this.routes, getRoutePath(this.router, state.url))?.requiredPolicy; - - if (!requiredPolicy) return true; + const route = findRoute(this.routes, getRoutePath(this.router, state.url)); + requiredPolicy = route?.requiredPolicy; } + if (!requiredPolicy) return of(true); + return this.store.select(ConfigState.getGrantedPolicy(requiredPolicy)).pipe( tap(access => { if (!access) { diff --git a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts index a995a4c822..dcfd27ab69 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts @@ -1,22 +1,57 @@ +import { APP_BASE_HREF } from '@angular/common'; +import { Component } from '@angular/core'; +import { RouterModule } from '@angular/router'; import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spectator/jest'; -import { Store } from '@ngxs/store'; +import { Actions, Store } from '@ngxs/store'; import { of } from 'rxjs'; -import { PermissionGuard } from '../guards/permission.guard'; import { RestOccurError } from '../actions'; +import { PermissionGuard } from '../guards/permission.guard'; +import { RoutesService } from '../services/routes.service'; describe('PermissionGuard', () => { let spectator: SpectatorService; let guard: PermissionGuard; + let routes: SpyObject; let store: SpyObject; + @Component({ template: '' }) + class DummyComponent {} + const createService = createServiceFactory({ service: PermissionGuard, mocks: [Store], + declarations: [DummyComponent], + imports: [ + RouterModule.forRoot([ + { + path: 'test', + component: DummyComponent, + data: { + requiredPolicy: 'TestPolicy', + }, + }, + ]), + ], + providers: [ + { + provide: APP_BASE_HREF, + useValue: '/', + }, + { + provide: Actions, + useValue: { + pipe() { + return of(null); + }, + }, + }, + ], }); beforeEach(() => { spectator = createService(); guard = spectator.service; + routes = spectator.inject(RoutesService); store = spectator.get(Store); }); @@ -41,17 +76,32 @@ describe('PermissionGuard', () => { }); }); - it('should find the requiredPolicy from child route', done => { + it('should check the requiredPolicy from RoutesService', done => { + routes.add([ + { + path: '/test', + name: 'Test', + requiredPolicy: 'TestPolicy', + }, + ]); store.select.andReturn(of(false)); const spy = jest.spyOn(store, 'select'); - guard - .canActivate( - { data: {}, routeConfig: { children: [{ path: 'test', data: { requiredPolicy: 'TestPolicy' } }] } } as any, - { url: 'test' } as any, - ) - .subscribe(() => { - expect(spy.mock.calls[0][0]({ auth: { grantedPolicies: { TestPolicy: true } } })).toBe(true); - done(); - }); + guard.canActivate({ data: {} } as any, { url: 'test' } as any).subscribe(() => { + expect(spy.mock.calls[0][0]({ auth: { grantedPolicies: { TestPolicy: true } } })).toBe(true); + done(); + }); + }); + + it('should return Observable if RoutesService does not have requiredPolicy for given URL', done => { + routes.add([ + { + path: '/test', + name: 'Test', + }, + ]); + guard.canActivate({ data: {} } as any, { url: 'test' } as any).subscribe(result => { + expect(result).toBe(true); + done(); + }); }); }); From 7ee6692a52f297a3954f9e3c75c31ea633c6802b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Mon, 13 Jul 2020 12:29:50 +0300 Subject: [PATCH 28/41] tab usage is removed --- modules/account/.prettierrc | 3 +- .../Pages/Account/LoggedOut.js | 14 +- .../Pages/Account/Manage.js | 68 +- modules/audit-logging/.prettierrc | 5 + modules/background-jobs/.prettierrc | 5 + modules/blob-storing-database/.prettierrc | 5 + modules/blogging/.prettierrc | 3 +- .../Pages/Blogging/Admin/Blogs/create.js | 16 +- .../Pages/Blogging/Admin/Blogs/edit.js | 16 +- .../Pages/Blogging/Admin/Blogs/index.js | 168 +++-- .../Pages/Blogs/Posts/detail.js | 369 ++++----- .../Pages/Blogs/Posts/edit.js | 244 +++--- .../Pages/Blogs/Posts/new.js | 85 ++- .../Pages/Blogs/Shared/Scripts/blog.js | 118 +-- modules/client-simulation/.prettierrc | 5 +- .../Pages/ClientSimulation/Index.js | 6 +- .../Pages/ClientSimulation/SimulationArea.js | 28 +- modules/cms-kit/.prettierrc | 5 + modules/docs/.prettierrc | 5 +- .../Pages/Docs/Admin/Documents/index.js | 352 ++++----- .../Pages/Docs/Admin/Projects/Pull.js | 34 +- .../Pages/Docs/Admin/Projects/create.js | 16 +- .../Pages/Docs/Admin/Projects/edit.js | 16 +- .../Pages/Docs/Admin/Projects/index.js | 310 ++++---- .../Pages/Documents/Project/bootstrap-toc.js | 23 +- .../Pages/Documents/Project/index.js | 702 +++++++++--------- .../Documents/Shared/ErrorComponent/error.js | 30 +- .../Pages/Documents/Shared/Scripts/vs.js | 326 ++++---- modules/feature-management/.prettierrc | 5 +- .../feature-management-modal.js | 20 +- modules/identity/.prettierrc | 5 +- .../Pages/Identity/Roles/index.js | 218 +++--- .../Pages/Identity/Users/index.js | 186 ++--- modules/identityserver/.prettierrc | 5 + modules/permission-management/.prettierrc | 5 +- .../permission-management-modal.js | 460 ++++++------ modules/setting-management/.prettierrc | 5 +- .../Pages/SettingManagement/Index.js | 8 +- modules/tenant-management/.prettierrc | 5 +- .../Tenants/ConnectionStringsModal.js | 32 +- .../Pages/TenantManagement/Tenants/Index.js | 203 ++--- modules/users/.prettierrc | 5 + modules/virtual-file-explorer/.prettierrc | 3 +- .../Pages/VirtualFileExplorer/index.js | 8 +- 44 files changed, 2138 insertions(+), 2012 deletions(-) create mode 100644 modules/audit-logging/.prettierrc create mode 100644 modules/background-jobs/.prettierrc create mode 100644 modules/blob-storing-database/.prettierrc create mode 100644 modules/cms-kit/.prettierrc create mode 100644 modules/identityserver/.prettierrc create mode 100644 modules/users/.prettierrc diff --git a/modules/account/.prettierrc b/modules/account/.prettierrc index 7d1b8aa721..56af76bd94 100644 --- a/modules/account/.prettierrc +++ b/modules/account/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js index 6b5d0bb0af..164399e4ce 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.js @@ -1,7 +1,7 @@ -document.addEventListener('DOMContentLoaded', function (event) { - setTimeout(function () { - window.location = document - .getElementById('redirectButton') - .getAttribute('href'); - }, 3000); -}); +document.addEventListener('DOMContentLoaded', function (event) { + setTimeout(function () { + window.location = document + .getElementById('redirectButton') + .getAttribute('href'); + }, 3000); +}); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js index 015d481df4..68109eb6da 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.js @@ -1,47 +1,47 @@ (function ($) { - var l = abp.localization.getResource('AbpAccount'); + var l = abp.localization.getResource('AbpAccount'); - var _profileService = volo.abp.identity.profile; + var _profileService = volo.abp.identity.profile; - $('#ChangePasswordForm').submit(function (e) { - e.preventDefault(); + $('#ChangePasswordForm').submit(function (e) { + e.preventDefault(); - if (!$('#ChangePasswordForm').valid()) { - return false; - } + if (!$('#ChangePasswordForm').valid()) { + return false; + } - var input = $('#ChangePasswordForm').serializeFormToObject() - .changePasswordInfoModel; + var input = $('#ChangePasswordForm').serializeFormToObject() + .changePasswordInfoModel; - if ( - input.newPassword != input.newPasswordConfirm || - input.currentPassword == '' - ) { - abp.message.error(l('NewPasswordConfirmFailed')); - return; - } + if ( + input.newPassword != input.newPasswordConfirm || + input.currentPassword == '' + ) { + abp.message.error(l('NewPasswordConfirmFailed')); + return; + } - if (input.currentPassword == '') { - return; - } + if (input.currentPassword == '') { + return; + } - _profileService.changePassword(input).then(function (result) { - abp.message.success(l('PasswordChanged')); - }); - }); + _profileService.changePassword(input).then(function (result) { + abp.message.success(l('PasswordChanged')); + }); + }); - $('#PersonalSettingsForm').submit(function (e) { - e.preventDefault(); + $('#PersonalSettingsForm').submit(function (e) { + e.preventDefault(); - if (!$('#PersonalSettingsForm').valid()) { - return false; - } + if (!$('#PersonalSettingsForm').valid()) { + return false; + } - var input = $('#PersonalSettingsForm').serializeFormToObject() - .personalSettingsInfoModel; + var input = $('#PersonalSettingsForm').serializeFormToObject() + .personalSettingsInfoModel; - _profileService.update(input).then(function (result) { - abp.notify.success(l('PersonalSettingsSaved')); - }); - }); + _profileService.update(input).then(function (result) { + abp.notify.success(l('PersonalSettingsSaved')); + }); + }); })(jQuery); diff --git a/modules/audit-logging/.prettierrc b/modules/audit-logging/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/audit-logging/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/background-jobs/.prettierrc b/modules/background-jobs/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/background-jobs/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/blob-storing-database/.prettierrc b/modules/blob-storing-database/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/blob-storing-database/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/blogging/.prettierrc b/modules/blogging/.prettierrc index 7d1b8aa721..56af76bd94 100644 --- a/modules/blogging/.prettierrc +++ b/modules/blogging/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js index 7e6c7117e9..599b2ad1f2 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.blogCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js index dd0712ec27..a459f7ff09 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.blogEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.blogEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js index 46751de899..fe1da6c3a9 100644 --- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js @@ -1,88 +1,92 @@ $(function () { - var l = abp.localization.getResource('Blogging'); - var _createModal = new abp.ModalManager( - abp.appPath + 'Blogging/Admin/Blogs/Create' - ); - var _editModal = new abp.ModalManager( - abp.appPath + 'Blogging/Admin/Blogs/Edit' - ); + var l = abp.localization.getResource('Blogging'); + var _createModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Create' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Blogging/Admin/Blogs/Edit' + ); - var _dataTable = $('#BlogsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: false, - info: false, - scrollX: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[3, 'desc']], - ajax: abp.libs.datatables.createAjax( - volo.blogging.admin.blogManagement.getList - ), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Blogging.Blog.Update'), - action: function (data) { - _editModal.open({ - blogId: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Blogging.Blog.Delete'), - confirmMessage: function (data) { - return l('BlogDeletionWarningMessage'); - }, - action: function (data) { - volo.blogging.admin.blogManagement - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'shortName', - }, - { - target: 3, - data: 'creationTime', - render: function (date) { - return date; - }, - }, - { - target: 4, - data: 'description', - }, - ], - }) - ); + var _dataTable = $('#BlogsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: false, + info: false, + scrollX: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[3, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.blogging.admin.blogManagement.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'Blogging.Blog.Update' + ), + action: function (data) { + _editModal.open({ + blogId: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'Blogging.Blog.Delete' + ), + confirmMessage: function (data) { + return l('BlogDeletionWarningMessage'); + }, + action: function (data) { + volo.blogging.admin.blogManagement + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'creationTime', + render: function (date) { + return date; + }, + }, + { + target: 4, + data: 'description', + }, + ], + }) + ); - $('#CreateNewBlogButtonId').click(function () { - _createModal.open(); - }); + $('#CreateNewBlogButtonId').click(function () { + _createModal.open(); + }); - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index a5061457d0..debd2941c9 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -1,184 +1,189 @@ (function ($) { - var l = abp.localization.getResource('Blogging'); - - var initSocialShareLinks = function () { - var re = new RegExp(/^.*\//); - var rootUrl = re.exec(window.location.href); - - var pageHeader = $('#PostTitle').text(); - var blogName = $('#BlogFullName').attr('name'); - - $('#TwitterShareLink').attr( - 'href', - 'https://twitter.com/intent/tweet?text=' + - encodeURI(pageHeader + ' | ' + blogName + ' | ' + window.location.href) - ); - - $('#LinkedinShareLink').attr( - 'href', - 'https://www.linkedin.com/shareArticle?' + - 'url=' + - encodeURI(window.location.href) + - '&' + - 'mini=true&' + - 'summary=' + - encodeURI(blogName) + - '&' + - 'title=' + - encodeURI(pageHeader) + - '&' + - 'source=' + - encodeURI(rootUrl) - ); - - $('#EmailShareLink').attr( - 'href', - 'mailto:?' + - 'body=' + - encodeURI('I want you to look at ' + window.location.href) + - '&' + - 'subject=' + - encodeURI(pageHeader + ' | ' + blogName) + - '&' - ); - }; - - $('div .replyForm').hide(); - - $('div .editForm').hide(); - - $('form[class="editFormClass"]').submit(function (event) { - event.preventDefault(); - var form = $(this).serializeFormToObject(); - - $.ajax({ - type: 'POST', - url: '/Blog/Comments/Update', - data: { - id: form.commentId, - commentDto: { - text: form.text, - }, - }, - success: function (response) { - $('div .editForm').hide(); - $('#' + form.commentId).text(form.text); - }, - }); - }); - - $('.editCancelButton').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - }); - - $('.replyCancelButton').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - }); - - $('.replyLink').click(function (event) { - event.preventDefault(); - $('div .editForm').hide(); - var linkElement = $(this); - var replyCommentId = linkElement.attr('data-relpyid'); - - if (replyCommentId != '' && replyCommentId !== undefined) { - var div = linkElement.parent().next(); - - if (div.is(':hidden')) { - $('div .replyForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - $('.deleteLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-deleteid'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('CommentDeletionWarningMessage'), // TODO: localize - l('Are you sure?'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: 'POST', - url: '/Blog/Comments/Delete', - data: { id: deleteCommentId }, - success: function (response) { - linkElement.parent().parent().parent().remove(); - }, - }); - } - } - ); - } - }); - - $('#DeletePostLink').click(function (event) { - event.preventDefault(); - var linkElement = $(this); - var deleteCommentId = linkElement.attr('data-postid'); - var blogShortName = linkElement.attr('data-blogShortName'); - - if (deleteCommentId != '' && deleteCommentId !== undefined) { - abp.message.confirm( - l('PostDeletionWarningMessage'), - l('AreYouSure'), - function (isConfirmed) { - if (isConfirmed) { - $.ajax({ - type: 'POST', - url: '/Blog/Posts/Delete', - data: { id: deleteCommentId }, - success: function () { - var url = window.location.pathname; - var postNameBeginning = url.lastIndexOf('/'); - window.location.replace(url.substring(0, postNameBeginning)); - }, - }); - } - } - ); - } - }); - - $('.updateLink').click(function (event) { - event.preventDefault(); - $('div .replyForm').hide(); - - var linkElement = $(this); - var updateCommentId = $(this).attr('data-updateid'); - - if (updateCommentId != '' && updateCommentId !== undefined) { - var div = linkElement.parent().next().next(); - - if (div.is(':hidden')) { - $('div .editForm').hide(); - div.show(); - } else { - div.hide(); - } - return; - } - }); - - if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { - $('html, body').animate( - { - scrollTop: $('#' + $('#FocusCommentId').val()).offset().top - 150, - }, - 500 - ); - } - - $(".post-content a[href^='http']").attr('target', '_blank'); - - initSocialShareLinks(); + var l = abp.localization.getResource('Blogging'); + + var initSocialShareLinks = function () { + var re = new RegExp(/^.*\//); + var rootUrl = re.exec(window.location.href); + + var pageHeader = $('#PostTitle').text(); + var blogName = $('#BlogFullName').attr('name'); + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI( + pageHeader + ' | ' + blogName + ' | ' + window.location.href + ) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(blogName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI(rootUrl) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + blogName) + + '&' + ); + }; + + $('div .replyForm').hide(); + + $('div .editForm').hide(); + + $('form[class="editFormClass"]').submit(function (event) { + event.preventDefault(); + var form = $(this).serializeFormToObject(); + + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Update', + data: { + id: form.commentId, + commentDto: { + text: form.text, + }, + }, + success: function (response) { + $('div .editForm').hide(); + $('#' + form.commentId).text(form.text); + }, + }); + }); + + $('.editCancelButton').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + }); + + $('.replyCancelButton').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + }); + + $('.replyLink').click(function (event) { + event.preventDefault(); + $('div .editForm').hide(); + var linkElement = $(this); + var replyCommentId = linkElement.attr('data-relpyid'); + + if (replyCommentId != '' && replyCommentId !== undefined) { + var div = linkElement.parent().next(); + + if (div.is(':hidden')) { + $('div .replyForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + $('.deleteLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-deleteid'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('CommentDeletionWarningMessage'), // TODO: localize + l('Are you sure?'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Comments/Delete', + data: { id: deleteCommentId }, + success: function (response) { + linkElement.parent().parent().parent().remove(); + }, + }); + } + } + ); + } + }); + + $('#DeletePostLink').click(function (event) { + event.preventDefault(); + var linkElement = $(this); + var deleteCommentId = linkElement.attr('data-postid'); + var blogShortName = linkElement.attr('data-blogShortName'); + + if (deleteCommentId != '' && deleteCommentId !== undefined) { + abp.message.confirm( + l('PostDeletionWarningMessage'), + l('AreYouSure'), + function (isConfirmed) { + if (isConfirmed) { + $.ajax({ + type: 'POST', + url: '/Blog/Posts/Delete', + data: { id: deleteCommentId }, + success: function () { + var url = window.location.pathname; + var postNameBeginning = url.lastIndexOf('/'); + window.location.replace( + url.substring(0, postNameBeginning) + ); + }, + }); + } + } + ); + } + }); + + $('.updateLink').click(function (event) { + event.preventDefault(); + $('div .replyForm').hide(); + + var linkElement = $(this); + var updateCommentId = $(this).attr('data-updateid'); + + if (updateCommentId != '' && updateCommentId !== undefined) { + var div = linkElement.parent().next().next(); + + if (div.is(':hidden')) { + $('div .editForm').hide(); + div.show(); + } else { + div.hide(); + } + return; + } + }); + + if ($('#FocusCommentId').val() != '00000000-0000-0000-0000-000000000000') { + $('html, body').animate( + { + scrollTop: + $('#' + $('#FocusCommentId').val()).offset().top - 150, + }, + 500 + ); + } + + $(".post-content a[href^='http']").attr('target', '_blank'); + + initSocialShareLinks(); })(jQuery); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js index c8d0bb9b26..718d5c4bc4 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js @@ -1,124 +1,124 @@ $(function () { - var $container = $('#edit-post-container'); - var $editorContainer = $container.find('.edit-post-editor'); - var $submitButton = $container.find('button[type=submit]'); - var $form = $container.find('form#edit-post-form'); - var editorDataKey = 'tuiEditor'; - var $titleLengthWarning = $('#title-length-warning'); - var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); - - var $title = $('#Post_Title'); - var $coverImage = $('#CoverImage'); - var $postCoverImage = $('#Post_CoverImage'); - var $coverImageFile = $('#CoverImageFile'); - var $postFormSubmitButton = $('#PostFormSubmitButton'); - - var setCoverImage = function (file) { - $postCoverImage.val(file.fileUrl); - $coverImage.attr('src', file.fileUrl); - $postFormSubmitButton.removeAttr('disabled'); - }; - - var uploadCoverImage = function (file) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: 'POST', - url: '/api/blogging/files/images/upload', - data: formData, - contentType: false, - processData: false, - success: function (response) { - setCoverImage(response); - }, - }); - }; - - var checkTitleLength = function () { - var title = $title.val(); - - if (title.length > maxTitleLength) { - $titleLengthWarning.show(); - } else { - $titleLengthWarning.hide(); - } - }; - - checkTitleLength(); - - $title.on('change paste keyup', function () { - checkTitleLength(); - }); - - $coverImageFile.change(function () { - if (!$coverImageFile.prop('files').length) { - return; - } - - $postFormSubmitButton.attr('disabled', true); - var file = $coverImageFile.prop('files')[0]; - uploadCoverImage(file); - }); - - var uploadImage = function (file, callbackFn) { - var formData = new FormData(); - formData.append('file', file); - - $.ajax({ - type: 'POST', - url: '/api/blogging/files/images/upload', - data: formData, - contentType: false, - processData: false, - success: function (response) { - callbackFn(response.fileUrl); - }, - }); - }; - - var newPostEditor = $editorContainer - .tuiEditor({ - usageStatistics: false, - initialEditType: 'markdown', - previewStyle: 'tab', - height: 'auto', - initialValue: $form.find("input[name='Post.Content']").val(), - hooks: { - addImageBlobHook: function (blob, callback, source) { - var imageAltText = blob.name; - - uploadImage(blob, function (fileUrl) { - callback(fileUrl, imageAltText); - }); - }, - }, - events: { - load: function () { - $editorContainer.find('.loading-cover').remove(); - $submitButton.prop('disabled', false); - $form.data('validator').settings.ignore = '.ignore'; - $editorContainer.find(':input').addClass('ignore'); - }, - }, - }) - .data(editorDataKey); - - $container.find('form#edit-post-form').submit(function (e) { - var $postTextInput = $form.find("input[name='Post.Content']"); - - var postText = newPostEditor.getMarkdown(); - $postTextInput.val(postText); - - if (!$form.valid()) { - var validationResult = $form.validate(); - abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. - e.preventDefault(); - return false; //for old browsers - } - - $submitButton.buttonBusy(); - $(this).off('submit').submit(); - return true; - }); + var $container = $('#edit-post-container'); + var $editorContainer = $container.find('.edit-post-editor'); + var $submitButton = $container.find('button[type=submit]'); + var $form = $container.find('form#edit-post-form'); + var editorDataKey = 'tuiEditor'; + var $titleLengthWarning = $('#title-length-warning'); + var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); + + var $title = $('#Post_Title'); + var $coverImage = $('#CoverImage'); + var $postCoverImage = $('#Post_CoverImage'); + var $coverImageFile = $('#CoverImageFile'); + var $postFormSubmitButton = $('#PostFormSubmitButton'); + + var setCoverImage = function (file) { + $postCoverImage.val(file.fileUrl); + $coverImage.attr('src', file.fileUrl); + $postFormSubmitButton.removeAttr('disabled'); + }; + + var uploadCoverImage = function (file) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + setCoverImage(response); + }, + }); + }; + + var checkTitleLength = function () { + var title = $title.val(); + + if (title.length > maxTitleLength) { + $titleLengthWarning.show(); + } else { + $titleLengthWarning.hide(); + } + }; + + checkTitleLength(); + + $title.on('change paste keyup', function () { + checkTitleLength(); + }); + + $coverImageFile.change(function () { + if (!$coverImageFile.prop('files').length) { + return; + } + + $postFormSubmitButton.attr('disabled', true); + var file = $coverImageFile.prop('files')[0]; + uploadCoverImage(file); + }); + + var uploadImage = function (file, callbackFn) { + var formData = new FormData(); + formData.append('file', file); + + $.ajax({ + type: 'POST', + url: '/api/blogging/files/images/upload', + data: formData, + contentType: false, + processData: false, + success: function (response) { + callbackFn(response.fileUrl); + }, + }); + }; + + var newPostEditor = $editorContainer + .tuiEditor({ + usageStatistics: false, + initialEditType: 'markdown', + previewStyle: 'tab', + height: 'auto', + initialValue: $form.find("input[name='Post.Content']").val(), + hooks: { + addImageBlobHook: function (blob, callback, source) { + var imageAltText = blob.name; + + uploadImage(blob, function (fileUrl) { + callback(fileUrl, imageAltText); + }); + }, + }, + events: { + load: function () { + $editorContainer.find('.loading-cover').remove(); + $submitButton.prop('disabled', false); + $form.data('validator').settings.ignore = '.ignore'; + $editorContainer.find(':input').addClass('ignore'); + }, + }, + }) + .data(editorDataKey); + + $container.find('form#edit-post-form').submit(function (e) { + var $postTextInput = $form.find("input[name='Post.Content']"); + + var postText = newPostEditor.getMarkdown(); + $postTextInput.val(postText); + + if (!$form.valid()) { + var validationResult = $form.validate(); + abp.message.warn(validationResult.errorList[0].message); //TODO: errors can be merged into lines. make sweetalert accept HTML. + e.preventDefault(); + return false; //for old browsers + } + + $submitButton.buttonBusy(); + $(this).off('submit').submit(); + return true; + }); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js index 798430f6cd..6b8c827722 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js @@ -1,22 +1,21 @@ $(function () { - - var $container = $("#qa-new-post-container"); - var $editorContainer = $container.find(".new-post-editor"); - var $submitButton = $container.find("button[type=submit]"); - var $form = $container.find("form#new-post-form"); - var editorDataKey = "tuiEditor"; - var $titleLengthWarning = $("#title-length-warning"); - var maxTitleLength = parseInt($titleLengthWarning.data("max-length")); + var $container = $('#qa-new-post-container'); + var $editorContainer = $container.find('.new-post-editor'); + var $submitButton = $container.find('button[type=submit]'); + var $form = $container.find('form#new-post-form'); + var editorDataKey = 'tuiEditor'; + var $titleLengthWarning = $('#title-length-warning'); + var maxTitleLength = parseInt($titleLengthWarning.data('max-length')); var $title = $('#Post_Title'); var $url = $('#Post_Url'); - var $coverImage = $("#CoverImage"); + var $coverImage = $('#CoverImage'); var $postCoverImage = $('#Post_CoverImage'); var $coverImageFile = $('#CoverImageFile'); var $postFormSubmitButton = $('#PostFormSubmitButton'); var setCoverImage = function (file) { $postCoverImage.val(file.fileUrl); - $coverImage.attr("src", file.fileUrl); + $coverImage.attr('src', file.fileUrl); $coverImage.show(); $postFormSubmitButton.removeAttr('disabled'); }; @@ -26,14 +25,14 @@ formData.append('file', file); $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", + type: 'POST', + url: '/api/blogging/files/images/upload', data: formData, contentType: false, processData: false, success: function (response) { setCoverImage(response); - } + }, }); }; @@ -41,7 +40,7 @@ if (!$coverImageFile.prop('files').length) { return; } - $postFormSubmitButton.attr('disabled',true); + $postFormSubmitButton.attr('disabled', true); var file = $coverImageFile.prop('files')[0]; uploadCoverImage(file); }); @@ -51,43 +50,44 @@ formData.append('file', file); $.ajax({ - type: "POST", - url: "/api/blogging/files/images/upload", + type: 'POST', + url: '/api/blogging/files/images/upload', data: formData, contentType: false, processData: false, success: function (response) { callbackFn(response.fileUrl); - } + }, }); }; - var newPostEditor = $editorContainer.tuiEditor({ - usageStatistics: false, - initialEditType: 'markdown', - previewStyle: 'tab', - height: "auto", - hooks: { - addImageBlobHook: function (blob, callback, source) { - var imageAltText = blob.name; - - uploadImage(blob, - function (fileUrl) { + var newPostEditor = $editorContainer + .tuiEditor({ + usageStatistics: false, + initialEditType: 'markdown', + previewStyle: 'tab', + height: 'auto', + hooks: { + addImageBlobHook: function (blob, callback, source) { + var imageAltText = blob.name; + + uploadImage(blob, function (fileUrl) { callback(fileUrl, imageAltText); }); - } - }, - events: { - load: function () { - $editorContainer.find(".loading-cover").remove(); - $submitButton.prop("disabled", false); - $form.data("validator").settings.ignore = '.ignore'; - $editorContainer.find(':input').addClass('ignore'); - } - } - }).data(editorDataKey); - - $container.find("form#new-post-form").submit(function (e) { + }, + }, + events: { + load: function () { + $editorContainer.find('.loading-cover').remove(); + $submitButton.prop('disabled', false); + $form.data('validator').settings.ignore = '.ignore'; + $editorContainer.find(':input').addClass('ignore'); + }, + }, + }) + .data(editorDataKey); + + $container.find('form#new-post-form').submit(function (e) { var $postTextInput = $form.find("input[name='Post.Content']"); var postText = newPostEditor.getMarkdown(); @@ -108,7 +108,7 @@ var urlEdited = false; var reflectedChange = false; - $title.on("change paste keyup", function () { + $title.on('change paste keyup', function () { if (urlEdited) { return; } @@ -137,5 +137,4 @@ urlEdited = true; } }); - }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js index 53eadbf21c..ca0b21d203 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js @@ -1,67 +1,67 @@ (function () { - function handleArrows() { - var herosWidth = $('.hero-articles').width(); - var arrowsPosition = herosWidth / 2 - 90; - $('.owl-next').css('right', arrowsPosition); - $('.owl-prev').css('left', arrowsPosition); - } + function handleArrows() { + var herosWidth = $('.hero-articles').width(); + var arrowsPosition = herosWidth / 2 - 90; + $('.owl-next').css('right', arrowsPosition); + $('.owl-prev').css('left', arrowsPosition); + } - function handleImages() { - //if ($(window).width() > 767) { - // $(".box-articles .img-container").each(function () { - // var squareWidth = $(this).width(); - // $(this).css("height", squareWidth); - // }); - //} - //else { - // $(".box-articles .img-container").css("height", "auto"); - //} - } + function handleImages() { + //if ($(window).width() > 767) { + // $(".box-articles .img-container").each(function () { + // var squareWidth = $(this).width(); + // $(this).css("height", squareWidth); + // }); + //} + //else { + // $(".box-articles .img-container").css("height", "auto"); + //} + } - function handleOwlCarousel() { - $('.hero-section .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - //center: true, - autoplay: true, - autoHeight: true, - autoplaySpeed: 1000, - items: 1, - }); - $('.card-article-container .owl-carousel').owlCarousel({ - loop: true, - margin: 0, - nav: false, - dots: false, - autoplay: true, - autoplaySpeed: 1000, - responsive: { - 0: { - items: 1, - }, - }, - }); - } + function handleOwlCarousel() { + $('.hero-section .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + //center: true, + autoplay: true, + autoHeight: true, + autoplaySpeed: 1000, + items: 1, + }); + $('.card-article-container .owl-carousel').owlCarousel({ + loop: true, + margin: 0, + nav: false, + dots: false, + autoplay: true, + autoplaySpeed: 1000, + responsive: { + 0: { + items: 1, + }, + }, + }); + } - $(function () { - handleImages(); - handleOwlCarousel(); + $(function () { + handleImages(); + handleOwlCarousel(); - $('.nav-link').on('click', function () { - $(this).parent().parent(); - }); + $('.nav-link').on('click', function () { + $(this).parent().parent(); + }); - $(window).resize(function () { - setTimeout(function () { - handleArrows(); - handleImages(); - }, 500); - }); + $(window).resize(function () { + setTimeout(function () { + handleArrows(); + handleImages(); + }, 500); + }); - setTimeout(function () { - handleArrows(); - }, 500); - }); + setTimeout(function () { + handleArrows(); + }, 500); + }); })(); diff --git a/modules/client-simulation/.prettierrc b/modules/client-simulation/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/client-simulation/.prettierrc +++ b/modules/client-simulation/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js index fbdf917f91..7c4cf805c1 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/Index.js @@ -1,5 +1,5 @@ (function ($) { - $(function () { - SimulationArea.init($('#SimulationArea')); - }); + $(function () { + SimulationArea.init($('#SimulationArea')); + }); })(jQuery); diff --git a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js index de15f8a63c..0a404900c9 100644 --- a/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js +++ b/modules/client-simulation/src/Volo.ClientSimulation.Web/Pages/ClientSimulation/SimulationArea.js @@ -1,19 +1,19 @@ var SimulationArea = {}; (function ($) { - var $mainContainer = null; + var $mainContainer = null; - function refreshSimulationArea() { - $.get('/ClientSimulation/SimulationArea') - .done(function (result) { - $mainContainer.html(result); - }) - .always(function () { - setTimeout(refreshSimulationArea, 1000); - }); - } + function refreshSimulationArea() { + $.get('/ClientSimulation/SimulationArea') + .done(function (result) { + $mainContainer.html(result); + }) + .always(function () { + setTimeout(refreshSimulationArea, 1000); + }); + } - SimulationArea.init = function ($container) { - $mainContainer = $container; - setTimeout(refreshSimulationArea, 1000); - }; + SimulationArea.init = function ($container) { + $mainContainer = $container; + setTimeout(refreshSimulationArea, 1000); + }; })(jQuery); diff --git a/modules/cms-kit/.prettierrc b/modules/cms-kit/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/cms-kit/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/docs/.prettierrc b/modules/docs/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/docs/.prettierrc +++ b/modules/docs/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } 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 03d6fee850..3f0f30270f 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 @@ -1,178 +1,196 @@ $(function () { - var l = abp.localization.getResource('Docs'); - var service = window.volo.docs.admin.documentsAdmin; + var l = abp.localization.getResource('Docs'); + var service = window.volo.docs.admin.documentsAdmin; - var getFormattedDate = function ($datePicker) { - return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); - }; + var getFormattedDate = function ($datePicker) { + return $datePicker.data().datepicker.getFormattedDate('yyyy-mm-dd'); + }; - var getFilter = function () { - return { - projectId: $('#ProjectId').val(), - name: $('#Name').val(), - version: $('#Version').val(), - languageCode: $('#LanguageCode').val(), - fileName: $('#FileName').val(), - format: $('#Format').val(), - creationTimeMin: getFormattedDate($('#CreationTimeMin')), - creationTimeMax: getFormattedDate($('#CreationTimeMax')), - lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), - lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), - lastSignificantUpdateTimeMin: getFormattedDate( - $('#LastSignificantUpdateTimeMin') - ), - lastSignificantUpdateTimeMax: getFormattedDate( - $('#LastSignificantUpdateTimeMax') - ), - lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), - lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), - }; - }; + var getFilter = function () { + return { + projectId: $('#ProjectId').val(), + name: $('#Name').val(), + version: $('#Version').val(), + languageCode: $('#LanguageCode').val(), + fileName: $('#FileName').val(), + format: $('#Format').val(), + creationTimeMin: getFormattedDate($('#CreationTimeMin')), + creationTimeMax: getFormattedDate($('#CreationTimeMax')), + lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), + lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), + lastSignificantUpdateTimeMin: getFormattedDate( + $('#LastSignificantUpdateTimeMin') + ), + lastSignificantUpdateTimeMax: getFormattedDate( + $('#LastSignificantUpdateTimeMax') + ), + lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), + lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), + }; + }; - var dataTable = $('#DocumentsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('RemoveFromCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('RemoveFromCacheConfirmation'); - }, - action: function (data) { - service.removeFromCache(data.record.id).then(function () { - abp.message.success(l('RemovedFromCache')); - dataTable.ajax.reload(); - }); - }, - }, - { - text: l('ReIndex'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('ReIndexDocumentConfirmation'); - }, - action: function (data) { - service.reindex(data.record.id).then(function () { - abp.message.success(l('ReindexCompleted')); - dataTable.ajax.reload(); - }); - }, - }, - { - text: l('DeleteFromDatabase'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('DeleteDocumentFromDbConfirmation'); - }, - action: function (data) { - service.deleteFromDatabase(data.record.id).then(function () { - abp.message.success(l('Deleted')); - dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'version', - }, - { - target: 3, - data: 'languageCode', - }, - { - target: 4, - data: 'fileName', - }, - { - target: 5, - data: 'format', - }, - { - target: 6, - data: 'creationTime', - render: function (creationTime) { - if (!creationTime) { - return ''; - } + var dataTable = $('#DocumentsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + ajax: abp.libs.datatables.createAjax(service.getAll, getFilter), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('RemoveFromCache'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l('RemoveFromCacheConfirmation'); + }, + action: function (data) { + service + .removeFromCache(data.record.id) + .then(function () { + abp.message.success( + l('RemovedFromCache') + ); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndex'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l('ReIndexDocumentConfirmation'); + }, + action: function (data) { + service + .reindex(data.record.id) + .then(function () { + abp.message.success( + l('ReindexCompleted') + ); + dataTable.ajax.reload(); + }); + }, + }, + { + text: l('DeleteFromDatabase'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'DeleteDocumentFromDbConfirmation' + ); + }, + action: function (data) { + service + .deleteFromDatabase(data.record.id) + .then(function () { + abp.message.success(l('Deleted')); + dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'version', + }, + { + target: 3, + data: 'languageCode', + }, + { + target: 4, + data: 'fileName', + }, + { + target: 5, + data: 'format', + }, + { + target: 6, + data: 'creationTime', + render: function (creationTime) { + if (!creationTime) { + return ''; + } - var date = Date.parse(creationTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 7, - data: 'lastUpdatedTime', - render: function (lastUpdatedTime) { - if (!lastUpdatedTime) { - return ''; - } + var date = Date.parse(creationTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 7, + data: 'lastUpdatedTime', + render: function (lastUpdatedTime) { + if (!lastUpdatedTime) { + return ''; + } - var date = Date.parse(lastUpdatedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 8, - data: 'lastSignificantUpdateTime', - render: function (lastSignificantUpdateTime) { - if (!lastSignificantUpdateTime) { - return ''; - } + var date = Date.parse(lastUpdatedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 8, + data: 'lastSignificantUpdateTime', + render: function (lastSignificantUpdateTime) { + if (!lastSignificantUpdateTime) { + return ''; + } - var date = Date.parse(lastSignificantUpdateTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - { - target: 9, - data: 'lastCachedTime', - render: function (lastCachedTime) { - if (!lastCachedTime) { - return ''; - } + var date = Date.parse(lastSignificantUpdateTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + { + target: 9, + data: 'lastCachedTime', + render: function (lastCachedTime) { + if (!lastCachedTime) { + return ''; + } - var date = Date.parse(lastCachedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); - }, - }, - ], - }) - ); + var date = Date.parse(lastCachedTime); + return new Date(date).toLocaleDateString( + abp.localization.currentCulture.name + ); + }, + }, + ], + }) + ); - $("#FilterForm input[type='text']").keypress(function (e) { - if (e.which === 13) { - dataTable.ajax.reload(); - } - }); + $("#FilterForm input[type='text']").keypress(function (e) { + if (e.which === 13) { + dataTable.ajax.reload(); + } + }); - $('#SearchButton').click(function (e) { - e.preventDefault(); - dataTable.ajax.reload(); - }); + $('#SearchButton').click(function (e) { + e.preventDefault(); + dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js index db4fa9b662..e3f4032d18 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.js @@ -1,23 +1,23 @@ var abp = abp || {}; $(function () { - abp.modals.projectPull = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - var fg = $form.find('#PullDocument_Name').parent(); - var nameInput = fg.html(); + abp.modals.projectPull = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + var fg = $form.find('#PullDocument_Name').parent(); + var nameInput = fg.html(); - $form.find('input:checkbox').change(function () { - if ($(this).prop('checked')) { - fg.html(''); - } else { - fg.html(nameInput); - } - }); - }; + $form.find('input:checkbox').change(function () { + if ($(this).prop('checked')) { + fg.html(''); + } else { + fg.html(nameInput); + } + }); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js index 1b78f44791..c29927fde7 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/create.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectCreate = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.projectCreate = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js index 287ea898d7..7178516417 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/edit.js @@ -1,12 +1,12 @@ var abp = abp || {}; $(function () { - abp.modals.projectEdit = function () { - var initModal = function (publicApi, args) { - var $form = publicApi.getForm(); - }; + abp.modals.projectEdit = function () { + var initModal = function (publicApi, args) { + var $form = publicApi.getForm(); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; }); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js index e7b57b116e..45554eb356 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js @@ -1,155 +1,177 @@ $(function () { - var l = abp.localization.getResource('Docs'); + var l = abp.localization.getResource('Docs'); - var _createModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', - modalClass: 'projectCreate', - }); + var _createModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Create', + modalClass: 'projectCreate', + }); - var _editModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', - modalClass: 'projectEdit', - }); + var _editModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit', + modalClass: 'projectEdit', + }); - var _pullModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', - modalClass: 'projectPull', - }); + var _pullModal = new abp.ModalManager({ + viewUrl: abp.appPath + 'Docs/Admin/Projects/Pull', + modalClass: 'projectPull', + }); - var _dataTable = $('#ProjectsTable').DataTable( - abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - scrollX: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[2, 'desc']], - ajax: abp.libs.datatables.createAjax( - volo.docs.admin.projectsAdmin.getList - ), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Update'), - action: function (data) { - _editModal.open({ - Id: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('Docs.Admin.Projects.Delete'), - confirmMessage: function (data) { - return l('ProjectDeletionWarningMessage'); - }, - action: function (data) { - volo.docs.admin.projectsAdmin - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - { - text: l('Pull'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - action: function (data) { - _pullModal.open({ - Id: data.record.id, - }); - }, - }, - { - text: l('ClearCache'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l('ClearCacheConfirmationMessage', data.record.name); - }, - action: function (data) { - volo.docs.admin.documentsAdmin - .clearCache({ projectId: data.record.id }) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - { - text: l('ReIndexProject'), - visible: abp.auth.isGranted('Docs.Admin.Documents'), - confirmMessage: function (data) { - return l( - 'ReIndexProjectConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - volo.docs.admin.projectsAdmin - .reindex({ projectId: data.record.id }) - .then(function () { - abp.message.success( - l('SuccessfullyReIndexProject', data.record.name) - ); - }); - }, - }, - ], - }, - }, - { - target: 1, - data: 'name', - }, - { - target: 2, - data: 'shortName', - }, - { - target: 3, - data: 'documentStoreType', - }, - { - target: 4, - data: 'format', - render: function (data) { - if (data === 'md') { - return 'markdown'; - } + var _dataTable = $('#ProjectsTable').DataTable( + abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + scrollX: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[2, 'desc']], + ajax: abp.libs.datatables.createAjax( + volo.docs.admin.projectsAdmin.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'Docs.Admin.Projects.Update' + ), + action: function (data) { + _editModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'Docs.Admin.Projects.Delete' + ), + confirmMessage: function (data) { + return l('ProjectDeletionWarningMessage'); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('Pull'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + action: function (data) { + _pullModal.open({ + Id: data.record.id, + }); + }, + }, + { + text: l('ClearCache'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'ClearCacheConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + volo.docs.admin.documentsAdmin + .clearCache({ + projectId: data.record.id, + }) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + { + text: l('ReIndexProject'), + visible: abp.auth.isGranted( + 'Docs.Admin.Documents' + ), + confirmMessage: function (data) { + return l( + 'ReIndexProjectConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + volo.docs.admin.projectsAdmin + .reindex({ projectId: data.record.id }) + .then(function () { + abp.message.success( + l( + 'SuccessfullyReIndexProject', + data.record.name + ) + ); + }); + }, + }, + ], + }, + }, + { + target: 1, + data: 'name', + }, + { + target: 2, + data: 'shortName', + }, + { + target: 3, + data: 'documentStoreType', + }, + { + target: 4, + data: 'format', + render: function (data) { + if (data === 'md') { + return 'markdown'; + } - return data; - }, - }, - ], - }) - ); + return data; + }, + }, + ], + }) + ); - $('#CreateNewGithubProjectButtonId').click(function (event) { - event.preventDefault(); - _createModal.open({ source: 'GitHub' }); - }); + $('#CreateNewGithubProjectButtonId').click(function (event) { + event.preventDefault(); + _createModal.open({ source: 'GitHub' }); + }); - $('#ReIndexAllProjects').click(function (event) { - abp.message - .confirm(l('ReIndexAllProjectConfirmationMessage')) - .done(function (accepted) { - if (accepted) { - volo.docs.admin.projectsAdmin.reindexAll().then(function () { - abp.message.success(l('SuccessfullyReIndexAllProject')); - }); - } - }); - }); + $('#ReIndexAllProjects').click(function (event) { + abp.message + .confirm(l('ReIndexAllProjectConfirmationMessage')) + .done(function (accepted) { + if (accepted) { + volo.docs.admin.projectsAdmin + .reindexAll() + .then(function () { + abp.message.success( + l('SuccessfullyReIndexAllProject') + ); + }); + } + }); + }); - _createModal.onClose(function () { - _dataTable.ajax.reload(); - }); + _createModal.onClose(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); }); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js index 3b92bf5e7e..1bf1d139a9 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/bootstrap-toc.js @@ -12,12 +12,18 @@ // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ // http://stackoverflow.com/a/12731439/358804 var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + return $el + .filter(selector) + .add($descendants) + .filter(':not([data-toc-skip])'); }, generateUniqueIdBase: function (el) { var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + var anchor = text + .trim() + .toLowerCase() + .replace(/[^A-Za-z0-9]+/g, '-'); return anchor || el.tagName.toLowerCase(); }, @@ -91,7 +97,10 @@ var secondaryLevel = topLevel + 1; var secondarySelector = 'h' + secondaryLevel; - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + return this.findOrFilter( + $scope, + topSelector + ',' + secondarySelector + ); }, getNavLevel: function (el) { @@ -126,14 +135,14 @@ var opts; if (arg.jquery) { opts = { - $nav: arg + $nav: arg, }; } else { opts = arg; } opts.$scope = opts.$scope || $(document.body); return opts; - } + }, }, // accepts a jQuery object, or an options object @@ -147,7 +156,7 @@ var topLevel = this.helpers.getTopLevel(opts.$scope); var $headings = this.helpers.getHeadings(opts.$scope, topLevel); this.helpers.populateNav($topContext, topLevel, $headings); - } + }, }; $(function () { @@ -156,4 +165,4 @@ Toc.init($nav); }); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 915428048f..bbb97b041c 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -1,343 +1,363 @@ (function ($) { - $(function () { - var initNavigationFilter = function (navigationContainerId) { - var $navigation = $('#' + navigationContainerId); - - var getShownDocumentLinks = function () { - return $navigation - .find('.mCSB_container > li a:visible') - .not('.tree-toggle'); - }; - - var gotoFilteredDocumentIfThereIsOnlyOne = function () { - var $links = getShownDocumentLinks(); - if ($links.length === 1) { - var url = $links.first().attr('href'); - if (url === 'javascript:;') { - return; - } - - window.location = url; - } - }; - - var filterDocumentItems = function (filterText) { - $navigation.find('.mCSB_container .opened').removeClass('opened'); - $navigation - .find('.mCSB_container > li, .mCSB_container > li ul') - .hide(); - - if (!filterText) { - $navigation.find('.mCSB_container > li').show(); - $navigation.find('.mCSB_container .selected-tree > ul').show(); - return; - } - - var filteredItems = $navigation.find('li > a').filter(function () { - return ( - $(this).text().toUpperCase().indexOf(filterText.toUpperCase()) > -1 - ); - }); - - filteredItems.each(function () { - var $el = $(this); - $el.show(); - var $parent = $el.parent(); - - var hasParent = true; - while (hasParent) { - if ($parent.attr('id') === navigationContainerId) { - break; - } - - $parent.show(); - $parent.find('> li > label').not('.last-link').addClass('opened'); - - $parent = $parent.parent(); - hasParent = $parent.length > 0; - } - }); - }; - - $('#filter').keyup(function (e) { - filterDocumentItems(e.target.value); - - if (e.key === 'Enter') { - gotoFilteredDocumentIfThereIsOnlyOne(); - } - }); - - $('#fullsearch').keyup(function (e) { - if (e.key === 'Enter') { - window.open($(this).data('fullsearch-url') + this.value); - } - }); - }; - - var initAnchorTags = function (container) { - anchors.options = { - placement: 'left', - }; - - var anchorTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; - anchorTags.forEach(function (tag) { - anchors.add(container + ' ' + tag); - }); - }; - - var initSocialShareLinks = function () { - var pageHeader = $('.docs-body').find('h1, h2').first().text(); - - var projectName = $('#ProjectName')[0].innerText; - - $('#TwitterShareLink').attr( - 'href', - 'https://twitter.com/intent/tweet?text=' + - encodeURI( - pageHeader + ' | ' + projectName + ' | ' + window.location.href - ) - ); - - $('#LinkedinShareLink').attr( - 'href', - 'https://www.linkedin.com/shareArticle?' + - 'url=' + - encodeURI(window.location.href) + - '&' + - 'mini=true&' + - 'summary=' + - encodeURI(projectName) + - '&' + - 'title=' + - encodeURI(pageHeader) + - '&' + - 'source=' + - encodeURI($('#GoToMainWebSite').attr('href')) - ); - - $('#EmailShareLink').attr( - 'href', - 'mailto:?' + - 'body=' + - encodeURI('I want you to look at ' + window.location.href) + - '&' + - 'subject=' + - encodeURI(pageHeader + ' | ' + projectName) + - '&' - ); - }; - - var initSections = function () { - var clearQueryString = function () { - var uri = window.location.href.toString(); - - if (uri.indexOf('?') > 0) { - uri = uri.substring(0, uri.indexOf('?')); - } - - window.history.replaceState({}, document.title, uri); - }; - - var setQueryString = function () { - var comboboxes = $('.doc-section-combobox'); - if (comboboxes.length < 1) { - return; - } - - var hash = document.location.hash; - - clearQueryString(); - - var uri = window.location.href.toString(); - - var new_uri = uri + '?'; - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - new_uri += key + '=' + value; - - if (i !== comboboxes.length - 1) { - new_uri += '&'; - } - } - - window.history.replaceState({}, document.title, new_uri + hash); - }; - - var getTenYearsLater = function () { - var tenYearsLater = new Date(); - tenYearsLater.setTime( - tenYearsLater.getTime() + 365 * 10 * 24 * 60 * 60 * 1000 - ); - return tenYearsLater; - }; - - var setCookies = function () { - var cookie = abp.utils.getCookieValue('AbpDocsPreferences'); - - if (!cookie || cookie == null || cookie === null) { - cookie = ''; - } - var keyValues = cookie.split('|'); - - var comboboxes = $('.doc-section-combobox'); - - for (var i = 0; i < comboboxes.length; i++) { - var key = $(comboboxes[i]).data('key'); - var value = comboboxes[i].value; - - var changed = false; - var keyValueslength = keyValues.length; - for (var k = 0; k < keyValueslength; k++) { - var splitted = keyValues[k].split('='); - - if (splitted.length > 0 && splitted[0] === key) { - keyValues[k] = key + '=' + value; - changed = true; - } - } - - if (!changed) { - keyValues.push(key + '=' + value); - } - } - - abp.utils.setCookieValue( - 'AbpDocsPreferences', - keyValues.join('|'), - getTenYearsLater(), - '/' - ); - }; - - $('.doc-section-combobox').change(function () { - setCookies(); - clearQueryString(); - location.reload(); - }); - - setQueryString(); - }; - - var initCrawlerLinks = function () { - var isCrawler = function () { - var crawlers = [ - 'Google', - 'Googlebot', - 'YandexBot', - 'msnbot', - 'Rambler', - 'Yahoo', - 'AbachoBOT', - 'accoona', - 'AcoiRobot', - 'ASPSeek', - 'CrocCrawler', - 'Dumbot', - 'FAST-WebCrawler', - 'GeonaBot', - 'Gigabot', - 'Lycos', - 'MSRBOT', - 'Scooter', - 'AltaVista', - 'IDBot', - 'eStyle', - 'Scrubby', - 'Slurp', - 'DuckDuckBot', - 'Baiduspider', - 'VoilaBot', - 'ExaLead', - 'Search Dog', - 'MSN Bot', - 'BingBot', - ]; - - var agent = navigator.userAgent; - - for (var i = 0; i < crawlers.length; i++) { - if (agent.indexOf(crawlers[i]) >= 0) { - return true; - } - } - - return false; - }; - - if (!isCrawler()) { - return; - } - - var comboboxes = $('.doc-section-combobox'); - - if (comboboxes.length <= 0) { - return; - } - - $('#crawler_link').show(); - - var html = ''; - - var currentUrl = window.location.href.toString(); - - if (currentUrl.indexOf('?') > 0) { - currentUrl = currentUrl.substring(0, currentUrl.indexOf('?')); - } - - var getQueryStringsFromComboboxes = function (x) { - if (x >= comboboxes.length) { - return []; - } - - var key = $(comboboxes[x]).data('key'); - - var queryStrings = getQueryStringsFromComboboxes(x + 1); - var returnList = []; - - $(comboboxes[x]) - .find('option') - .each(function () { - if (queryStrings.length <= 0) { - returnList.push(key + '=' + $(this).val()); - } else { - for (var k = 0; k < queryStrings.length; k++) { - returnList.push( - key + '=' + $(this).val() + '&' + queryStrings[k] - ); - } - } - }); - - return returnList; - }; - - var queryStrings = getQueryStringsFromComboboxes(0); - - for (var i = 0; i < queryStrings.length; i++) { - html += - '' + - queryStrings[i] + - ' '; - } - - $('#crawler_link').html(html); - }; - - initNavigationFilter('sidebar-scroll'); - - initAnchorTags('.docs-page .docs-body'); - - initSocialShareLinks(); - - initSections(); - - initCrawlerLinks(); - }); + $(function () { + var initNavigationFilter = function (navigationContainerId) { + var $navigation = $('#' + navigationContainerId); + + var getShownDocumentLinks = function () { + return $navigation + .find('.mCSB_container > li a:visible') + .not('.tree-toggle'); + }; + + var gotoFilteredDocumentIfThereIsOnlyOne = function () { + var $links = getShownDocumentLinks(); + if ($links.length === 1) { + var url = $links.first().attr('href'); + if (url === 'javascript:;') { + return; + } + + window.location = url; + } + }; + + var filterDocumentItems = function (filterText) { + $navigation + .find('.mCSB_container .opened') + .removeClass('opened'); + $navigation + .find('.mCSB_container > li, .mCSB_container > li ul') + .hide(); + + if (!filterText) { + $navigation.find('.mCSB_container > li').show(); + $navigation + .find('.mCSB_container .selected-tree > ul') + .show(); + return; + } + + var filteredItems = $navigation + .find('li > a') + .filter(function () { + return ( + $(this) + .text() + .toUpperCase() + .indexOf(filterText.toUpperCase()) > -1 + ); + }); + + filteredItems.each(function () { + var $el = $(this); + $el.show(); + var $parent = $el.parent(); + + var hasParent = true; + while (hasParent) { + if ($parent.attr('id') === navigationContainerId) { + break; + } + + $parent.show(); + $parent + .find('> li > label') + .not('.last-link') + .addClass('opened'); + + $parent = $parent.parent(); + hasParent = $parent.length > 0; + } + }); + }; + + $('#filter').keyup(function (e) { + filterDocumentItems(e.target.value); + + if (e.key === 'Enter') { + gotoFilteredDocumentIfThereIsOnlyOne(); + } + }); + + $('#fullsearch').keyup(function (e) { + if (e.key === 'Enter') { + window.open($(this).data('fullsearch-url') + this.value); + } + }); + }; + + var initAnchorTags = function (container) { + anchors.options = { + placement: 'left', + }; + + var anchorTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + anchorTags.forEach(function (tag) { + anchors.add(container + ' ' + tag); + }); + }; + + var initSocialShareLinks = function () { + var pageHeader = $('.docs-body').find('h1, h2').first().text(); + + var projectName = $('#ProjectName')[0].innerText; + + $('#TwitterShareLink').attr( + 'href', + 'https://twitter.com/intent/tweet?text=' + + encodeURI( + pageHeader + + ' | ' + + projectName + + ' | ' + + window.location.href + ) + ); + + $('#LinkedinShareLink').attr( + 'href', + 'https://www.linkedin.com/shareArticle?' + + 'url=' + + encodeURI(window.location.href) + + '&' + + 'mini=true&' + + 'summary=' + + encodeURI(projectName) + + '&' + + 'title=' + + encodeURI(pageHeader) + + '&' + + 'source=' + + encodeURI($('#GoToMainWebSite').attr('href')) + ); + + $('#EmailShareLink').attr( + 'href', + 'mailto:?' + + 'body=' + + encodeURI('I want you to look at ' + window.location.href) + + '&' + + 'subject=' + + encodeURI(pageHeader + ' | ' + projectName) + + '&' + ); + }; + + var initSections = function () { + var clearQueryString = function () { + var uri = window.location.href.toString(); + + if (uri.indexOf('?') > 0) { + uri = uri.substring(0, uri.indexOf('?')); + } + + window.history.replaceState({}, document.title, uri); + }; + + var setQueryString = function () { + var comboboxes = $('.doc-section-combobox'); + if (comboboxes.length < 1) { + return; + } + + var hash = document.location.hash; + + clearQueryString(); + + var uri = window.location.href.toString(); + + var new_uri = uri + '?'; + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + new_uri += key + '=' + value; + + if (i !== comboboxes.length - 1) { + new_uri += '&'; + } + } + + window.history.replaceState({}, document.title, new_uri + hash); + }; + + var getTenYearsLater = function () { + var tenYearsLater = new Date(); + tenYearsLater.setTime( + tenYearsLater.getTime() + 365 * 10 * 24 * 60 * 60 * 1000 + ); + return tenYearsLater; + }; + + var setCookies = function () { + var cookie = abp.utils.getCookieValue('AbpDocsPreferences'); + + if (!cookie || cookie == null || cookie === null) { + cookie = ''; + } + var keyValues = cookie.split('|'); + + var comboboxes = $('.doc-section-combobox'); + + for (var i = 0; i < comboboxes.length; i++) { + var key = $(comboboxes[i]).data('key'); + var value = comboboxes[i].value; + + var changed = false; + var keyValueslength = keyValues.length; + for (var k = 0; k < keyValueslength; k++) { + var splitted = keyValues[k].split('='); + + if (splitted.length > 0 && splitted[0] === key) { + keyValues[k] = key + '=' + value; + changed = true; + } + } + + if (!changed) { + keyValues.push(key + '=' + value); + } + } + + abp.utils.setCookieValue( + 'AbpDocsPreferences', + keyValues.join('|'), + getTenYearsLater(), + '/' + ); + }; + + $('.doc-section-combobox').change(function () { + setCookies(); + clearQueryString(); + location.reload(); + }); + + setQueryString(); + }; + + var initCrawlerLinks = function () { + var isCrawler = function () { + var crawlers = [ + 'Google', + 'Googlebot', + 'YandexBot', + 'msnbot', + 'Rambler', + 'Yahoo', + 'AbachoBOT', + 'accoona', + 'AcoiRobot', + 'ASPSeek', + 'CrocCrawler', + 'Dumbot', + 'FAST-WebCrawler', + 'GeonaBot', + 'Gigabot', + 'Lycos', + 'MSRBOT', + 'Scooter', + 'AltaVista', + 'IDBot', + 'eStyle', + 'Scrubby', + 'Slurp', + 'DuckDuckBot', + 'Baiduspider', + 'VoilaBot', + 'ExaLead', + 'Search Dog', + 'MSN Bot', + 'BingBot', + ]; + + var agent = navigator.userAgent; + + for (var i = 0; i < crawlers.length; i++) { + if (agent.indexOf(crawlers[i]) >= 0) { + return true; + } + } + + return false; + }; + + if (!isCrawler()) { + return; + } + + var comboboxes = $('.doc-section-combobox'); + + if (comboboxes.length <= 0) { + return; + } + + $('#crawler_link').show(); + + var html = ''; + + var currentUrl = window.location.href.toString(); + + if (currentUrl.indexOf('?') > 0) { + currentUrl = currentUrl.substring(0, currentUrl.indexOf('?')); + } + + var getQueryStringsFromComboboxes = function (x) { + if (x >= comboboxes.length) { + return []; + } + + var key = $(comboboxes[x]).data('key'); + + var queryStrings = getQueryStringsFromComboboxes(x + 1); + var returnList = []; + + $(comboboxes[x]) + .find('option') + .each(function () { + if (queryStrings.length <= 0) { + returnList.push(key + '=' + $(this).val()); + } else { + for (var k = 0; k < queryStrings.length; k++) { + returnList.push( + key + + '=' + + $(this).val() + + '&' + + queryStrings[k] + ); + } + } + }); + + return returnList; + }; + + var queryStrings = getQueryStringsFromComboboxes(0); + + for (var i = 0; i < queryStrings.length; i++) { + html += + '' + + queryStrings[i] + + ' '; + } + + $('#crawler_link').html(html); + }; + + initNavigationFilter('sidebar-scroll'); + + initAnchorTags('.docs-page .docs-body'); + + initSocialShareLinks(); + + initSections(); + + initCrawlerLinks(); + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js index 6b4fc7a217..e0b6f1c1e3 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js @@ -1,18 +1,18 @@ (function ($) { - $(function () { - var errorPageRedirect = function () { - var second = 3; - var close = setInterval(() => { - $('#ErrorRedirectSeconds').text(`(${--second})`); - if (second === 0) { - clearInterval(close); - $('#ErrorRedirect')[0].click(); - } - }, 1000); - }; + $(function () { + var errorPageRedirect = function () { + var second = 3; + var close = setInterval(() => { + $('#ErrorRedirectSeconds').text(`(${--second})`); + if (second === 0) { + clearInterval(close); + $('#ErrorRedirect')[0].click(); + } + }, 1000); + }; - if (document.getElementById('ErrorRedirect')) { - errorPageRedirect(); - } - }); + if (document.getElementById('ErrorRedirect')) { + errorPageRedirect(); + } + }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js index 2d185498a1..32d31088b2 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js @@ -1,165 +1,165 @@ (function ($) { - $(function () { - $('li:not(.last-link) a.tree-toggle').click(function () { - $(this).parent().children('ul.tree').toggle(100); - $(this).closest('li').toggleClass('selected-tree'); - }); - - $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click( - function () { - var $element = $(this).parent(); - - $element.parent().children('ul.tree').toggle(100); - $element.closest('li').toggleClass('selected-tree'); - } - ); - - var scrollTopBtn = $('.scroll-top-btn'); - var enoughHeight = $('.docs-sidebar-wrapper > .docs-top').height() + 60; - var enoughHeightPlus = 500; - - $(window).scroll(function () { - var topPos = $(window).scrollTop(); - if (topPos > enoughHeight) { - $(scrollTopBtn).addClass('showup'); - $('body').addClass('scrolled'); - } else { - $(scrollTopBtn).removeClass('showup'); - $('body').removeClass('scrolled'); - } - if (topPos > enoughHeightPlus) { - $('body').addClass('scrolledMore'); - } else { - $('body').removeClass('scrolledMore'); - } - }); - - $(scrollTopBtn).click(function () { - $('html, body').animate( - { - scrollTop: 0, - }, - 500 - ); - return false; - }); - - var scrollToHashLink = function () { - var hash = window.location.hash; - - if (!hash || hash === '#') { - return; - } - - var $targetElement = $(decodeURIComponent(hash)); - - $targetElement = $targetElement.length - ? $targetElement - : $('[name=' + this.hash.slice(1) + ']'); - - if (!$targetElement.length) { - return; - } - - $('html,body').stop().animate( - { - scrollTop: $targetElement.offset().top, - }, - 200 - ); - - return; - }; - - $(document).ready(function () { - handleCustomScrolls(); - - var $myNav = $('#docs-sticky-index'); - Toc.init($myNav); - - $('body').scrollspy({ - target: $myNav, - }); - - $('#docs-sticky-index a').on('click', function (event) { - if (this.hash !== '') { - event.preventDefault(); - var hash = this.hash; - $('html, body').animate( - { - scrollTop: $(decodeURIComponent(hash)).offset().top, - }, - 500, - function () { - window.location.hash = hash; - } - ); - } - }); - - $('.btn-toggle').on('click', function () { - $('.toggle-row').slideToggle(400); - $(this).toggleClass('less'); - }); - - $('.close-mmenu').on('click', function () { - $('.navbar-collapse').removeClass('show'); - }); - - $('.open-dmenu').on('click', function () { - $('.docs-tree-list').slideToggle(); - }); - - scrollToHashLink(); - }); - - $(window).resize(function () { - handleCustomScrolls(); - }); - }); - - function handleCustomScrolls() { - var wWidth = $(window).width(); - if (wWidth > 766) { - $('#sidebar-scroll').mCustomScrollbar({ - theme: 'minimal', - alwaysShowScrollbar: 0, - }); - - $('#scroll-index').mCustomScrollbar({ - theme: 'minimal-dark', - alwaysShowScrollbar: 0, - }); - } - } - - window.Toc.helpers.createNavList = function () { - return $(''); - }; - - window.Toc.helpers.createChildNavList = function ($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }; - - window.Toc.helpers.generateNavEl = function (anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $(''); - $li.append($a); - return $li; - }; - - function docsCriteria() { - var docsContentWidth = $('.docs-content').width() - 20; - $('.alert-criteria').width(docsContentWidth); - } - $(document).ready(function () { - docsCriteria(); - }); - $(window).resize(function () { - docsCriteria(); - }); + $(function () { + $('li:not(.last-link) a.tree-toggle').click(function () { + $(this).parent().children('ul.tree').toggle(100); + $(this).closest('li').toggleClass('selected-tree'); + }); + + $('li:not(.last-link) span.plus-icon i.fa-chevron-right').click( + function () { + var $element = $(this).parent(); + + $element.parent().children('ul.tree').toggle(100); + $element.closest('li').toggleClass('selected-tree'); + } + ); + + var scrollTopBtn = $('.scroll-top-btn'); + var enoughHeight = $('.docs-sidebar-wrapper > .docs-top').height() + 60; + var enoughHeightPlus = 500; + + $(window).scroll(function () { + var topPos = $(window).scrollTop(); + if (topPos > enoughHeight) { + $(scrollTopBtn).addClass('showup'); + $('body').addClass('scrolled'); + } else { + $(scrollTopBtn).removeClass('showup'); + $('body').removeClass('scrolled'); + } + if (topPos > enoughHeightPlus) { + $('body').addClass('scrolledMore'); + } else { + $('body').removeClass('scrolledMore'); + } + }); + + $(scrollTopBtn).click(function () { + $('html, body').animate( + { + scrollTop: 0, + }, + 500 + ); + return false; + }); + + var scrollToHashLink = function () { + var hash = window.location.hash; + + if (!hash || hash === '#') { + return; + } + + var $targetElement = $(decodeURIComponent(hash)); + + $targetElement = $targetElement.length + ? $targetElement + : $('[name=' + this.hash.slice(1) + ']'); + + if (!$targetElement.length) { + return; + } + + $('html,body').stop().animate( + { + scrollTop: $targetElement.offset().top, + }, + 200 + ); + + return; + }; + + $(document).ready(function () { + handleCustomScrolls(); + + var $myNav = $('#docs-sticky-index'); + Toc.init($myNav); + + $('body').scrollspy({ + target: $myNav, + }); + + $('#docs-sticky-index a').on('click', function (event) { + if (this.hash !== '') { + event.preventDefault(); + var hash = this.hash; + $('html, body').animate( + { + scrollTop: $(decodeURIComponent(hash)).offset().top, + }, + 500, + function () { + window.location.hash = hash; + } + ); + } + }); + + $('.btn-toggle').on('click', function () { + $('.toggle-row').slideToggle(400); + $(this).toggleClass('less'); + }); + + $('.close-mmenu').on('click', function () { + $('.navbar-collapse').removeClass('show'); + }); + + $('.open-dmenu').on('click', function () { + $('.docs-tree-list').slideToggle(); + }); + + scrollToHashLink(); + }); + + $(window).resize(function () { + handleCustomScrolls(); + }); + }); + + function handleCustomScrolls() { + var wWidth = $(window).width(); + if (wWidth > 766) { + $('#sidebar-scroll').mCustomScrollbar({ + theme: 'minimal', + alwaysShowScrollbar: 0, + }); + + $('#scroll-index').mCustomScrollbar({ + theme: 'minimal-dark', + alwaysShowScrollbar: 0, + }); + } + } + + window.Toc.helpers.createNavList = function () { + return $(''); + }; + + window.Toc.helpers.createChildNavList = function ($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }; + + window.Toc.helpers.generateNavEl = function (anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $(''); + $li.append($a); + return $li; + }; + + function docsCriteria() { + var docsContentWidth = $('.docs-content').width() - 20; + $('.alert-criteria').width(docsContentWidth); + } + $(document).ready(function () { + docsCriteria(); + }); + $(window).resize(function () { + docsCriteria(); + }); })(jQuery); diff --git a/modules/feature-management/.prettierrc b/modules/feature-management/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/feature-management/.prettierrc +++ b/modules/feature-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js index 0df9d50775..7e4960999c 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js @@ -1,14 +1,14 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; + abp.modals = abp.modals || {}; - abp.modals.FeatureManagement = function () { - $('.FeatureValueCheckbox').change(function () { - if (this.checked) { - $(this).val('true'); - } else { - $(this).val('false'); - } - }); - }; + abp.modals.FeatureManagement = function () { + $('.FeatureValueCheckbox').change(function () { + if (this.checked) { + $(this).val('true'); + } else { + $(this).val('false'); + } + }); + }; })(jQuery); diff --git a/modules/identity/.prettierrc b/modules/identity/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/identity/.prettierrc +++ b/modules/identity/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js index c5c15136e3..4331ab4229 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js @@ -1,114 +1,120 @@ (function ($) { - var l = abp.localization.getResource('AbpIdentity'); + var l = abp.localization.getResource('AbpIdentity'); - var _identityRoleAppService = volo.abp.identity.identityRole; - var _permissionsModal = new abp.ModalManager( - abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' - ); - var _editModal = new abp.ModalManager( - abp.appPath + 'Identity/Roles/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'Identity/Roles/CreateModal' - ); + var _identityRoleAppService = volo.abp.identity.identityRole; + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Roles/CreateModal' + ); - $(function () { - var _$wrapper = $('#IdentityRolesWrapper'); - var _$table = _$wrapper.find('table'); + $(function () { + var _$wrapper = $('#IdentityRolesWrapper'); + var _$table = _$wrapper.find('table'); - var _dataTable = _$table.DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - searching: false, - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Roles.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted( - 'AbpIdentity.Roles.ManagePermissions' - ), - action: function (data) { - _permissionsModal.open({ - providerName: 'R', - providerKey: data.record.name, - }); - }, - }, - { - text: l('Delete'), - visible: function (data) { - return ( - !data.isStatic && - abp.auth.isGranted('AbpIdentity.Roles.Delete') - ); //TODO: Check permission - }, - confirmMessage: function (data) { - return l( - 'RoleDeletionConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - _identityRoleAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'name', - render: function (data, type, row) { - var name = '' + data + ''; - if (row.isDefault) { - name += - '' + - l('DisplayName:IsDefault') + - ''; - } - if (row.isPublic) { - name += - '' + - l('DisplayName:IsPublic') + - ''; - } - return name; - }, - }, - ], - }) - ); + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + searching: false, + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax( + _identityRoleAppService.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpIdentity.Roles.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Roles.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'R', + providerKey: data.record.name, + }); + }, + }, + { + text: l('Delete'), + visible: function (data) { + return ( + !data.isStatic && + abp.auth.isGranted( + 'AbpIdentity.Roles.Delete' + ) + ); //TODO: Check permission + }, + confirmMessage: function (data) { + return l( + 'RoleDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _identityRoleAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + render: function (data, type, row) { + var name = '' + data + ''; + if (row.isDefault) { + name += + '' + + l('DisplayName:IsDefault') + + ''; + } + if (row.isPublic) { + name += + '' + + l('DisplayName:IsPublic') + + ''; + } + return name; + }, + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateRole]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateRole]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 40e1c1b3c1..53f66ddb5e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -1,97 +1,103 @@ (function ($) { - var l = abp.localization.getResource('AbpIdentity'); + var l = abp.localization.getResource('AbpIdentity'); - var _identityUserAppService = volo.abp.identity.identityUser; - var _editModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'Identity/Users/CreateModal' - ); - var _permissionsModal = new abp.ModalManager( - abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' - ); + var _identityUserAppService = volo.abp.identity.identityUser; + var _editModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'Identity/Users/CreateModal' + ); + var _permissionsModal = new abp.ModalManager( + abp.appPath + 'AbpPermissionManagement/PermissionManagementModal' + ); - $(function () { - var _$wrapper = $('#IdentityUsersWrapper'); - var _$table = _$wrapper.find('table'); - var _dataTable = _$table.DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - processing: true, - serverSide: true, - scrollX: true, - paging: true, - ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted('AbpIdentity.Users.Update'), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Permissions'), - visible: abp.auth.isGranted( - 'AbpIdentity.Users.ManagePermissions' - ), - action: function (data) { - _permissionsModal.open({ - providerName: 'U', - providerKey: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('AbpIdentity.Users.Delete'), - confirmMessage: function (data) { - return l( - 'UserDeletionConfirmationMessage', - data.record.userName - ); - }, - action: function (data) { - _identityUserAppService - .delete(data.record.id) - .then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'userName', - }, - { - data: 'email', - }, - { - data: 'phoneNumber', - }, - ], - }) - ); + $(function () { + var _$wrapper = $('#IdentityUsersWrapper'); + var _$table = _$wrapper.find('table'); + var _dataTable = _$table.DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + serverSide: true, + scrollX: true, + paging: true, + ajax: abp.libs.datatables.createAjax( + _identityUserAppService.getList + ), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Permissions'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.ManagePermissions' + ), + action: function (data) { + _permissionsModal.open({ + providerName: 'U', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'AbpIdentity.Users.Delete' + ), + confirmMessage: function (data) { + return l( + 'UserDeletionConfirmationMessage', + data.record.userName + ); + }, + action: function (data) { + _identityUserAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'userName', + }, + { + data: 'email', + }, + { + data: 'phoneNumber', + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateUser]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateUser]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(jQuery); diff --git a/modules/identityserver/.prettierrc b/modules/identityserver/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/identityserver/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/permission-management/.prettierrc b/modules/permission-management/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/permission-management/.prettierrc +++ b/modules/permission-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js index 6cba3cdb35..ca03b5abae 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/permission-management-modal.js @@ -1,268 +1,260 @@ var abp = abp || {}; (function ($) { - abp.modals = abp.modals || {}; + abp.modals = abp.modals || {}; - abp.modals.PermissionManagement = function () { - function checkParents($tab, $checkBox) { - var parentName = $checkBox - .closest('.custom-checkbox') - .attr('data-parent-name'); - if (!parentName) { - return; - } + abp.modals.PermissionManagement = function () { + function checkParents($tab, $checkBox) { + var parentName = $checkBox + .closest('.custom-checkbox') + .attr('data-parent-name'); + if (!parentName) { + return; + } - $tab - .find('.custom-checkbox') - .filter('[data-permission-name="' + parentName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $parent = $(this); - $parent.prop('checked', true); - checkParents($tab, $parent); - }); - } + $tab.find('.custom-checkbox') + .filter('[data-permission-name="' + parentName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $parent = $(this); + $parent.prop('checked', true); + checkParents($tab, $parent); + }); + } - function uncheckChildren($tab, $checkBox) { - var permissionName = $checkBox - .closest('.custom-checkbox') - .attr('data-permission-name'); - if (!permissionName) { - return; - } + function uncheckChildren($tab, $checkBox) { + var permissionName = $checkBox + .closest('.custom-checkbox') + .attr('data-permission-name'); + if (!permissionName) { + return; + } - $tab - .find('.custom-checkbox') - .filter('[data-parent-name="' + permissionName + '"]') - .find('input[type="checkbox"]') - .each(function () { - var $child = $(this); - $child.prop('checked', false); - uncheckChildren($tab, $child); - }); - } + $tab.find('.custom-checkbox') + .filter('[data-parent-name="' + permissionName + '"]') + .find('input[type="checkbox"]') + .each(function () { + var $child = $(this); + $child.prop('checked', false); + uncheckChildren($tab, $child); + }); + } - function handleTabCheckedCheckboxCount($tab) { - var newCount = 0; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - newCount++; - } - }); + function handleTabCheckedCheckboxCount($tab) { + var newCount = 0; + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + newCount++; + } + }); - var $tabTitle = $('#' + $tab.attr('id') + '-tab'); - var title = $tabTitle - .html() - .replace('', '') - .replace('', '') - .replace('', '') - .replace('', ''); + var $tabTitle = $('#' + $tab.attr('id') + '-tab'); + var title = $tabTitle + .html() + .replace('', '') + .replace('', '') + .replace('', '') + .replace('', ''); - var titleSplitted = title.split(' '); - if (titleSplitted[titleSplitted.length - 1].startsWith('(')) { - titleSplitted.pop(); - } - var titleWithoutCount = titleSplitted.join(' '); - var newTitle = titleWithoutCount + ' (' + newCount + ')'; - if (newCount > 0) { - newTitle = '' + newTitle + ''; - } else { - newTitle = '' + newTitle + ''; - } - $tabTitle.html(newTitle); - } + var titleSplitted = title.split(' '); + if (titleSplitted[titleSplitted.length - 1].startsWith('(')) { + titleSplitted.pop(); + } + var titleWithoutCount = titleSplitted.join(' '); + var newTitle = titleWithoutCount + ' (' + newCount + ')'; + if (newCount > 0) { + newTitle = '' + newTitle + ''; + } else { + newTitle = '' + newTitle + ''; + } + $tabTitle.html(newTitle); + } - function handleUncheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function handleUncheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - if ($checkBox.is(':checked')) { - if ( - $tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]') - .length > 1 - ) { - $($checkBox).prop('indeterminate', true); - } else { - $checkBox.prop('checked', false); - } - } else if ($checkBox.is(':indeterminate')) { - var allUnchecked = true; + if ($checkBox.is(':checked')) { + if ( + $tab + .find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]').length > 1 + ) { + $($checkBox).prop('indeterminate', true); + } else { + $checkBox.prop('checked', false); + } + } else if ($checkBox.is(':indeterminate')) { + var allUnchecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - allUnchecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnchecked = false; + } + }); - if (allUnchecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', false); - } - } - } + if (allUnchecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', false); + } + } + } - function handleCheck($tab) { - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function handleCheck($tab) { + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - var allChecked = true; + var allChecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === false) { - allChecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === false) { + allChecked = false; + } + }); - if (allChecked) { - $($checkBox).prop('indeterminate', false); - $checkBox.prop('checked', true); - } else { - $($checkBox).prop('indeterminate', true); - } - } + if (allChecked) { + $($checkBox).prop('indeterminate', false); + $checkBox.prop('checked', true); + } else { + $($checkBox).prop('indeterminate', true); + } + } - function initSelectAllInThisTab() { - var tabs = $('.tab-pane'); - for (var i = 0; i < tabs.length; i++) { - var $tab = $(tabs[i]); - var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); + function initSelectAllInThisTab() { + var tabs = $('.tab-pane'); + for (var i = 0; i < tabs.length; i++) { + var $tab = $(tabs[i]); + var $checkBox = $tab.find('input[name="SelectAllInThisTab"]'); - var allChecked = true; - var allUnChecked = true; + var allChecked = true; + var allUnChecked = true; - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } - }); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } + }); - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } - } + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } + } - function setSelectAllInAllTabs() { - var $checkBox = $('#SelectAllInAllTabs'); + function setSelectAllInAllTabs() { + var $checkBox = $('#SelectAllInAllTabs'); - var anyIndeterminate = false; - var allChecked = true; - var allUnChecked = true; + var anyIndeterminate = false; + var allChecked = true; + var allUnChecked = true; - $('input[name="SelectAllInThisTab"]').each(function () { - if ($(this).is(':checked') === true) { - allUnChecked = false; - } else { - allChecked = false; - } + $('input[name="SelectAllInThisTab"]').each(function () { + if ($(this).is(':checked') === true) { + allUnChecked = false; + } else { + allChecked = false; + } - if ($(this).is(':indeterminate') === true) { - anyIndeterminate = true; - } - }); + if ($(this).is(':indeterminate') === true) { + anyIndeterminate = true; + } + }); - if (anyIndeterminate) { - $($checkBox).prop('indeterminate', true); - return; - } else { - $($checkBox).prop('indeterminate', false); - } + if (anyIndeterminate) { + $($checkBox).prop('indeterminate', true); + return; + } else { + $($checkBox).prop('indeterminate', false); + } - if (allChecked) { - $($checkBox).prop('checked', true); - } else if (allUnChecked) { - $($checkBox).prop('checked', false); - } else { - $($checkBox).prop('indeterminate', true); - } - } + if (allChecked) { + $($checkBox).prop('checked', true); + } else if (allUnChecked) { + $($checkBox).prop('checked', false); + } else { + $($checkBox).prop('indeterminate', true); + } + } - this.initDom = function ($el) { - $el.find('.tab-pane').each(function () { - var $tab = $(this); - handleTabCheckedCheckboxCount($tab); - $tab - .find('input[type="checkbox"]') - .not('[name="SelectAllInThisTab"]') - .each(function () { - var $checkBox = $(this); - $checkBox.change(function () { - if ($checkBox.is(':checked')) { - checkParents($tab, $checkBox); - handleCheck($tab); - } else { - uncheckChildren($tab, $checkBox); - handleUncheck($tab); - } - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab); - }); - }); - }); + this.initDom = function ($el) { + $el.find('.tab-pane').each(function () { + var $tab = $(this); + handleTabCheckedCheckboxCount($tab); + $tab.find('input[type="checkbox"]') + .not('[name="SelectAllInThisTab"]') + .each(function () { + var $checkBox = $(this); + $checkBox.change(function () { + if ($checkBox.is(':checked')) { + checkParents($tab, $checkBox); + handleCheck($tab); + } else { + uncheckChildren($tab, $checkBox); + handleUncheck($tab); + } + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); + }); + }); - $('input[name="SelectAllInThisTab"]').change(function () { - var $checkBox = $(this); - var $tab = $('#' + $checkBox.attr('data-tab-id')); - if ($checkBox.is(':checked')) { - $tab - .find('input[type="checkbox"]') - .not(':disabled') - .prop('checked', true); - } else { - $tab - .find('input[type="checkbox"]') - .not(':disabled') - .prop('checked', false); - } - $($checkBox).prop('indeterminate', false); - setSelectAllInAllTabs(); - handleTabCheckedCheckboxCount($tab); - }); + $('input[name="SelectAllInThisTab"]').change(function () { + var $checkBox = $(this); + var $tab = $('#' + $checkBox.attr('data-tab-id')); + if ($checkBox.is(':checked')) { + $tab.find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $tab.find('input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); + setSelectAllInAllTabs(); + handleTabCheckedCheckboxCount($tab); + }); - $('input[name="SelectAllInAllTabs"]').change(function () { - var $checkBox = $(this); - if ($checkBox.is(':checked')) { - $('.tab-pane input[type="checkbox"]') - .not(':disabled') - .prop('checked', true); - } else { - $('.tab-pane input[type="checkbox"]') - .not(':disabled') - .prop('checked', false); - } - $($checkBox).prop('indeterminate', false); + $('input[name="SelectAllInAllTabs"]').change(function () { + var $checkBox = $(this); + if ($checkBox.is(':checked')) { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', true); + } else { + $('.tab-pane input[type="checkbox"]') + .not(':disabled') + .prop('checked', false); + } + $($checkBox).prop('indeterminate', false); - $el.find('.tab-pane').each(function () { - handleTabCheckedCheckboxCount($(this)); - }); - }); + $el.find('.tab-pane').each(function () { + handleTabCheckedCheckboxCount($(this)); + }); + }); - $(function () { - $('.custom-scroll-content').mCustomScrollbar({ - theme: 'minimal-dark', - }); - $('.custom-scroll-container > .col-4').mCustomScrollbar({ - theme: 'minimal-dark', - }); - }); + $(function () { + $('.custom-scroll-content').mCustomScrollbar({ + theme: 'minimal-dark', + }); + $('.custom-scroll-container > .col-4').mCustomScrollbar({ + theme: 'minimal-dark', + }); + }); - initSelectAllInThisTab(); - setSelectAllInAllTabs(); - }; - }; + initSelectAllInThisTab(); + setSelectAllInAllTabs(); + }; + }; })(jQuery); diff --git a/modules/setting-management/.prettierrc b/modules/setting-management/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/setting-management/.prettierrc +++ b/modules/setting-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js index 6a72d6872e..32ea1a27cc 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js @@ -1,7 +1,7 @@ (function ($) { - var l = abp.localization.getResource('AbpSettingManagement'); + var l = abp.localization.getResource('AbpSettingManagement'); - $(document).on('AbpSettingSaved', function () { - abp.notify.success(l('SuccessfullySaved')); - }); + $(document).on('AbpSettingSaved', function () { + abp.notify.success(l('SuccessfullySaved')); + }); })(jQuery); diff --git a/modules/tenant-management/.prettierrc b/modules/tenant-management/.prettierrc index 7d1b8aa721..34a0e1ecde 100644 --- a/modules/tenant-management/.prettierrc +++ b/modules/tenant-management/.prettierrc @@ -1,4 +1,5 @@ { - "singleQuote": true, - "useTabs": true + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js index 0fdba0a660..de01d1cfdd 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.js @@ -1,18 +1,20 @@ (function ($) { - abp.modals.TenantConnectionStringManagement = function () { - var initModal = function (publicApi, args) { - publicApi - .getModal() - .find('input[name="Tenant.UseSharedDatabase"]') - .change(function () { - var $this = $(this); - $('#Tenant_DefaultConnectionString_Wrap').toggleClass('d-none'); - $this.val($this.prop('checked')); - }); - }; + abp.modals.TenantConnectionStringManagement = function () { + var initModal = function (publicApi, args) { + publicApi + .getModal() + .find('input[name="Tenant.UseSharedDatabase"]') + .change(function () { + var $this = $(this); + $('#Tenant_DefaultConnectionString_Wrap').toggleClass( + 'd-none' + ); + $this.val($this.prop('checked')); + }); + }; - return { - initModal: initModal, - }; - }; + return { + initModal: initModal, + }; + }; })(jQuery); 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 c3f00dcd24..65fedcad23 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 @@ -1,108 +1,111 @@ (function () { - var l = abp.localization.getResource('AbpTenantManagement'); - var _tenantAppService = volo.abp.tenantManagement.tenant; + var l = abp.localization.getResource('AbpTenantManagement'); + var _tenantAppService = volo.abp.tenantManagement.tenant; - var _editModal = new abp.ModalManager( - abp.appPath + 'TenantManagement/Tenants/EditModal' - ); - var _createModal = new abp.ModalManager( - abp.appPath + 'TenantManagement/Tenants/CreateModal' - ); - var _featuresModal = new abp.ModalManager( - abp.appPath + 'FeatureManagement/FeatureManagementModal' - ); - var _connectionStringsModal = new abp.ModalManager({ - viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', - modalClass: 'TenantConnectionStringManagement', - }); + var _editModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/EditModal' + ); + var _createModal = new abp.ModalManager( + abp.appPath + 'TenantManagement/Tenants/CreateModal' + ); + var _featuresModal = new abp.ModalManager( + abp.appPath + 'FeatureManagement/FeatureManagementModal' + ); + var _connectionStringsModal = new abp.ModalManager({ + viewUrl: + abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', + modalClass: 'TenantConnectionStringManagement', + }); - $(function () { - var _$wrapper = $('#TenantsWrapper'); + $(function () { + var _$wrapper = $('#TenantsWrapper'); - var _dataTable = _$wrapper.find('table').DataTable( - abp.libs.datatables.normalizeConfiguration({ - order: [[1, 'asc']], - processing: true, - paging: true, - scrollX: true, - serverSide: true, - ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), - columnDefs: [ - { - rowAction: { - items: [ - { - text: l('Edit'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.Update' - ), - action: function (data) { - _editModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('ConnectionStrings'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.ManageConnectionStrings' - ), - action: function (data) { - _connectionStringsModal.open({ - id: data.record.id, - }); - }, - }, - { - text: l('Features'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.ManageFeatures' - ), - action: function (data) { - _featuresModal.open({ - providerName: 'T', - providerKey: data.record.id, - }); - }, - }, - { - text: l('Delete'), - visible: abp.auth.isGranted( - 'AbpTenantManagement.Tenants.Delete' - ), - confirmMessage: function (data) { - return l( - 'TenantDeletionConfirmationMessage', - data.record.name - ); - }, - action: function (data) { - _tenantAppService.delete(data.record.id).then(function () { - _dataTable.ajax.reload(); - }); - }, - }, - ], - }, - }, - { - data: 'name', - }, - ], - }) - ); + var _dataTable = _$wrapper.find('table').DataTable( + abp.libs.datatables.normalizeConfiguration({ + order: [[1, 'asc']], + processing: true, + paging: true, + scrollX: true, + serverSide: true, + ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), + columnDefs: [ + { + rowAction: { + items: [ + { + text: l('Edit'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Update' + ), + action: function (data) { + _editModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('ConnectionStrings'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageConnectionStrings' + ), + action: function (data) { + _connectionStringsModal.open({ + id: data.record.id, + }); + }, + }, + { + text: l('Features'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.ManageFeatures' + ), + action: function (data) { + _featuresModal.open({ + providerName: 'T', + providerKey: data.record.id, + }); + }, + }, + { + text: l('Delete'), + visible: abp.auth.isGranted( + 'AbpTenantManagement.Tenants.Delete' + ), + confirmMessage: function (data) { + return l( + 'TenantDeletionConfirmationMessage', + data.record.name + ); + }, + action: function (data) { + _tenantAppService + .delete(data.record.id) + .then(function () { + _dataTable.ajax.reload(); + }); + }, + }, + ], + }, + }, + { + data: 'name', + }, + ], + }) + ); - _createModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _createModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _editModal.onResult(function () { - _dataTable.ajax.reload(); - }); + _editModal.onResult(function () { + _dataTable.ajax.reload(); + }); - _$wrapper.find('button[name=CreateTenant]').click(function (e) { - e.preventDefault(); - _createModal.open(); - }); - }); + _$wrapper.find('button[name=CreateTenant]').click(function (e) { + e.preventDefault(); + _createModal.open(); + }); + }); })(); diff --git a/modules/users/.prettierrc b/modules/users/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/modules/users/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/virtual-file-explorer/.prettierrc b/modules/virtual-file-explorer/.prettierrc index 7d1b8aa721..56af76bd94 100644 --- a/modules/virtual-file-explorer/.prettierrc +++ b/modules/virtual-file-explorer/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "useTabs": true + "useTabs": false, + "tabWidth": 4 } diff --git a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js index e535b810e8..0e05e3be4b 100644 --- a/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js +++ b/modules/virtual-file-explorer/src/Volo.Abp.VirtualFileExplorer.Web/Pages/VirtualFileExplorer/index.js @@ -1,9 +1,9 @@ var _fileContentModal = new abp.ModalManager( - abp.appPath + 'VirtualFileExplorer/FileContentModal' + abp.appPath + 'VirtualFileExplorer/FileContentModal' ); function showContent(filePath) { - _fileContentModal.open({ - filePath: filePath, - }); + _fileContentModal.open({ + filePath: filePath, + }); } From 50d10e915a95b2e158aac56f6cd8598c417c1f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Mon, 13 Jul 2020 12:35:49 +0300 Subject: [PATCH 29/41] templates - prettier reformatted --- templates/app/aspnet-core/.prettierrc | 5 +++++ .../src/MyCompanyName.MyProjectName.Web/Pages/Index.js | 2 +- templates/module/aspnet-core/.prettierrc | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 templates/app/aspnet-core/.prettierrc create mode 100644 templates/module/aspnet-core/.prettierrc diff --git a/templates/app/aspnet-core/.prettierrc b/templates/app/aspnet-core/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/templates/app/aspnet-core/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.js index 46f089b9c7..a31bd7cc44 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.js @@ -1,3 +1,3 @@ $(function () { abp.log.debug('Index.js initialized!'); -}); \ No newline at end of file +}); diff --git a/templates/module/aspnet-core/.prettierrc b/templates/module/aspnet-core/.prettierrc new file mode 100644 index 0000000000..56af76bd94 --- /dev/null +++ b/templates/module/aspnet-core/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} From ff18197733dcdf87786cc623d2d8de4c5b78384e Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 12:43:52 +0300 Subject: [PATCH 30/41] fix: get layout component on every route change --- .../lib/components/dynamic-layout.component.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts b/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts index 2548cfece6..7b1395223c 100644 --- a/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts +++ b/npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts @@ -24,6 +24,13 @@ import { TreeNode } from '../utils/tree-utils'; export class DynamicLayoutComponent implements OnDestroy { layout: Type; + // TODO: Consider a shared enum (eThemeSharedComponents) for known layouts + readonly layouts = new Map([ + ['application', 'Theme.ApplicationLayoutComponent'], + ['account', 'Theme.AccountLayoutComponent'], + ['empty', 'Theme.EmptyLayoutComponent'], + ]); + isLayoutVisible = true; constructor( @@ -36,11 +43,6 @@ export class DynamicLayoutComponent implements OnDestroy { const route = injector.get(ActivatedRoute); const router = injector.get(Router); const routes = injector.get(RoutesService); - const layouts = { - application: this.getComponent('Theme.ApplicationLayoutComponent'), - account: this.getComponent('Theme.AccountLayoutComponent'), - empty: this.getComponent('Theme.EmptyLayoutComponent'), - }; router.events.pipe(takeUntilDestroy(this)).subscribe(event => { if (event instanceof NavigationEnd) { @@ -62,7 +64,8 @@ export class DynamicLayoutComponent implements OnDestroy { if (!expectedLayout) expectedLayout = eLayoutType.empty; - this.layout = layouts[expectedLayout].component; + const key = this.layouts.get(expectedLayout); + this.layout = this.getComponent(key).component; } }); From a875b66eff12006d9cde6b022410de709efdb197 Mon Sep 17 00:00:00 2001 From: buaziz Date: Mon, 13 Jul 2020 12:51:22 +0300 Subject: [PATCH 31/41] Update SignalR-Integration.md --- docs/en/SignalR-Integration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/SignalR-Integration.md b/docs/en/SignalR-Integration.md index 5b176a84a5..f6ba81b550 100644 --- a/docs/en/SignalR-Integration.md +++ b/docs/en/SignalR-Integration.md @@ -115,7 +115,7 @@ public class MessagingHub : Hub } ```` -The hub route will be `/signalr-hubs/messasing` for the `MessasingHub`: +The hub route will be `/signalr-hubs/messaging` for the `MessagingHub`: * Adding a standard `/signalr-hubs/` prefix * Continue with the **camel case** hub name, without the `Hub` suffix. @@ -123,7 +123,7 @@ The hub route will be `/signalr-hubs/messasing` for the `MessasingHub`: If you want to specify the route, you can use the `HubRoute` attribute: ````csharp -[HubRoute("/my-messasing-hub")] +[HubRoute("/my-messaging-hub")] public class MessagingHub : Hub { //... @@ -132,7 +132,7 @@ public class MessagingHub : Hub ### AbpHub Base Classes -Instead of the standard `Hub` and `Hub` classes, you can inherit from the `AbpHub` or `AbpHub` which hve useful base properties like `CurrentUser`. +Instead of the standard `Hub` and `Hub` classes, you can inherit from the `AbpHub` or `AbpHub` which have useful base properties like `CurrentUser`. Example: From 44f535b6d57277d4b2ea881d4fc6d1c6b6f243e9 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 13 Jul 2020 13:45:22 +0300 Subject: [PATCH 32/41] docs: update component replacement document --- docs/en/UI/Angular/Component-Replacement.md | 32 ++++++++--------- .../UI/Angular/Component-Replacement.md | 36 ++++++++----------- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/docs/en/UI/Angular/Component-Replacement.md b/docs/en/UI/Angular/Component-Replacement.md index d2c75cd67c..4a461ae431 100644 --- a/docs/en/UI/Angular/Component-Replacement.md +++ b/docs/en/UI/Angular/Component-Replacement.md @@ -11,25 +11,24 @@ Create a new component that you want to use instead of an ABP component. Add tha Then, open the `app.component.ts` and dispatch the `AddReplaceableComponent` action to replace your component with an ABP component as shown below: ```js -import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent action +import { AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent action import { eIdentityComponents } from '@abp/ng.identity'; // imported eIdentityComponents enum import { Store } from '@ngxs/store'; // imported Store //... @Component(/* component metadata */) -export class AppComponent implements OnInit { - constructor(..., private store: Store) {} // injected Store - - ngOnInit() { - // added dispatch +export class AppComponent { + constructor( + private store: Store // injected Store + ) + { + // dispatched the AddReplaceableComponent action this.store.dispatch( new AddReplaceableComponent({ component: YourNewRoleComponent, key: eIdentityComponents.Roles, }), ); - - //... } } ``` @@ -60,26 +59,23 @@ Add the following code in your layout template (`my-layout.component.html`) wher Open `app.component.ts` in `src/app` folder and modify it as shown below: ```js -import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent +import { AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeBasicComponents enum for component keys -import { MyApplicationLayoutComponent } from './shared/my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent import { Store } from '@ngxs/store'; // imported Store -//... +import { MyApplicationLayoutComponent } from './my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent @Component(/* component metadata */) -export class AppComponent implements OnInit { - constructor(..., private store: Store) {} // injected Store - - ngOnInit() { - // added dispatch +export class AppComponent { + constructor( + private store: Store, // injected Store + ) { + // dispatched the AddReplaceableComponent action this.store.dispatch( new AddReplaceableComponent({ component: MyApplicationLayoutComponent, key: eThemeBasicComponents.ApplicationLayout, }), ); - - //... } } ``` diff --git a/docs/zh-Hans/UI/Angular/Component-Replacement.md b/docs/zh-Hans/UI/Angular/Component-Replacement.md index 145359c348..221ac6775a 100644 --- a/docs/zh-Hans/UI/Angular/Component-Replacement.md +++ b/docs/zh-Hans/UI/Angular/Component-Replacement.md @@ -11,25 +11,24 @@ 然后打开 `app.component.ts` 使用 `AddReplaceableComponent` 将你的组件替换ABP组件. 如下所示: ```js -import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent action +import { AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent action import { eIdentityComponents } from '@abp/ng.identity'; // imported eIdentityComponents enum import { Store } from '@ngxs/store'; // imported Store //... @Component(/* component metadata */) -export class AppComponent implements OnInit { - constructor(..., private store: Store) {} // injected Store - - ngOnInit() { - // added dispatch +export class AppComponent { + constructor( + private store: Store // injected Store + ) + { + // dispatched the AddReplaceableComponent action this.store.dispatch( new AddReplaceableComponent({ component: YourNewRoleComponent, key: eIdentityComponents.Roles, }), ); - - //... } } ``` @@ -47,9 +46,7 @@ export class AppComponent implements OnInit { 运行以下命令在 `angular` 文件夹中生成布局: ```bash -yarn ng generate component shared/my-application-layout --export --entryComponent - -# You don't need the --entryComponent option in Angular 9 +yarn ng generate component my-application-layout ``` 在你的布局模板(`my-layout.component.html`)中添加以下代码: @@ -61,26 +58,23 @@ yarn ng generate component shared/my-application-layout --export --entryComponen 打开 `src/app` 文件夹下的 `app.component.ts` 文件添加以下内容: ```js -import { ..., AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent +import { AddReplaceableComponent } from '@abp/ng.core'; // imported AddReplaceableComponent import { eThemeBasicComponents } from '@abp/ng.theme.basic'; // imported eThemeBasicComponents enum for component keys -import { MyApplicationLayoutComponent } from './shared/my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent import { Store } from '@ngxs/store'; // imported Store -//... +import { MyApplicationLayoutComponent } from './my-application-layout/my-application-layout.component'; // imported MyApplicationLayoutComponent @Component(/* component metadata */) -export class AppComponent implements OnInit { - constructor(..., private store: Store) {} // injected Store - - ngOnInit() { - // added dispatch +export class AppComponent { + constructor( + private store: Store, // injected Store + ) { + // dispatched the AddReplaceableComponent action this.store.dispatch( new AddReplaceableComponent({ component: MyApplicationLayoutComponent, key: eThemeBasicComponents.ApplicationLayout, }), ); - - //... } } ``` From bb6e1a11fb472944acf295f483b1df722d74e618 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 13:57:44 +0300 Subject: [PATCH 33/41] feat: add a reload parameter to AddReplaceableComponent --- .../actions/replaceable-components.actions.ts | 5 ++++- .../states/replaceable-components.state.ts | 21 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/actions/replaceable-components.actions.ts b/npm/ng-packs/packages/core/src/lib/actions/replaceable-components.actions.ts index 3b948cf63d..8df6a384ad 100644 --- a/npm/ng-packs/packages/core/src/lib/actions/replaceable-components.actions.ts +++ b/npm/ng-packs/packages/core/src/lib/actions/replaceable-components.actions.ts @@ -5,5 +5,8 @@ import { ReplaceableComponents } from '../models/replaceable-components'; */ export class AddReplaceableComponent { static readonly type = '[ReplaceableComponents] Add'; - constructor(public payload: ReplaceableComponents.ReplaceableComponent) {} + constructor( + public payload: ReplaceableComponents.ReplaceableComponent, + public reload?: boolean, + ) {} } diff --git a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts index 7c07621ad4..0e48104f87 100644 --- a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts @@ -1,8 +1,9 @@ import { Injectable } from '@angular/core'; -import { State, Action, StateContext, Selector, createSelector } from '@ngxs/store'; +import { Router } from '@angular/router'; +import { Action, createSelector, Selector, State, StateContext } from '@ngxs/store'; +import snq from 'snq'; import { AddReplaceableComponent } from '../actions/replaceable-components.actions'; import { ReplaceableComponents } from '../models/replaceable-components'; -import snq from 'snq'; @State({ name: 'ReplaceableComponentsState', @@ -28,10 +29,12 @@ export class ReplaceableComponentsState { return selector; } + constructor(private router: Router) {} + @Action(AddReplaceableComponent) - replaceableComponentsAction( + async replaceableComponentsAction( { getState, patchState }: StateContext, - { payload }: AddReplaceableComponent, + { payload, reload }: AddReplaceableComponent, ) { let { replaceableComponents } = getState(); @@ -48,5 +51,15 @@ export class ReplaceableComponentsState { patchState({ replaceableComponents, }); + + if (reload) { + // TODO: Create a shared service for route reload and more + const { shouldReuseRoute } = this.router.routeReuseStrategy; + this.router.routeReuseStrategy.shouldReuseRoute = () => false; + this.router.navigated = false; + + await this.router.navigateByUrl(this.router.url).catch(); + this.router.routeReuseStrategy.shouldReuseRoute = shouldReuseRoute; + } } } From 14b8b1d4d3e26adaff70bcf11aab358b0e27a49b Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 14:32:46 +0300 Subject: [PATCH 34/41] test: add tests for replacing when reload is true --- .../states/replaceable-components.state.ts | 32 ++++++++++++------- .../replaceable-components.state.spec.ts | 24 ++++++++++++-- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts index 0e48104f87..1f583f233f 100644 --- a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import { Injectable, NgZone } from '@angular/core'; import { Router } from '@angular/router'; import { Action, createSelector, Selector, State, StateContext } from '@ngxs/store'; import snq from 'snq'; @@ -29,10 +29,26 @@ export class ReplaceableComponentsState { return selector; } - constructor(private router: Router) {} + constructor(private ngZone: NgZone, private router: Router) {} + + // TODO: Create a shared service for route reload and more + private reloadRoute() { + const { shouldReuseRoute } = this.router.routeReuseStrategy; + const setRouteReuse = (reuse: typeof shouldReuseRoute) => { + this.router.routeReuseStrategy.shouldReuseRoute = reuse; + }; + + setRouteReuse(() => false); + this.router.navigated = false; + + this.ngZone.run(async () => { + await this.router.navigateByUrl(this.router.url).catch(); + setRouteReuse(shouldReuseRoute); + }); + } @Action(AddReplaceableComponent) - async replaceableComponentsAction( + replaceableComponentsAction( { getState, patchState }: StateContext, { payload, reload }: AddReplaceableComponent, ) { @@ -52,14 +68,6 @@ export class ReplaceableComponentsState { replaceableComponents, }); - if (reload) { - // TODO: Create a shared service for route reload and more - const { shouldReuseRoute } = this.router.routeReuseStrategy; - this.router.routeReuseStrategy.shouldReuseRoute = () => false; - this.router.navigated = false; - - await this.router.navigateByUrl(this.router.url).catch(); - this.router.routeReuseStrategy.shouldReuseRoute = shouldReuseRoute; - } + if (reload) this.reloadRoute(); } } diff --git a/npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts index c294b131e1..dc113c433c 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts @@ -1,21 +1,27 @@ +import { APP_BASE_HREF } from '@angular/common'; +import { Component } from '@angular/core'; +import { Router, RouterModule } from '@angular/router'; +import { SpyObject } from '@ngneat/spectator'; import { createHostFactory, SpectatorHost } from '@ngneat/spectator/jest'; import { NgxsModule, Store } from '@ngxs/store'; -import { ReplaceableComponentsState } from '../states/replaceable-components.state'; -import { Component } from '@angular/core'; import { AddReplaceableComponent } from '../actions'; +import { ReplaceableComponentsState } from '../states/replaceable-components.state'; @Component({ selector: 'abp-dummy', template: 'dummy works' }) class DummyComponent {} describe('ReplaceableComponentsState', () => { let spectator: SpectatorHost; + let router: SpyObject; const createHost = createHostFactory({ component: DummyComponent, - imports: [NgxsModule.forRoot([ReplaceableComponentsState])], + providers: [{ provide: APP_BASE_HREF, useValue: '/' }], + imports: [RouterModule.forRoot([]), NgxsModule.forRoot([ReplaceableComponentsState])], }); beforeEach(() => { spectator = createHost(''); + router = spectator.inject(Router); }); it('should add a component to the state', () => { @@ -38,4 +44,16 @@ describe('ReplaceableComponentsState', () => { }); expect(store.selectSnapshot(ReplaceableComponentsState.getAll)).toHaveLength(1); }); + + it('should call reloadRoute when reload parameter is given as true to AddReplaceableComponent', async () => { + const spy = jest.spyOn(router, 'navigateByUrl'); + const store = spectator.get(Store); + store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' })); + store.dispatch(new AddReplaceableComponent({ component: null, key: 'Dummy' }, true)); + + await spectator.fixture.whenStable(); + + expect(spy).toHaveBeenCalledTimes(1); + expect(spy).toHaveBeenCalledWith(router.url); + }); }); From 2c4357a99a9a7c1b8cf431d91e2e0bb4e1f8618a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 13 Jul 2020 14:43:20 +0300 Subject: [PATCH 35/41] fix: add noop to catch routing errors --- .../core/src/lib/states/replaceable-components.state.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts index 1f583f233f..fe9cecaa79 100644 --- a/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts @@ -1,3 +1,4 @@ +import { noop } from '@abp/ng.core'; import { Injectable, NgZone } from '@angular/core'; import { Router } from '@angular/router'; import { Action, createSelector, Selector, State, StateContext } from '@ngxs/store'; @@ -42,7 +43,7 @@ export class ReplaceableComponentsState { this.router.navigated = false; this.ngZone.run(async () => { - await this.router.navigateByUrl(this.router.url).catch(); + await this.router.navigateByUrl(this.router.url).catch(noop); setRouteReuse(shouldReuseRoute); }); } From 4cafcfefc2ff5535e55804523de2ce97009304e1 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 13 Jul 2020 14:52:41 +0300 Subject: [PATCH 36/41] ci: add replace with preview script for @abp/utils package version replacement --- npm/ng-packs/scripts/publish.ts | 3 +++ npm/ng-packs/scripts/replace-with-preview.ts | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 npm/ng-packs/scripts/replace-with-preview.ts diff --git a/npm/ng-packs/scripts/publish.ts b/npm/ng-packs/scripts/publish.ts index 72f49db75d..50c1104e71 100644 --- a/npm/ng-packs/scripts/publish.ts +++ b/npm/ng-packs/scripts/publish.ts @@ -1,6 +1,7 @@ import execa from 'execa'; import fse from 'fs-extra'; import program from 'commander'; +import replaceWithPreview from './replace-with-preview'; program .option( @@ -48,6 +49,8 @@ const publish = async () => { await execa('yarn', ['replace-with-tilde']); + if (program.preview) await replaceWithPreview(program.nextVersion); + await execa('yarn', ['build', '--noInstall'], { stdout: 'inherit' }); await fse.rename('../lerna.publish.json', '../lerna.json'); diff --git a/npm/ng-packs/scripts/replace-with-preview.ts b/npm/ng-packs/scripts/replace-with-preview.ts new file mode 100644 index 0000000000..1f624059b2 --- /dev/null +++ b/npm/ng-packs/scripts/replace-with-preview.ts @@ -0,0 +1,19 @@ +import fse from 'fs-extra'; + +export default async function(version: string) { + const corePkgPath = '../packages/core/package.json'; + try { + const corePkg = await fse.readJSON(corePkgPath); + + await fse.writeJSON( + corePkgPath, + { + ...corePkg, + dependencies: { ...corePkg.dependencies, '@abp/utils': version }, + }, + { spaces: 2 }, + ); + } catch (error) { + console.error(error); + } +} From 3f69d25adca76964355f67178757c3fffe025613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C4=9Fan=20=C3=9Cnl=C3=BC?= <36102404+armgnunlu@users.noreply.github.com> Date: Mon, 13 Jul 2020 15:33:05 +0300 Subject: [PATCH 37/41] Resolved #4023 --- .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../wwwroot/themes/basic/layout.css | 31 +++++++++++++++++-- .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Properties/launchSettings.json | 27 ++++++++++++++++ .../Pages/Index.css | 2 +- 10 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.MultiTenancy/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.Client/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.Serilog/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.TestBase/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Properties/launchSettings.json new file mode 100644 index 0000000000..f52562c96c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53601/", + "sslPort": 44330 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.Authentication.OAuth": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Properties/launchSettings.json new file mode 100644 index 0000000000..6495c71095 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53597/", + "sslPort": 44355 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.MultiTenancy": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Properties/launchSettings.json new file mode 100644 index 0000000000..b9542fa082 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53603/", + "sslPort": 44305 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.Mvc.Client": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css index c252bf55ef..20c75cfb69 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.css @@ -57,7 +57,34 @@ font-size: 0.8em; } - .dataTables_scrollBody { min-height: 248px; -} \ No newline at end of file +} + +div.dataTables_wrapper div.dataTables_info { + padding-top: 11px; + white-space: nowrap; +} + +div.dataTables_wrapper div.dataTables_length label { + padding-top: 10px; + margin-bottom: 0; +} + +.rtl .dropdown-menu-right { + right: auto; + left: 0; +} + + .rtl .dropdown-menu-right a { + text-align: right; + } + +.rtl .navbar .dropdown-menu a { + text-align: right; +} +.rtl .navbar .dropdown-submenu .dropdown-menu { + top: 0; + left: auto; + right: 100%; +} diff --git a/framework/src/Volo.Abp.AspNetCore.Serilog/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.Serilog/Properties/launchSettings.json new file mode 100644 index 0000000000..afff9bb30b --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Serilog/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53606/", + "sslPort": 44319 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.Serilog": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json new file mode 100644 index 0000000000..f5e00240d4 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53611/", + "sslPort": 44331 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.SignalR": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.TestBase/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.TestBase/Properties/launchSettings.json new file mode 100644 index 0000000000..fca23e6182 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.TestBase/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53599/", + "sslPort": 44358 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore.TestBase": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore/Properties/launchSettings.json new file mode 100644 index 0000000000..78196102ba --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53596/", + "sslPort": 44300 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.AspNetCore": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..c5f82293b3 --- /dev/null +++ b/framework/src/Volo.Abp.Http.Client.IdentityModel.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53610/", + "sslPort": 44304 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.Http.Client.IdentityModel.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.css b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.css index 3f73b78b9f..b248b67c1b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.css +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.css @@ -1,3 +1,3 @@ body { -} +} \ No newline at end of file From 44e9f26bfff0f265cf9dc59d5a512b3c4dfdc2a4 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 13 Jul 2020 17:18:46 +0300 Subject: [PATCH 38/41] chrore: replace some yarn commands with npm --- npm/ng-packs/scripts/publish.ts | 2 +- npm/preview-publish.ps1 | 6 +++--- npm/publish.ps1 | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/npm/ng-packs/scripts/publish.ts b/npm/ng-packs/scripts/publish.ts index 50c1104e71..3b16992357 100644 --- a/npm/ng-packs/scripts/publish.ts +++ b/npm/ng-packs/scripts/publish.ts @@ -27,7 +27,7 @@ const publish = async () => { try { await fse.remove('../dist'); - await execa('yarn', ['install'], { stdout: 'inherit', cwd: '../' }); + await execa('npm', ['install'], { stdout: 'inherit', cwd: '../' }); await fse.rename('../lerna.version.json', '../lerna.json'); diff --git a/npm/preview-publish.ps1 b/npm/preview-publish.ps1 index 11c4ca0a21..9749e64b7e 100644 --- a/npm/preview-publish.ps1 +++ b/npm/preview-publish.ps1 @@ -24,9 +24,9 @@ $commands = ( "npm install", "npm run publish-packages -- --nextVersion $Version --preview", "cd ../../", - "yarn lerna version $Version --yes --no-commit-hooks --skip-git --force-publish", - "yarn replace-with-tilde", - "yarn lerna exec 'npm publish --registry $Registry --tag preview'" + "npm run lerna -- version $Version --yes --no-commit-hooks --skip-git --force-publish", + "npm run replace-with-tilde", + "npm run lerna -- exec 'npm publish --registry $Registry --tag preview'" ) foreach ($command in $commands) { diff --git a/npm/publish.ps1 b/npm/publish.ps1 index aaed04e6d4..ce513d8461 100644 --- a/npm/publish.ps1 +++ b/npm/publish.ps1 @@ -16,12 +16,12 @@ $commands = ( "npm install", "npm run publish-packages -- --nextVersion $Version", "cd ../../", - "yarn lerna version $Version --yes --no-commit-hooks --skip-git --force-publish", - "yarn replace-with-tilde", - "yarn lerna exec 'npm publish --registry https://registry.npmjs.org'", - "yarn update:templates", - "yarn gulp:app", - "yarn gulp:module" + "npm run lerna -- version $Version --yes --no-commit-hooks --skip-git --force-publish", + "npm run replace-with-tilde", + "npm run lerna -- exec 'npm publish --registry https://registry.npmjs.org'", + "npm run update:templates", + "npm run gulp:app", + "npm run gulp:module" ) foreach ($command in $commands) { From aca3207d2726dad90633d4259e51f0a01c168cf2 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 13 Jul 2020 17:45:03 +0300 Subject: [PATCH 39/41] docs: add a description to component-replacement.md --- docs/en/UI/Angular/Component-Replacement.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/UI/Angular/Component-Replacement.md b/docs/en/UI/Angular/Component-Replacement.md index 4a461ae431..fd34fcbae7 100644 --- a/docs/en/UI/Angular/Component-Replacement.md +++ b/docs/en/UI/Angular/Component-Replacement.md @@ -80,6 +80,8 @@ export class AppComponent { } ``` +> If you like to replace a layout component at runtime (e.g: changing the layout by pressing a button), pass the second parameter of the AddReplaceableComponent action as true. DynamicLayoutComponent loads content using a router-outlet. When the second parameter of AddReplaceableComponent is true, the route will be refreshed, so use it with caution. Your component state will be gone and any initiation logic (including HTTP requests) will be repeated. + ### Layout Components ![Layout Components](./images/layout-components.png) From 9e468fd3f578a5862792f412ee61ab208d4929d1 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 14 Jul 2020 03:24:59 +0800 Subject: [PATCH 40/41] Fix #4745: Remove the use of UseHangfireServer in the Hangfire background job doc. --- docs/en/Background-Jobs-Hangfire.md | 5 +---- docs/zh-Hans/Background-Jobs-Hangfire.md | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/en/Background-Jobs-Hangfire.md b/docs/en/Background-Jobs-Hangfire.md index 3a98fed66e..e71d4496b9 100644 --- a/docs/en/Background-Jobs-Hangfire.md +++ b/docs/en/Background-Jobs-Hangfire.md @@ -66,9 +66,7 @@ After you have installed these NuGet packages, you need to configure your projec } ```` -2. We need to add `UseHangfireServer` call in the `OnApplicationInitialization` method in `Module` class - -If you want to use hangfire's dashboard, you can add it, too: by `UseHangfireDashboard` +2. If you want to use hangfire's dashboard, you can add `UseHangfireServer` call in the `OnApplicationInitialization` method in `Module` class ````csharp public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -77,7 +75,6 @@ If you want to use hangfire's dashboard, you can add it, too: by `UseHangfireDas // ... others - app.UseHangfireServer(); app.UseHangfireDashboard(); } diff --git a/docs/zh-Hans/Background-Jobs-Hangfire.md b/docs/zh-Hans/Background-Jobs-Hangfire.md index bbe9428bb9..b1bf7b8c79 100644 --- a/docs/zh-Hans/Background-Jobs-Hangfire.md +++ b/docs/zh-Hans/Background-Jobs-Hangfire.md @@ -66,9 +66,7 @@ public class YourModule : AbpModule } ```` -1. 我们需要在 `Module` 类的 `OnApplicationInitialization` 方法添加 `UseHangfireServer` 方法调用. - -如果你想要使用Hangfire的面板,你可以使用: `UseHangfireDashboard` +1. 如果你想要使用Hangfire的面板,你可以在 `Module` 类的 `OnApplicationInitialization` 方法添加: `UseHangfireDashboard` ````csharp public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -77,7 +75,6 @@ public class YourModule : AbpModule // ... others - app.UseHangfireServer(); app.UseHangfireDashboard(); } From 7cd05edf6a6ef6b81cc7de16d76d3013fada7d6f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 14 Jul 2020 04:55:28 +0800 Subject: [PATCH 41/41] Update Background-Jobs-Hangfire.md --- docs/en/Background-Jobs-Hangfire.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Background-Jobs-Hangfire.md b/docs/en/Background-Jobs-Hangfire.md index e71d4496b9..cfa2e12a6b 100644 --- a/docs/en/Background-Jobs-Hangfire.md +++ b/docs/en/Background-Jobs-Hangfire.md @@ -66,7 +66,7 @@ After you have installed these NuGet packages, you need to configure your projec } ```` -2. If you want to use hangfire's dashboard, you can add `UseHangfireServer` call in the `OnApplicationInitialization` method in `Module` class +2. If you want to use hangfire's dashboard, you can add `UseHangfireDashboard` call in the `OnApplicationInitialization` method in `Module` class ````csharp public override void OnApplicationInitialization(ApplicationInitializationContext context)