Renaming Client project from "Web-Admin" to "Web-Admintest" doesn't work
Hey All.
I'm working on a custom Admin Module project and testing things out as I go (starting with the boilerplate).
Everything works fine when i keep the project name web-admin
, but as soon as i change all the web-admin
to web-admintest
, it gives an error.
This isn't an actual issue on my end (i plan on keeping it web-admin), but just trying to see if Documentation is incorrect.
Here's the locations that get changed, and it matches what is documentation (https://docs.kentico.com/developers-and-admins/customization/extend-the-administration-interface/prepare-your-environment-for-admin-development#[…]t)
Looking into the javascript, i see this in the entry.js:
"/admin/adminresources/xperiencecommunity.relationshipsextended.web.admintest/entry.js"
I suspect that there is some additional configuration that documentation isn't mentioning, my C# Project itself and the assembly is XperienceCommunity.RelationshipsExtended.Web.Admin still, but it doesn't mention updating this.
Any help? It's not a blocker, i was exploring the naming conventions and trying out renaming.
Answers
I'll use the Kentico Community Portal as an example of where all the configuration values need set in a project to make client/React administration customization work.
- In the .csproj of the project containing the React code
<PropertyGroup> <AdminOrgName>kentico-community</AdminOrgName> </PropertyGroup> <!-- ... --> <ItemGroup> <AdminClientPath Include="Client\dist\**"> <ProjectName>portal-web-admin</ProjectName> </AdminClientPath> </ItemGroup>
- In the webpack.config.js of the client app
return baseWebpackConfig({ orgName: 'kentico-community', projectName: 'portal-web-admin', webpackConfigEnv, argv, });
- In the AdminModule declared in your Admin project containing the client app
protected override void OnInit(ModuleInitParameters parameters) { base.OnInit(parameters); RegisterClientModule( "kentico-community", "portal-web-admin"); }
- Additionally, make sure all your React/TypeScript types are exported from your
index.tsx
- Your references to client components need to be correctly formed in your C# classes.
.AddComponentColumn( nameof(WebPageItemInfo.WebPageItemName), "@kentico-community/portal-web-admin/Link", modelRetriever: AnswerLinkModelRetriever, caption: "Question", searchable: true, minWidth: 25);
- Your CMSAdminClientModuleSettings needs to be correctly set in your ASP.NET Core
appsettings.json
"CMSAdminClientModuleSettings": { "kentico-community-portal-web-admin": { "Mode": "Proxy", "Port": 3019, "UseSSL": true } }
- You also need to ensure the webpack dev server is serving over https if your ASP.NET Core app is running over https and the webpack dev server needs to be using a trusted localhost cert.
To answer this question, you have to login first.