Skip to content

Angular - Fixing empty navigation item for a library #23009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

sumeyyeKurtulus
Copy link
Contributor

@sumeyyeKurtulus sumeyyeKurtulus commented Jun 4, 2025

Description

Resolves https://github.com/volosoft/volo/issues/19953

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

How to test it?

  • You need to create a microservice app and add a microservice through suite
  • Delete the generated library that is apps/angular/projects/<your-service>
  • Get a build for the schematics package under npm/ng-packs by running yarn build:schematics
  • Go to the npm/ng-packs/dist/packages/schematics and run yarn link, then copy the link command given in the output
  • You need to paste it under apps/angular of your microservice. Then, run this command to regenerate your service yarn ng g @abp/ng.schematics:create-lib --package-name "<your-service>" (Select false for secondary endpoint and override questions. Pick module as a type since the standalone templates are not published yet.)
  • Once you run the app, you should not see the routing of your service in the navbar since it has no valid page in it.
  • Create entities for that specific service. This time, you will need to see the route items in the navbar if you have the necessary permissions.

Copy link
Contributor

@oykuermann oykuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test module is still visible on navbar:
image

@sumeyyeKurtulus
Copy link
Contributor Author

Hello @oykuermann can you confirm that you have such route definition in your angular/node_modules/@abp/ng.schematics/commands/create-lib/files-package/__libraryName@kebab__/config/src/providers/route.provider.ts.template

export function configureRoutes(routesService: RoutesService) {
  return () => {
    routesService.add([
      {
        path: undefined, //should be undefined
        name: e<%= pascal(libraryName) %>RouteNames.<%= pascal(libraryName) %>,
        iconClass: 'fas fa-book',
        layout: eLayoutType.application,
        order: 3,
      },
    ]);
  };
}

or angular/node_modules/@abp/ng.schematics/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/providers/route.provider.ts.template

export function configureRoutes() {
  const routes = inject(RoutesService);
  routes.add([
      {
        path: undefined, //should be undefined
        name: e<%= pascal(libraryName) %>RouteNames.<%= pascal(libraryName) %>,
        iconClass: 'fas fa-book',
        layout: eLayoutType.application,
        order: 3,
      },
  ]);
}

@skoc10 skoc10 modified the milestones: 9.2-patch, 9.2-patch-final Jun 17, 2025
@oykuermann
Copy link
Contributor

path is not undefined
image

@sumeyyeKurtulus
Copy link
Contributor Author

So, it did not get the changes as expected. Can you follow the points above? If it does not work, we can check it together.

@oykuermann
Copy link
Contributor

So, it did not get the changes as expected. Can you follow the points above? If it does not work, we can check it together.

I followed all the steps :( can we check together?

@oykuermann oykuermann merged commit 4c8a93c into rel-9.2 Jun 20, 2025
2 checks passed
@oykuermann oykuermann deleted the fix/empty-navigation-for-library branch June 20, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants