Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Seed app routing issue with vCD 10.1 #19

Description

@shubhamkr-cohesity

Describe the bug
With vCD 10.1, the angular container version has been upgraded to 8+ in vCD appliance. With this new version, I am encountering routing issue with my existing plugin which worked well otherwise.

Issue:
Not able to navigate using
router.navigate(router.navigate([extentionPrefix, 'about'])

I have setup a router guard in my routing module to redirect certain requests based on user role,
eg
/plugin/ -> Redirect to /plugin/config // Provider view
/plugin/ -> Redirect to /plugin/overview // Tenant view

I handle this redirection through a router guard and call the router (Router) navigate API to redirect the user.

The error I see in v10.1 is,
Error: Cannot match any routes. URL Segment: 'about'

My routes:
const ROUTES: Routes = [ { path: "", component: SubnavComponent, children: [ { path: "", redirectTo: "status", pathMatch: "full" }, { path: "status", component: StatusComponent, canActivate: [RouterGuardService] }, { path: "about", component: AboutComponent } ] } ];

If I open the URL /plugin/about directly, it works fine.

To Reproduce
Steps to reproduce the behaviour:

  1. Add a router guard to a route.
  2. Redirect the request to a different endpoint through the guard using the navigate() API.

Expected behavior
Since the route is valid, the redirect should have worked just fine.

Screenshots
image

Desktop (please complete the following information):

  • OS: Max
  • Browser Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions