geovistory/design-system

Entity URI and Links in header

Closed this issue · 1 comments

In geov-entity

I see a challenge:

Currently, the component geov-entity is not aware of a project id.

Currently, the project entity pages of the website pass in the URI regex and replace props in order to add ?p=123 to the links. But the URI regex and replace are also used in dev/stag to convert http://geovistory.org/resource/i123 to http://dev.geovistory.org/resource/i123?p=123.

I propose to add another @prop() to geov-entity:

  • projectId?: number

If the projectId is set, the header has both links.

The "Project Link" can be the one generated by URI regex/replace.
The "URI" should be the one generated by URI regex/replace minus ?p={projectId}.

Example 1
input:

output:
URI: http://dev.geovistory.org/resource/i918611 | Project Link: http://dev.geovistory.org/resource/i918611?p=123

Example 2
input:

  • projectId = undefined

output:
URI: http://geovistory.org/resource/i918611