noi-techpark / opendatahub-website

0 stars 5 forks source link

As a customer I would like to see a webcomponents name in the URL and not an ID #174

Closed LucaMiotto closed 1 year ago

LucaMiotto commented 1 year ago

Web components in the webcomponent store have very long IDs no one can remember, for example:

https://webcomponents.opendatahub.com/webcomponent/74248fd5-f768-4c77-9acd-2d90d568c2e1

It would be nicer to have an alias such as:

https://webcomponents.opendatahub.com/webcomponent/carsharing

Original issue: https://github.com/noi-techpark/opendatahub-customer-care/issues/58

dulvui commented 1 year ago

@LucaMiotto @mrabans I created now aliases on testing under testing: https://webcomponents.opendatahub.testingmachine.eu/tag/flightmap https://webcomponents.opendatahub.testingmachine.eu/tag/carsharing

Since in the database there currently is no tag like flightmap defined, I'm using the search function of the webcomponents API that then returns the first element that matches the string in the URL after tag/. For now it is just a PoC, because this approach can have problems, if multiple webcomponents are found. So the link could redirect to another webcomponent if in future another webcomponent has the text 'flightmap' in the title, description or repository url.

I will try to find a way to create a unique tag name on database level, that will be used for his use case.

mrabans commented 1 year ago

@dulvui sounds good. Kind of similar Github and Gitlab are doing. They allow aliases and even renaming by inserting then a permanent redirect. As long as the user doesn't create another repository with the same old name. In that case this newly created repository has precedence.

dulvui commented 1 year ago

@mrabans @LucaMiotto The changes are now life in production and now the uuid can be replaced with a short name like here https://webcomponents.opendatahub.com/webcomponent/carsharing But the old links with uuid still work and so both uuid and shortname work. In the homepage in the list the shortname gets used automatically if set, so in future all links will always use the short name in the URL https://webcomponents.opendatahub.com/

In the URL of the webcomponent in the codesnippet, to include it on a website, only the uuid will be used.

mrabans commented 1 year ago

very cool! thanks