From 23fd8c91c11a8c34a6880ca6cd6a8c92fbd71e53 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 3 Aug 2023 13:53:12 +0200 Subject: [PATCH] UI to update about information. --- backend/i18n/frontend_en.json | 6 +- backend/i18n/frontend_fr.json | 6 +- backend/i18n/frontend_it.json | 6 +- backend/i18n/frontend_nl.json | 6 +- backend/i18n/frontend_pt.json | 6 +- backend/i18n/frontend_zh.json | 6 +- backend/i18n/source/backend_en.json | 25 ++++++- backend/i18n/source/frontend_en.json | 6 +- .../src/Squidex.Domain.Users/UserValues.cs | 2 +- .../Identity/SquidexClaimsExtensions.cs | 15 ++++ backend/src/Squidex.Shared/Texts.fr.resx | 69 ++++++++++++++++++ backend/src/Squidex.Shared/Texts.it.resx | 69 ++++++++++++++++++ backend/src/Squidex.Shared/Texts.nl.resx | 69 ++++++++++++++++++ backend/src/Squidex.Shared/Texts.pt.resx | 69 ++++++++++++++++++ backend/src/Squidex.Shared/Texts.resx | 71 ++++++++++++++++++- backend/src/Squidex.Shared/Texts.zh.resx | 69 ++++++++++++++++++ .../Users/Models/UpdateProfileDto.cs | 2 +- .../Controllers/Profile/ChangeAboutModel.cs | 32 +++++++++ .../Controllers/Profile/ProfileController.cs | 14 +++- .../Controllers/Profile/ProfileVM.cs | 8 +++ .../Views/Profile/Profile.cshtml | 68 ++++++++++++++++-- .../src/Squidex/Config/MyIdentityOptions.cs | 2 + backend/src/Squidex/Startup.cs | 14 ++-- .../pages/onboarding-dialog.component.html | 4 +- 24 files changed, 605 insertions(+), 39 deletions(-) create mode 100644 backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ChangeAboutModel.cs diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 10039530c..4e37b93ac 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "The assets contains all files that can also be linked to your content. For example images, videos or documents.\n\nYou can upload the assets here and use them later or also upload them directly when you create a new content item with an asset field.", "tour.stepContentNext": "Almost there!", "tour.stepContentText": "Content is the actual data in your app which is grouped by the schema.\n\nSelect a published schema first, then add content for this schema.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Let's take a look around", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index f504ba193..c8ccb35a7 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "Les actifs contiennent tous les fichiers qui peuvent également être liés à votre contenu. Par exemple des images, des vidéos ou des documents. Vous pouvez télécharger les actifs ici et les utiliser plus tard ou également les télécharger directement lorsque vous créez un nouvel élément de contenu avec un champ d'actif.", "tour.stepContentNext": "Presque là!", "tour.stepContentText": "Le contenu est les données réelles de votre application qui sont regroupées par le schéma. Sélectionnez d'abord un schéma publié, puis ajoutez du contenu pour ce schéma.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Jetons un coup d'œil autour", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index a086072a8..87f7ca04a 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "Le risorse contengono tutti i file che tu puoi collegare ai tuoi contenuti. Per esempio immagini, video o documenti.\n\nPuoi caricare qui le risorse e usarle successivamente oppure caricarle direttamente quando stai creando un contenuto utilizzando un campo risorse.", "tour.stepContentNext": "Ci siamo quasi!", "tour.stepContentText": "I contenuti della tua app sono raggruppati tramite gli schemi.\n\nSeleziona uno schema pubblicato e poi crea il relativo contenuto.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Guardiamoci intorno", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 2001cd096..d22f7fb97 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "De mappen bevatten alle bestanden die ook aan uw inhoud kunnen worden gekoppeld. Bijvoorbeeld afbeeldingen, video's of documenten. \n \n Je kunt de bestanden hier uploaden en later gebruiken of ze direct uploaden wanneer je een nieuw contentitem met een bestandveld maakt. ", "tour.stepContentNext": "Bijna klaar!", "tour.stepContentText": "Inhoud zijn de feitelijke gegevens in uw app die zijn gegroepeerd op basis van het schema. \n \n Selecteer eerst een gepubliceerd schema en voeg vervolgens inhoud toe voor dit schema.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Laten we eens rondkijken", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index ca4412aa3..97e001c10 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "Os ativos contêm todos os ficheiros que também podem estar ligados ao seu conteúdo. Por exemplo, imagens, vídeos ou documentos.\n\nPode fazer o upload dos ativos aqui e usá-los mais tarde ou também carregá-los diretamente quando criar um novo item de conteúdo com um campo de ativos.", "tour.stepContentNext": "Está quase!", "tour.stepContentText": "O conteúdo é o dado real da sua app que é agrupado pelo esquema.\n\nSelecione primeiro um esquema publicado e, em seguida, adicione conteúdo para este esquema.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Vamos dar uma vista de olhos.", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 090fa83d0..3a45c98d9 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "资源包含所有也可以链接到您的内容的文件。例如图像、视频或文档。\n\n您可以在此处上传资源供以后使用,也可以在创建时直接上传带有资源字段的新内容项。", "tour.stepContentNext": "快到了!", "tour.stepContentText": "内容是您的应用程序中按Schemas分组的实际数据。\n\n首先选择一个已发布的Schemas,然后为此Schemas添加内容。", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "我们看看周围", diff --git a/backend/i18n/source/backend_en.json b/backend/i18n/source/backend_en.json index dadf2d1f5..0452ab5c2 100644 --- a/backend/i18n/source/backend_en.json +++ b/backend/i18n/source/backend_en.json @@ -350,11 +350,15 @@ "users.logout.text": "!Please close this popup.", "users.logout.title": "Logout", "users.noEmailAddress": "We cannot get the email address from authentication provider.", + "users.profile.aboutHint": "Please share some information about your. It helps us to get an understanding about our users and to improve the product.", + "users.profile.aboutTitle": "About You", "users.profile.addLoginDone": "Login added successfully.", "users.profile.changePassword": "Change Password", "users.profile.changePasswordDone": "Password changed successfully.", - "users.profile.clientHint": "Use the client credentials to access the API with your profile information and permissions", + "users.profile.clientHint": "Use the client credentials to access the API with your profile information and personal permissions, for example to create apps.", "users.profile.clientTitle": "Client", + "users.profile.companyRole": "What is your role?", + "users.profile.companySize": "How many people work in a company?", "users.profile.confirmPassword": "Confirm", "users.profile.generateClient": "Generate", "users.profile.generateClientDone": "Client secret generated successfully.", @@ -363,12 +367,31 @@ "users.profile.loginsTitle": "Logins", "users.profile.passwordTitle": "Password", "users.profile.pii": "Personal Information", + "users.profile.project": "What kind of project do you realize?", + "users.profile.projectBackend": "Backend Data Management", + "users.profile.projectCommerce": "E-Commerce Solution", + "users.profile.projectLearning": "None, I am just here for learning", + "users.profile.projectMobileApp": "Mobile App", + "users.profile.projectNewsMagazine": "News Magazine", + "users.profile.projectPersonalBlog": "Personal Blog", + "users.profile.projectSmallBusiness": "Website for Small Business", "users.profile.propertiesHint": "Use custom properties for rules and scripts.", "users.profile.propertiesTitle": "Properties", "users.profile.propertyAdd": "Add Property", "users.profile.removeLoginDone": "Login provider removed successfully.", + "users.profile.roleBusinessAnalyst": "Business Analyst", + "users.profile.roleBusinessOwner": "Business Owner", + "users.profile.roleContentCreator": "Content Creator", + "users.profile.roleEmployee": "Work at a company", + "users.profile.roleProductManager": "Product Manager", + "users.profile.roleSoftwareDeveloper": "Business Owner", "users.profile.setPassword": "Set Password", "users.profile.setPasswordDone": "Password set successfully.", + "users.profile.sizeLarge": "101-1000", + "users.profile.sizeMedium": "51-100", + "users.profile.sizeSingle": "1", + "users.profile.sizeSmall": "2-10", + "users.profile.sizeVeryLarge": "1000+", "users.profile.title": "Profile", "users.profile.updateProfileDone": "Account updated successfully.", "users.profile.updatePropertiesDone": "Account updated successfully.", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 10039530c..4e37b93ac 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -1069,8 +1069,8 @@ "tour.projectCommerce": "E-Commerce Solution", "tour.projectLearning": "None, I am just here for learning", "tour.projectMobileApp": "Mobile App", - "tour.projectNewsMagazine": "", - "tour.projectPersonalBlog": "News Magazine", + "tour.projectNewsMagazine": "News Magazine", + "tour.projectPersonalBlog": "Personal Blog", "tour.projectSmallBusiness": "Website for Small Business", "tour.roleBusinessAnalyst": "Business Analyst", "tour.roleBusinessOwner": "Business Owner", @@ -1090,10 +1090,10 @@ "tour.stepAssetsText": "The assets contains all files that can also be linked to your content. For example images, videos or documents.\n\nYou can upload the assets here and use them later or also upload them directly when you create a new content item with an asset field.", "tour.stepContentNext": "Almost there!", "tour.stepContentText": "Content is the actual data in your app which is grouped by the schema.\n\nSelect a published schema first, then add content for this schema.", + "tour.stepDataCompanyRole": "What is your role?", "tour.stepDataCompanySize": "How many people work in a company?", "tour.stepDataNext": "Continue", "tour.stepDataProject": "What kind of project do you realize?", - "tour.stepDataRole": "What is your role?", "tour.stepDataText": "Before we continue we would like to learn a little bit about you to improve to user experience.", "tour.stepDataTitle": "About You", "tour.stepIntroNext": "Let's take a look around", diff --git a/backend/src/Squidex.Domain.Users/UserValues.cs b/backend/src/Squidex.Domain.Users/UserValues.cs index 0c08e1401..690cfca27 100644 --- a/backend/src/Squidex.Domain.Users/UserValues.cs +++ b/backend/src/Squidex.Domain.Users/UserValues.cs @@ -36,5 +36,5 @@ public sealed class UserValues public List<(string Name, string Value)>? Properties { get; set; } - public Dictionary? Answers { get; set; } + public Dictionary? Answers { get; set; } } diff --git a/backend/src/Squidex.Shared/Identity/SquidexClaimsExtensions.cs b/backend/src/Squidex.Shared/Identity/SquidexClaimsExtensions.cs index 90d55831f..743747e75 100644 --- a/backend/src/Squidex.Shared/Identity/SquidexClaimsExtensions.cs +++ b/backend/src/Squidex.Shared/Identity/SquidexClaimsExtensions.cs @@ -76,6 +76,21 @@ namespace Squidex.Shared.Identity return user.GetClaimValue(SquidexClaimTypes.DisplayName); } + public static string? Answer(this IEnumerable user, string name) + { + var prefix = $"{name}="; + + foreach (var claim in user) + { + if (claim.Type == SquidexClaimTypes.Answer && claim.Value.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) + { + return claim.Value[prefix.Length..]; + } + } + + return null; + } + public static int GetTotalApps(this IEnumerable user) { var value = user.GetClaimValue(SquidexClaimTypes.TotalApps); diff --git a/backend/src/Squidex.Shared/Texts.fr.resx b/backend/src/Squidex.Shared/Texts.fr.resx index 6a30b6996..f815b666d 100644 --- a/backend/src/Squidex.Shared/Texts.fr.resx +++ b/backend/src/Squidex.Shared/Texts.fr.resx @@ -1135,6 +1135,12 @@ Nous ne pouvons pas obtenir l'adresse e-mail du fournisseur d'authentification. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + Connexion ajoutée avec succès. @@ -1150,6 +1156,12 @@ Client + + What is your role? + + + How many people work in a company? + Confirmer @@ -1174,6 +1186,30 @@ Informations personnelles + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + Utilisez des propriétés personnalisées pour les règles et les scripts. @@ -1186,12 +1222,45 @@ Fournisseur de connexion supprimé avec succès. + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + Définir le mot de passe Mot de passe défini avec succès. + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + Profil diff --git a/backend/src/Squidex.Shared/Texts.it.resx b/backend/src/Squidex.Shared/Texts.it.resx index b0b521fc0..86e5f4abc 100644 --- a/backend/src/Squidex.Shared/Texts.it.resx +++ b/backend/src/Squidex.Shared/Texts.it.resx @@ -1135,6 +1135,12 @@ We cannot get the email address from authentication provider. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + La login è stata aggiunta con successo. @@ -1150,6 +1156,12 @@ Client + + What is your role? + + + How many people work in a company? + Confermare @@ -1174,6 +1186,30 @@ Informazioni personali + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + Utilizza proprietà personalizzate per regole e script. @@ -1186,12 +1222,45 @@ Il provider per l'autenticazione è stato rimosso correttamente. + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + Imposta la Password Password impostata con successo. + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + Profilo diff --git a/backend/src/Squidex.Shared/Texts.nl.resx b/backend/src/Squidex.Shared/Texts.nl.resx index f2f2cb5ce..bc5d58047 100644 --- a/backend/src/Squidex.Shared/Texts.nl.resx +++ b/backend/src/Squidex.Shared/Texts.nl.resx @@ -1135,6 +1135,12 @@ We cannot get the email address from authentication provider. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + Login succesvol toegevoegd. @@ -1150,6 +1156,12 @@ Client + + What is your role? + + + How many people work in a company? + Bevestigen @@ -1174,6 +1186,30 @@ Persoonlijke informatie + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + Gebruik aangepaste eigenschappen voor regels en scripts. @@ -1186,12 +1222,45 @@ Login provider succesvol verwijderd. + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + Wachtwoord instellen Wachtwoord succesvol ingesteld. + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + Profiel diff --git a/backend/src/Squidex.Shared/Texts.pt.resx b/backend/src/Squidex.Shared/Texts.pt.resx index e15f3802b..eb5723a2a 100644 --- a/backend/src/Squidex.Shared/Texts.pt.resx +++ b/backend/src/Squidex.Shared/Texts.pt.resx @@ -1135,6 +1135,12 @@ Não podemos obter o endereço de e-mail do provedor de autenticação. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + Login adicionado com sucesso. @@ -1150,6 +1156,12 @@ cliente + + What is your role? + + + How many people work in a company? + Confirmar @@ -1174,6 +1186,30 @@ Informação pessoal + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + Use propriedades personalizadas para regras e scripts. @@ -1186,12 +1222,45 @@ Provedor de login removido com sucesso. + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + Set Password Password configurada com sucesso. + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + Perfil diff --git a/backend/src/Squidex.Shared/Texts.resx b/backend/src/Squidex.Shared/Texts.resx index 0b0be9e48..c297cc2de 100644 --- a/backend/src/Squidex.Shared/Texts.resx +++ b/backend/src/Squidex.Shared/Texts.resx @@ -1135,6 +1135,12 @@ We cannot get the email address from authentication provider. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + Login added successfully. @@ -1145,11 +1151,17 @@ Password changed successfully. - Use the client credentials to access the API with your profile information and permissions + Use the client credentials to access the API with your profile information and personal permissions, for example to create apps. Client + + What is your role? + + + How many people work in a company? + Confirm @@ -1174,6 +1186,30 @@ Personal Information + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + Use custom properties for rules and scripts. @@ -1186,12 +1222,45 @@ Login provider removed successfully. + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + Set Password Password set successfully. + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + Profile diff --git a/backend/src/Squidex.Shared/Texts.zh.resx b/backend/src/Squidex.Shared/Texts.zh.resx index af0013190..199a0cbb3 100644 --- a/backend/src/Squidex.Shared/Texts.zh.resx +++ b/backend/src/Squidex.Shared/Texts.zh.resx @@ -1135,6 +1135,12 @@ We cannot get the email address from authentication provider. + + Please share some information about your. It helps us to get an understanding about our users and to improve the product. + + + About You + 登录添加成功。 @@ -1150,6 +1156,12 @@ 客户端 + + What is your role? + + + How many people work in a company? + 确认 @@ -1174,6 +1186,30 @@ 个人信息 + + What kind of project do you realize? + + + Backend Data Management + + + E-Commerce Solution + + + None, I am just here for learning + + + Mobile App + + + News Magazine + + + Personal Blog + + + Website for Small Business + 为规则和脚本使用自定义属性。 @@ -1186,12 +1222,45 @@ 登录提供程序删除成功。 + + Business Analyst + + + Business Owner + + + Content Creator + + + Work at a company + + + Product Manager + + + Business Owner + 设置密码 密码设置成功。 + + 101-1000 + + + 51-100 + + + 1 + + + 2-10 + + + 1000+ + 个人资料 diff --git a/backend/src/Squidex/Areas/Api/Controllers/Users/Models/UpdateProfileDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Users/Models/UpdateProfileDto.cs index b950d9bd4..5337cabc6 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Users/Models/UpdateProfileDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Users/Models/UpdateProfileDto.cs @@ -16,7 +16,7 @@ public sealed class UpdateProfileDto /// /// The answers from a questionaire. /// - public Dictionary? Answers { get; set; } + public Dictionary? Answers { get; set; } public UserValues ToValues() { diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ChangeAboutModel.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ChangeAboutModel.cs new file mode 100644 index 000000000..74f29878b --- /dev/null +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ChangeAboutModel.cs @@ -0,0 +1,32 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Squidex.Domain.Users; + +namespace Squidex.Areas.IdentityServer.Controllers.Profile; + +public class ChangeAboutModel +{ + public string? CompanyRole { get; set; } + + public string? CompanySize { get; set; } + + public string? Project { get; set; } + + public UserValues ToValues() + { + return new UserValues + { + Answers = new Dictionary + { + ["companyRole"] = CompanyRole, + ["companySize"] = CompanySize, + ["project"] = Project, + } + }; + } +} diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileController.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileController.cs index d773eab44..1b11fc110 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileController.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileController.cs @@ -92,6 +92,14 @@ public sealed class ProfileController : IdentityServerController T.Get("users.profile.updatePropertiesDone"), model); } + [HttpPost] + [Route("account/profile/about/")] + public Task UpdateAbout(ChangeAboutModel model) + { + return MakeChangeAsync((id, ct) => userService.UpdateAsync(id, model.ToValues(), ct: ct), + T.Get("users.profile.updateProfileDone"), model); + } + [HttpPost] [Route("account/profile/login-remove/")] public Task RemoveLogin(RemoveLoginModel model) @@ -249,14 +257,18 @@ public sealed class ProfileController : IdentityServerController { Id = user.Id, ClientSecret = user.Claims.ClientSecret()!, + CompanyRole = user.Claims.Answer("companyRole"), + CompanySize = user.Claims.Answer("companySize"), + DisplayName = user.Claims.DisplayName()!, Email = user.Email, ErrorMessage = errorMessage, ExternalLogins = logins, ExternalProviders = providers, - DisplayName = user.Claims.DisplayName()!, HasPassword = hasPassword, HasPasswordAuth = identityOptions.AllowPasswordAuth, IsHidden = user.Claims.IsHidden(), + Project = user.Claims.Answer("project"), + ShowAbout = identityOptions.ShowAbout, SuccessMessage = successMessage }; diff --git a/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileVM.cs b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileVM.cs index 70b80749c..b9f4fe87c 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileVM.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Controllers/Profile/ProfileVM.cs @@ -17,12 +17,20 @@ public sealed class ProfileVM public string DisplayName { get; set; } + public string? CompanyRole { get; set; } + + public string? CompanySize { get; set; } + + public string? Project { get; set; } + public string? ClientSecret { get; set; } public string? ErrorMessage { get; set; } public string? SuccessMessage { get; set; } + public bool ShowAbout { get; set; } + public bool IsHidden { get; set; } public bool HasPassword { get; set; } diff --git a/backend/src/Squidex/Areas/IdentityServer/Views/Profile/Profile.cshtml b/backend/src/Squidex/Areas/IdentityServer/Views/Profile/Profile.cshtml index 12b2933fa..26820f0e5 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Views/Profile/Profile.cshtml +++ b/backend/src/Squidex/Areas/IdentityServer/Views/Profile/Profile.cshtml @@ -53,7 +53,7 @@ @Html.AntiForgeryToken()
- + @{ RenderValidation("Email"); } @@ -61,7 +61,7 @@
- + @{ RenderValidation("DisplayName"); } @@ -79,6 +79,66 @@ +@if (Model.ShowAbout) +{ +
+ +
+

@T.Get("users.profile.aboutTitle")

+ + @T.Get("users.profile.aboutHint") + +
+ @Html.AntiForgeryToken() + +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ +
+
+
+} + @if (Model!.ExternalProviders.Any()) {
@@ -210,7 +270,7 @@

@T.Get("users.profile.clientTitle")

- @T.Get("users.profile.clientHint") + @T.Get("users.profile.clientHint")
@@ -242,7 +302,7 @@

@T.Get("users.profile.propertiesTitle")

- @T.Get("users.profile.propertiesHint") + @T.Get("users.profile.propertiesHint")
@Html.AntiForgeryToken() diff --git a/backend/src/Squidex/Config/MyIdentityOptions.cs b/backend/src/Squidex/Config/MyIdentityOptions.cs index 63e99e136..41e4effcc 100644 --- a/backend/src/Squidex/Config/MyIdentityOptions.cs +++ b/backend/src/Squidex/Config/MyIdentityOptions.cs @@ -73,6 +73,8 @@ public sealed class MyIdentityOptions public bool ShowPII { get; set; } + public bool ShowAbout { get; set; } + public bool SuppressXFrameOptionsHeader { get; set; } public bool IsAdminConfigured() diff --git a/backend/src/Squidex/Startup.cs b/backend/src/Squidex/Startup.cs index 63a5e8f95..0edaf078d 100644 --- a/backend/src/Squidex/Startup.cs +++ b/backend/src/Squidex/Startup.cs @@ -79,27 +79,28 @@ public sealed class Startup public void Configure(IApplicationBuilder app) { app.UseWebSockets(); - app.UseCookiePolicy(); - app.UseDefaultPathBase(); app.UseDefaultForwardRules(); - app.UseSquidexHealthCheck(); app.UseSquidexRobotsTxt(); app.UseSquidexLogging(); app.UseSquidexLocalization(); app.UseSquidexLocalCache(); app.UseSquidexCors(); + app.UseOpenApi(options => { options.Path = "/api/swagger/v1/swagger.json"; }); - app.UseWhen(c => c.Request.Path.StartsWithSegments(Constants.PrefixIdentityServer, StringComparison.OrdinalIgnoreCase), builder => + if (!app.ApplicationServices.GetRequiredService().IsDevelopment()) { - builder.UseExceptionHandler("/identity-server/error"); - }); + app.UseWhen(c => c.Request.Path.StartsWithSegments(Constants.PrefixIdentityServer, StringComparison.OrdinalIgnoreCase), builder => + { + builder.UseExceptionHandler("/identity-server/error"); + }); + } app.UseWhen(c => c.Request.Path.StartsWithSegments(Constants.PrefixApi, StringComparison.OrdinalIgnoreCase), builder => { @@ -110,7 +111,6 @@ public sealed class Startup }); app.UseRouting(); - app.UseAuthentication(); app.UseAuthorization(); diff --git a/frontend/src/app/features/apps/pages/onboarding-dialog.component.html b/frontend/src/app/features/apps/pages/onboarding-dialog.component.html index 7202f56a6..d2228b4c4 100644 --- a/frontend/src/app/features/apps/pages/onboarding-dialog.component.html +++ b/frontend/src/app/features/apps/pages/onboarding-dialog.component.html @@ -32,7 +32,7 @@
- + - +