Skip to content
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

[BUG] Breadcrumb Not Rendering Dynamic Segments, e.g. :projectId #6584

Open
aress31 opened this issue Dec 16, 2024 · 10 comments
Open

[BUG] Breadcrumb Not Rendering Dynamic Segments, e.g. :projectId #6584

aress31 opened this issue Dec 16, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@aress31
Copy link

aress31 commented Dec 16, 2024

Describe the bug

The breadcrumb component is not rendering dynamic segments. See the screenshot below:

image

Steps To Reproduce

N/A

Expected behavior

Should render dynamic segment.

Packages

All to latest.

Additional Context

No response

@aress31 aress31 added the bug Something isn't working label Dec 16, 2024
@Samuel-Habib
Copy link

Just to be clear, by breadcrumb components you mean the Projects / Applications part? What specific dynamic segments are you referring to?

@Samuel-Habib
Copy link

I also wanted to clarify as to how you got to the projects route, did you make that route yourself or load it from somewhere else because i don't see it listed as one of the routes in the repo.

@aress31
Copy link
Author

aress31 commented Dec 18, 2024

Just to be clear, by breadcrumb components you mean the Projects / Applications part? What specific dynamic segments are you referring to?

That is correct I mean the Projects / Application part - the missing part is the Projects / :projectId / Applications as shown in the URL in the screenshot.

I also wanted to clarify as to how you got to the projects route, did you make that route yourself or load it from somewhere else because i don't see it listed as one of the routes in the repo.

Yes, it is not the repo examples, in fact there is no example with dynamic paths. See my resources:

  createResource("projects", {
    meta: {
      hide: true
     // --- SNIP ---
    },
  }),
  createResource("applications", {
    meta: {
      // --- SNIP ---
      hide: true,
      parent: "projects"
    },
  }),

In short, the don't seem to parse dynamic segments like :projectId and the documentation has no information about that.

@alicanerdurmaz
Copy link
Member

Hello @aress31

If I understood correctly, you want to see the applications of the selected project. For example, this
/projects/1/applications/show/2 means displaying the application with ID 2 for the project with ID 1. Additionally, you want a link in the breadcrumb to navigate to the details of the project with ID 1. Did I get that right?

Projects > Project #1 > Applications > Show
image

This way, you can navigate to the selected project's details directly from the breadcrumb. Is this what you had in mind?

@aress31
Copy link
Author

aress31 commented Dec 18, 2024

@alicanerdurmaz exactly what I want and what I would expect the breadcrumb to do. :)

Is there a way to make it work as it is now? Haven't found a solution in the doc and digging the code, it seems that this is not supported as it is not parsing URL params to replace placeholders like :projectId.

@alicanerdurmaz
Copy link
Member

There is no way to do that right now. I wrote hard-coded code to explain the feature.

We need to implement this on useBreadcrumb hook.

Our hands are full with other tasks, but we're always open to PRs 🙌

@darshan-mundra-08
Copy link

Is there a data stored in relation to the unique uuid in the URL? Eg: some readable name to be shown in the breadcrumb area? from where we can extract the readable name from the uuid and show it there in the breadcrumb

@aress31
Copy link
Author

aress31 commented Dec 19, 2024

@darshan-mundra-08 should be define in resource routes? Can we make parent accept strings like ":projectId"?

@darshan-mundra-08
Copy link

@aress31 No, Its not important that it should be in the source resource routes? the data should be defined anywhere in the project whose variable are accessible to the breadcrumb component.

@ShashankGupta10
Copy link

Can I work on this guys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants