collective / volto-hydra

A volto addon to let you edit content in realtime when you have many frontends written in any framework
2 stars 4 forks source link

I can click on an external url and it will not load inside the iframe #94

Closed djay closed 4 months ago

djay commented 4 months ago

maybe as new tab? but should mimic the behaviour of normal volto

djay commented 4 months ago

@MAX-786 its a worse bug than I thought.

if you click on the hydra.pretagov.com url in the frontpage you get

Image

and it seems to remember it because a reload gets the same thing

MAX-786 commented 4 months ago

One fix as discussed, is that telling integrator to hook into the onRouteChange(path) which will tell adminUI where to navigate, and all the other links in the frontend will do no change in adminUI and links will be opened as usual (its upto frontend if it wants to open in new tab or in the same tab ie iframe).

So something like this needs to be done by integrator if they want the routing in adminUI via iframe:

    <SemanticMenu.Item
      as={Link}
      href={absoluteUrl}
      onClick={() => {
        bridge.onRouteChange(extractEndpoints(item["@id"])); // extractEndpoints(item["@id"]) -> pathname
      }}>
      {item.title}
    </SemanticMenu.Item>
djay commented 4 months ago

If the user clicks on an external link inside the IFrame then hydra already knows about it. There is no extra hooks needed. Just exit out of the editor and replace it with the url that was clicked

On Fri, 5 July 2024, 7:23 pm Mohammad K. Hussain, @.***> wrote:

One fix as discussed, is that telling integrator to hook into the onRouteChange(path) which will tell adminUI where to navigate, and all the other links in the frontend will do no change in adminUI and links will be opened as usual (its upto frontend if it wants to open in new tab or in the same tab ie iframe).

So something like this needs to be done by integrator if they want the routing in adminUI via iframe:

<HoverableDropdown
  item={item}
  subItems={subItems}
  onClick={() => {
    ***@***.***"])); // ***@***.***"]) -> pathname
  }}
/>

— Reply to this email directly, view it on GitHub https://github.com/collective/volto-hydra/issues/94#issuecomment-2210782698, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKFZBN7CJREGUEOJDM2Z3ZK2F2LAVCNFSM6AAAAABKMOK5BKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQG44DENRZHA . You are receiving this because you authored the thread.Message ID: @.***>