GithubHelp home page GithubHelp logo

Comments (5)

mrpmorris avatar mrpmorris commented on June 10, 2024 1

Sorry for the delayed response, life got in the way!

Could put the details of the problem into the ticket, please? I don't know what is wrong with the current code.

Could you please also add one or more unit tests?

from fluxor.

mrpmorris avatar mrpmorris commented on June 10, 2024 1

Thank you, I appreciate your contribution and your patience!

from fluxor.

mrpmorris avatar mrpmorris commented on June 10, 2024 1

I don't know what unit tests you can add. I usually look at the unit tests to understand the purpose of the code.

I'm putting together V6 at the moment, don't miss out :)

from fluxor.

dmitry-pavlov avatar dmitry-pavlov commented on June 10, 2024

I added that to handle routes Uri links as Uri links rather than as strings. Reason was the links with #fragments if I remember right.

As for the unit tests, sure, I will have a look what I can add. Perhaps, this weekend. Thanks!

from fluxor.

dmitry-pavlov avatar dmitry-pavlov commented on June 10, 2024

Hey @mrpmorris Sorry for delay. I got stuck figuring out what kind of test it could be... Any ideas are welcome.

Let me put some light on the reason why I needed that. Maybe it would be enough to merge this PR.

Blazor can't handle routes with fragments out of the box https://chrissainty.com/fragment-routing-with-blazor/

Saying fragments, I mean those URI Fragment part of anchor links to jump to a specific part of a page like this below:

<a href="#anchor-name">Jump to the part of the page with the “anchor-name” id </a>

In the app I am working on I have a page with tabs, which are handled by Blazor and use Fluxor.Blazor.Web.Middlewares.Routing.GoAction and routing middleware to navigate between tabs, and identify the which NavLink is active at the moment (to highlight on UI). In addition to that I have on-page navigation with "fragments" pointing to some element IDs on the page. I am trying to reduce using NavigationManager directly and instead - use routing middleware to handle in app navigation. So all navigation (without force page reloading and with it (when needed) is built on top of Fluxor.Blazor.Web.Middlewares.Routing classes.

To check if the route is the same in HandleGoActionAsync you just strings from NavigationManager.Uri and let it be navigated if the strings are different. For links with URI fragment it could a bit be more sophisticated if UrlComparer would sompare URIs rather than strings.

Please let me know what sort of test I could add for this PR, or feel free to merge the PR. Thanks!

from fluxor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.