Activities of "s.beckers"

After upgrading, the generate proxy command (@abp/ng.schematics:proxy-add) generates incorrect import statements. We're using generics in our dto's.

Hi, the same problem with my,
but I try to add a 'generator' of Nx to wrap schematic of abp,
It works fine because of ignore angular.json check.
You can ref below simple code ,thanks

import {  
  Tree,  
  moveFilesToNewDirectory,  
  generateFiles,  
  joinPathFragments,  
  visitNotIgnoredFiles,  
  ProjectConfiguration  
} from '@nrwl/devkit';  
import { wrapAngularDevkitSchematic } from '@nrwl/devkit/ngcli-adapter';  
  
export default async function (host: Tree, schema: any) {  
  let module=schema.module;  
  let application=schema.application;  
  let directory=schema.directory;  
  let projectType=schema.projectType;  
  let appPath=application;//.replace('-','\\');  
  let runAngularLibrarySchematic = wrapAngularDevkitSchematic(  
    '@abp/ng.schematics',  
    'proxy-add'  
  );  
  
  await runAngularLibrarySchematic(host, {  
    module: module,  
    source: application,  
    target: application  
  });  
  
  if(projectType==='lib'){  
    await removeProject(host,`libs\\${directory}\\${module}\\proxy\\src\\proxy`);  
    moveFilesToNewDirectory(  
      host,  
      `apps\\${appPath}\\src\\app\\proxy`,  
      `libs\\${directory}\\${module}\\proxy\\src\\proxy`  
    );  
  }  
  
  if(projectType==='app'){  
    moveFilesToNewDirectory(  
      host,  
      `apps\\${appPath}\\src\\app\\proxy`,  
      `apps\\${appPath}\\src\\app\\${module}\\proxy`  
    );  
  }  
   
  
  return () => {  
    console.log(`proxy added '${module} to ${module} success at ${application}`);  
  };  
}  
  
export function removeProject(tree: Tree, path: string) {  
  visitNotIgnoredFiles(tree, path, (file) => {  
    tree.delete(file);  
  });  
  //tree.delete(path);  
}  
  
  

I have tested the solutions is works without angular.json.
as a workaround, You can create and use your own schematic wrapper. source: https://nx.dev/plugins/recipes/local-generators

Thank you!

Any idea if this can be checked by someone? We're currently stuck upgrading ABP to version 7 since the generate-proxy command doesn't work anymore.

Thank you! In which version will the bug fix be released?

Hi

Thanks for confirming. I've overridden the EntityHistoryHelper's GetPropertyChanges method to include the property changes of the referenced entities.

using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using Volo.Abp.Auditing;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EntityFrameworkCore.EntityHistory;
using Volo.Abp.Json;
using Volo.Abp.Timing;

namespace MyCompany.MyModule;

[Dependency(ReplaceServices = true)]
public class CustomEntityHistoryHelper : EntityHistoryHelper
{
    public CustomEntityHistoryHelper(
        IAuditingStore auditingStore,
        IOptions<AbpAuditingOptions> options,
        IClock clock,
        IJsonSerializer jsonSerializer,
        IAuditingHelper auditingHelper)
        : base(auditingStore, options, clock, jsonSerializer, auditingHelper)
    {
    }

    protected override List<EntityPropertyChangeInfo> GetPropertyChanges(EntityEntry entityEntry)
    {
        List<EntityPropertyChangeInfo> propertyChanges = base.GetPropertyChanges(entityEntry);

        foreach (ReferenceEntry reference in entityEntry.References)
        {
            if (reference.TargetEntry == null)
            {
                continue;
            }

            List<EntityPropertyChangeInfo> referencePropertyChanges = GetPropertyChanges(reference.TargetEntry);

            foreach (EntityPropertyChangeInfo referencePropertyChange in referencePropertyChanges)
            {
                referencePropertyChange.PropertyName = $"{reference.Metadata.Name}.{referencePropertyChange.PropertyName}";
            }

            propertyChanges.AddRange(referencePropertyChanges);
        }

        return propertyChanges;
    }
}

Any remarks on this approach?

Earlier versions suite was generating AppService names singular. With version 4.3 we realised suite started to generate new service names plural.

Sample: Old: ProductAppService New: ProductsAppService

Is this a new approach for naming convention? Or is this a bug in the templates? The generated .cs class file name is also still singular.

顯示 6 個紀錄的 1 到 6 個.
Made with ❤️ on ABP v8.2.0-preview Updated on 3月 25, 2024, 15:11