Activities of "yusuf.cirak"

Hi,

We're aware of these localization warnings at initial time, also we'll look into loading fonts with cross-origin:anonymous parameter.

Thank you for the feedbacks.

Hi,

I debugged the application and all the click events and also routerLink works without issue.

I also looked into Angular Router and it seems onSameUrlNavigation is not actually reloading the component. It only triggers guards and resolvers of the route. Which is not actually what we want here. I also checked that guards and resolvers are not always getting triggered. This might cause issues so i want to share this link.

We handle routing by using RouterLink in side menu and extending or changing this behavior is not available atm.

There are suggestions about using router events to handle some logic inside your component. Do you think this might help to solve your problem?

Hi,

As i understand you have your own implementation to pass query parameters to advanced query filters form. When you click the route through sidebar, it does not refresh.

router.navigateByUrl('some-route', { onSameUrlNavigation: 'ignore' });

This is the default behavior of Angular Router.

I think we have two solutions here.

1 - Changing the routing behavior of Angular Router might help to solve your issue.

const MY_MODULE_ROUTE_PROVIDER = [
  provideRouter(
    [{ component: MyComponent, path: 'my-component' }],
    withRouterConfig({ onSameUrlNavigation: 'reload' }),
  ),
];

or,

@NgModule({
  imports: [RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' })],
  exports: [RouterModule],
})
export class AppRoutingModule {}

2 - Replace RoutesComponent by following the steps in this link

Hi,

Don't worry about those imports in case you're not changing any fuctionality of retrieving datas from services.

I got some errors while trying to extend UsersComponent so i leave you a code example below.

First, you need to add your component to be replaced at initial time, via ReplaceableCompnonentsService:

const REPLACED_COMPONENTS_PROVIDER = [
  {
    provide: APP_INITIALIZER,
    useFactory: () => {
      const service = inject(ReplaceableComponentsService);
      return () => {
        service.add({ component: ExtendedUsersComponent, key: eIdentityComponents.Users });
      };
    },
    multi: true,
  },
];

Your component can look like this:

import {
  CoreModule,
  ListService,
  LocalizationModule,
  ReplaceableTemplateDirective,
} from '@abp/ng.core';
import { PermissionManagementModule } from '@abp/ng.permission-management';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ExtensibleModule, EXTENSIONS_IDENTIFIER } from '@abp/ng.components/extensible';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { eIdentityComponents, UsersComponent } from '@abp/ng.identity';
import { PageModule } from '@abp/ng.components/page';
import { CommonModule } from '@angular/common';
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';

@Component({
  selector: 'app-users',
  templateUrl: './users.component.html',
  standalone: true,
  imports: [
    ExtensibleModule,
    PageModule,
    LocalizationModule,
    ThemeSharedModule,
    CommonModule,
    FormsModule,
    PermissionManagementModule,
    ReplaceableTemplateDirective,
    CoreModule,
    NgbNavModule,
  ],
  providers: [
    ListService,
    {
      provide: UsersComponent,
      useExisting: ExtendedUsersComponent,
    },
    {
      provide: EXTENSIONS_IDENTIFIER,
      useValue: eIdentityComponents.Users,
    },
  ],
})
export class ExtendedUsersComponent extends UsersComponent {}

Hi,

You can check this documentation.

For example, i can hide the Administration tab with this code.

const HIDDEN_ROUTES_PROVIDER = [
  {
    provide: APP_INITIALIZER,
    useFactory: (routesService: RoutesService) => {
      return () => {
        const obj = { invisible: true };
        routesService.patch(eThemeSharedRouteNames.Administration, obj);
      };
    },
    deps: [RoutesService],
    multi: true,
  },
];
  • Use eLanguageManagementRouteNames.LanguageManagement from @volo/abp.ng.language-management
  • Use eTextTemplateManagementRouteNames.TextTemplates from @volo/abp.ng.text-template-management

Hi,

We haven't implemented the functionality for replacing for the forms and modals.

I can suggest two solutions.

1 - Don't use the modal, implement page solution for your add/edit operations. We have a tutorial here. 2 - Replace the component entirely with your additional implementations. I think you can add some code to our users component. You can check our component here.

I hope these possible solutions solves your issues.

Hi,

You can hide menu items.

https://docs.abp.io/en/abp/latest/UI/Angular/Modifying-the-Menu#how-to-patch-or-remove-a-navigation-element

We're sorry to keep you waited. I will leave some code examples.

Authority Delegation and Linked Accounts are under user menu items which handled by UserMenuService so you need to do this:

const HIDDEN_MENU_ITEMS_PROVIDER = [
  {
    provide: APP_INITIALIZER,
    useFactory: () => {
      const userMenu = inject(UserMenuService);
      return () => {
        const obj = { visible: () => false };
        userMenu.patchItem(eUserMenuItems.AuthorityDelegation, obj);
        userMenu.patchItem(eUserMenuItems.LinkedAccounts, obj);
      };
    },
    multi: true,
  },
];

The same should apply for Authenticator App. You need to import ManageProfileTabsService from @volo/abp.ng.account package. You can use eAccountManageProfileTabNames enum type.

Hi,

I wasn't able to reproduce your problem but i've imported CoreTestingModule, ThemeSharedTestingModule, NgxValidateCoreModule, VALIDATION_BLUEPRINTS and got some errors from CoreTestingModule.

I've updated my CoreTestingModule and the tests run without problem. I think you should check this PR : https://github.com/abpframework/abp/pull/19571

You're only testing the initialization of your component but i think this will be worth reading after we solve this issue.

LocalizationService has it's own dependencies so it's hard to mock it's requirements, mocking LocalizationService itself might help which what we did in this PR: https://github.com/abpframework/abp/pull/19478.

Please let me know if you still have errors after applying these solutions

Hi,

I wasn't able to reproduce your issue.

I followed the steps you mentioned. Additionally:

  • I added permissions to my user for my new module.
  • I ran dotnet ef migrations add migration_name command then run the DbMigrator app to apply the migrations to the database.

After applying these, there was no issue.

Have you applied these steps too, or is there something im missing?

Hi,

The problem you mentioned is actually solved and it will be available at @volo/ngx-lepton-x.core package in version 3.1.1.

Showing 1 to 10 of 11 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35