Renaming Client project from "Web-Admin" to "Web-Admintest" doesn't work

2024/09/25 4:23 PM

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

2024/09/26 1:01 PM

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.

  1. 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>
    
  2. In the webpack.config.js of the client app
     return baseWebpackConfig({
      orgName: 'kentico-community',
      projectName: 'portal-web-admin',
      webpackConfigEnv,
      argv,
    });
    
  3. 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");
    }
    
  4. Additionally, make sure all your React/TypeScript types are exported from your index.tsx
  5. 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);
    
  6. 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
    	}
     }
    
  7. 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.