Content
Updated by Oliver Günther 10 days ago
**As** an OpenProject user
**I want** to be able to add a link to a custom field type text
**in order to** quickly link to a page.
**Acceptance criteria**
* New custom field type "Link (URL)" "URL" in the administration settings.
* The Link URL type has an optional attribute "Regexp" that allows to restrict what URLs/schemes/etc. can be entered with a regex
* The Link URL type can be marked as required
* The Link URL type can have a default value
* The Link URL type can be marked for all projects (possibly bound to change with the changes in the project selection)
* In the work package screen
* When empty, there is a placeholder icon with "op-link-add" icon (link icon with a plus)
* When present, the URL is shown and an icon beside it
* IF possible: Clicking the "op-icon-edit" (to be created) icon will open the field empty
* IF NOT possible: Clicking a pencil icon (tbd) will open the field as is with the URL value filled
* Entering a parseable link URL will be accepted
* additional regex validation will take place if configured
* open: How flexible do we want URLs to be parsed. e.g., is \`mailto:foo@example.com\` valid? It is a valid URI.
* open: auto-parse URLs like `community.openproject.org`
* Entering an invalid or unparseable URL
* will result in the field being marked as error
* a toast validation message is shown "<field name> is not a valid URL."
* Entering a URL that does not match the regexp
* will result in the field being marked as error
* a toast validation message is shown "<field name> is invalid." consistent with other regex custom field validation messages
* Clicking on the link opens the target
* If the link is on the same host, in the same window
* If the link is on another host, in a new window (compliance behavior for external links, to be later changed to "external link warning")
**Visuals and Figma**
https://www.figma.com/file/oTMDTvcwrx35qExTkkSKBn/Custom-fields?type=design&node-id=624-13975&mode=design
**I want** to be able to add a link to a custom field type text
**in order to** quickly link to a page.
**Acceptance criteria**
* New custom field type "Link (URL)"
* The Link
* The Link
* The Link
* The Link
* In the work package screen
* When empty, there is a placeholder icon with "op-link-add" icon (link icon with a plus)
* When present, the URL is shown and an icon beside it
* IF possible: Clicking the "op-icon-edit" (to be created) icon will open the field empty
* IF NOT possible: Clicking a pencil icon (tbd) will open the field as is with the URL value filled
* Entering a parseable link
* additional regex validation will take place if configured
* open: How flexible do we want URLs to be parsed. e.g., is \`mailto:foo@example.com\` valid? It is a valid URI.
* open: auto-parse URLs like `community.openproject.org`
* Entering an invalid or unparseable URL
* will result in the field being marked as error
* a toast validation message is shown "<field name> is not a valid URL."
* Entering a URL that does not match the regexp
* will result in the field being marked as error
* a toast validation message is shown "<field name> is invalid." consistent with other regex custom field validation messages
* Clicking on the link opens the target
* If the link is on the same host, in the same window
* If the link is on another host, in a new window (compliance behavior for external links, to be later changed to "external link warning")
**Visuals and Figma**
https://www.figma.com/file/oTMDTvcwrx35qExTkkSKBn/Custom-fields?type=design&node-id=624-13975&mode=design