Open Closed

Edit Angular Layout #7807


User avatar
0
nabass created

is there a way to edit layout default when login it open home page then choose my page in route to open what i want to do is when login with my tenant i want to open directly to my page and sidebar will be hidden i am sure there is an option to make this hidden when open the page and make user control it open it or close it and when login directed open my page not home page

  • ABP Framework version: v8
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

12 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    loginPage has a returnUrl parameter in MVC side. If you send a returnUrl parameter it should navigate to your URL

    And to hide side menu please check the similar issue if it helps you https://abp.io/support/questions/1664/Hide-menu-after-Login

    Thanks

  • User Avatar
    0
    nabass created

    hi anji i followed your link it always open on my page not open login page for first time what i want to do is open login page as usual from home page and when login hide menu bar and direct open my page with controller for logout (just i want to hide red square) here is my html

    and this is ts and i noticed it is the same code into (home.ts)

    app.component

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Ok Let me check ...

  • User Avatar
    0
    nabass created

    could you create sample like link you share with me (step by step) for doing that logic when running open login page as usual without side bar and when login open the page and side bar still hidden but logout is exist to logout any time could you because i have a lot of conflicts ???

  • User Avatar
    0
    nabass created

    hi can anybody help me if anjali busy

  • User Avatar
    0
    nabass created

    OMG nobody can create sample to this logic and help me ?? wow !!

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello nabass,

    I apologize for the delay. Please allow some time I am working on it.

    Thanks

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello nabass,

    If you want to navigate the Pos page after logging in, add the code below to your app.component.ts In my example I have taken products page

    export class AppComponent implements OnInit {
    
    constructor(private authService: AuthService,
                private router:Router){}
    
    ngOnInit() {
    
      if(this.authService.isAuthenticated){
           this.router.navigate(['/products']);
      }
      else{
          this.router.navigate(['/']);
      }
    }
    }
    
    

    If you require I can share sample project too? please let me know if needed.

    I will give you a workaround to hide the sidemenu bar asap.

    Thanks,

  • User Avatar
    0
    nabass created

    thanks it works i am waiting for next answer with solution of hiding sidemenue thanks again, :)

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello nabass,

    Thanks for updating.

    Now to hide side menu you need to implement AfterViewInit in app.component.ts file and add below code

    ngAfterViewInit(): void {
         if (!document.getElementById('lpx-wrapper').classList.contains('hover-trigger') && this.authService.isAuthenticated) {
          document.getElementById('lpx-wrapper').classList.add('hover-trigger');
          document.getElementById('lpx-wrapper').classList.add('initial-hover');
        }
      }
    

    now your app.component.ts file code will look like this

    It will result after login like

    I hope I answered your question.

    Thanks, Anjali

  • User Avatar
    0
    nabass created

    it works thank you super :) i noticed that is hover is there a way to make it clickable

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello nabass,

    could you please accept the answer and close the ticket if your issue is resolved?

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35