Fix crawl scope help text (#1169)

* update text

* remove trailing slash removal

* make scope help text responsive as user types

---------

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
This commit is contained in:
sua yoo 2023-09-13 11:46:58 -07:00 committed by GitHub
parent 9159c7c914
commit 6234346d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -954,7 +954,7 @@ https://example.com/path`}
}
const exampleHost = exampleUrl.host;
const exampleProtocol = exampleUrl.protocol;
const examplePathname = exampleUrl.pathname.replace(/\/$/, "");
const examplePathname = exampleUrl.pathname;
const exampleDomain = `${exampleProtocol}//${exampleHost}`;
let helpText: TemplateResult | string;
@ -966,7 +966,10 @@ https://example.com/path`}
<span class="text-blue-500 break-word break-word"
>${exampleDomain}</span
><span class="text-blue-500 font-medium break-word"
>/path/page-2</span
>${examplePathname.slice(
0,
examplePathname.lastIndexOf("/")
)}/</span
>`
);
break;
@ -1028,6 +1031,12 @@ https://example.com/path`}
@sl-input=${async (e: Event) => {
const inputEl = e.target as SlInput;
await inputEl.updateComplete;
this.updateFormState(
{
primarySeedUrl: inputEl.value,
},
true
);
if (!inputEl.checkValidity() && validURL(inputEl.value)) {
inputEl.setCustomValidity("");
inputEl.helpText = "";