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

Embed applications #1

Open
CaroleSinou opened this issue Apr 18, 2023 · 7 comments
Open

Embed applications #1

CaroleSinou opened this issue Apr 18, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@CaroleSinou
Copy link
Collaborator

Describe the solution you'd like
On the current Canadensys website, three tools are embedded within pages (https://data.canadensys.net/tools/coordinates, https://data.canadensys.net/tools/dates and https://data.canadensys.net/vascan/search).
Is it possible to embed these tools within the jekyll portal?
If so, is there documentation or examples to explain how it works?

Describe alternatives you've considered
If this is not a possibility, we could keep the current Canadensys pages for each tools, but we will need to modify the layout in order to keep the overall look and links to other content within the portal.

@CaroleSinou CaroleSinou added the enhancement New feature or request label Apr 18, 2023
@thomasstjerne
Copy link

Hi @CaroleSinou
It is possible to embed tools, and for tools that depend on backend services (like the vascan search) it is the only option.
There is and example of a hosted portal page with an embedded tool here: https://legume.hp.gbif-staging.org/phylogeny-explorer/
And this is how it is embedded using an iFrame:
https://raw.githubusercontent.com/gbif/hp-legume/4a7783146177154c4f675ddbee6683d0ee3e7593/phylogeny-explorer.md

@CaroleSinou
Copy link
Collaborator Author

Hi @thomasstjerne,

That's perfect!
Now, I need to find the sources for the apps themselves.
For now, I've used the curent pages on Canadensys as sources, but obviously it is not what I want.

@MortenHofft
Copy link
Member

I've just looked at your tools. iframes are probably not the most natural way to do this I would say. It could work, but since you have an API for all those tools, it is more natural to have a little javascript that use the API. But of course it will require someone with developer experience to do so. The tools aren't iframes currently either

@CaroleSinou
Copy link
Collaborator Author

@MortenHofft, I'm continuing the thread instead of creating a new issue.

Question: How to integrate our Conversion tools (coordinates and dates) using the API.

I have tried a few things, based on tutorials available online, but it is obviously not working.
I have insert a script in /tools/date-parsing.md, but I am not able to visualize anything on the page (probably because I have not done anything to visualize it...).

Are you aware of a resource I can use to learn how to use the API in that case?
Or can you help me do it for the date and I will do it later for the coordinates?

Thanks!

@MortenHofft
Copy link
Member

MortenHofft commented Aug 30, 2023

If you are not familiar with coding, then I would think it was too large a starting project to implement this all over.
I assumed that there might be a software developer that could help with it.

The reason that what you have is failing is because the API isn't designed to be used by the browser. It doesn't have the required CORS headers. Essentially your API forbids anyone from using it from the browser.

Access to fetch at 'https://data.canadensys.net/tools/dates.json' from origin 'https://canadensys.hp.gbif-staging.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I've created a simple iframe version as you can see here https://canadensys.hp.gbif-staging.org/tools/date-parsing/
Clearly that would require that you kept hosting/maintaining such a page, and that you removed menu, sidebars etc. So that it was just the tool.

@CaroleSinou
Copy link
Collaborator Author

Thanks Morten.
In my last discussion with Jérémy, he was not sure he would have time to work on the API.
The iframe is, in my view, a good idea, but I (or Jérémy) will need to modify the layout of the page to remove/modify the header and footer, as well as removing the menu on the right.
The only issue I see is that this page is currently live, and I will need to have a test page to work on.
I'll ask Jérémy if he can do something to help me with that.

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

No branches or pull requests

3 participants