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

Fix ui preview with multiple discover strategies and endpoints #413

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

matteofigus
Copy link
Member

@matteofigus matteofigus commented Mar 22, 2017

Fixes #369

More in details, here is the reproduction steps.

  • We have 2 instances of the registry:
    • my-registry.mycorpintranet.com is a private instance with discovery: true (the UI is accessible)
    • my-registry.mycompany.com is a public instance with discovery: false
    • private instance has baseUrl configured to my-registry.mycompany.com (public) in order to allow client-side rendering failover/nested rendering

Currently, when accessing the private instance's UI on a component page, preview's Iframe URL is set to ~preview, which works, but the URL on the preview bar is set on baseURL, which means hitting Refresh is gonna hit the public url with discovery: false, and the preview is not gonna be visible.

With this fix, we set the URL on the preview bar based on the current host, which means hitting Refresh is gonna hit the correct page with discovery: true.

I tested this locally by using some host entries and it works fine.
/cc @mattiaerre @chriscartlidge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OC-Registry: Preview Panel outputs JSON instead of a HTML preview.
2 participants