Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

FS-4357: Letting users input https:// in website field #532

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class WebsiteField extends TextField {
this.formSchema = this.formSchema
.label(def.title)
.pattern(
/^(www\.)?[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/
/^(https?:\/\/)?(www\.)?[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/
)
.message(def.options?.customValidationMessage ?? this.defaultMessage);

Expand Down
2 changes: 1 addition & 1 deletion runner/src/server/views/partials/summary-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% for itemValue in item.value%}
{{itemValue}}<br>
{% endfor %}
{% elif item.type == 'NumberField' or item.type == 'WebsiteField' %}
{% elif item.type == 'NumberField' or item.type == 'WebsiteField' and not ( 'https://' in item.value or 'http://' in item.value ) %}
{{item.prefix}}{{item.value}}
{% elif item.type == 'ClientSideFileUploadField' %}
{% if item.value.files|length == 0 %}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.1.267
VERSION=0.1.268
Loading