gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
9 stars 6 forks source link

Gbif React components #132

Closed siwelisabeth closed 3 years ago

siwelisabeth commented 3 years ago

The data page in the hosted portal uses a React component (https://react-components.gbif-staging.org/lib/gbif-react-components.js) to display occurences. We assume that the data set page uses such a component as well (https://hp-living-norway.gbif-staging.org/data?view=DATASETS).

Is it possible that you could make this code available? We are investigating different approaches for our portal and building upon the existing components could be an option. For example to extend the component to accep keywords as a filter when querying the api for datasets.

MortenHofft commented 3 years ago

The code is available here https://github.com/gbif/gbif-web but should be considered unstable and largely undocumented. But you are of course welcome to use what you can for any purpose.

For example to extend the component to accep keywords as a filter when querying the api for datasets.

That specific example isn't an option since it isn't a dataset search, but an aggregation of distinct datasets within an occurrence search. And the occurrence index do not contain dataset keywords.

MortenHofft commented 3 years ago

@siwelisabeth I feel like I'm not giving you the best help, but I'm not sure what you are aiming for. My contact info is https://www.gbif.org/contact-us/directory?personId=3785 if you would prefer to arrange a meeting.

siwelisabeth commented 3 years ago

@MortenHofft We are very happy with the help you are giving :-) For the first version of the portal, we probably will use plain javascript and a solution inspired by your example https://hp-theme.gbif-staging.org/example/dataset?key=492d63a8-4978-4bc7-acd8-7d0e3ac0e744 . In parallell we are exploring other possibilities for future versions, and it would be interesting to see how you have developed the data component in React. We'll keep in touch.

MortenHofft commented 3 years ago

Be aware that template literals have limited support so it will not work for 5% of your users (assuming global visitor distribution) https://caniuse.com/template-literals