mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Allow .git end to miss from Git repo URL (#18092)
When installing private themes and theme components, the public key does not show until the administrator types a valid Git repo URL. The regular expression that checked the URL was too strict and it required the URL to end with ".git".
This commit is contained in:
parent
1ed4442c10
commit
daa3f96d54
@ -24,7 +24,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
keyGenUrl: "/admin/themes/generate_key_pair",
|
||||
importUrl: "/admin/themes/import",
|
||||
recordType: "theme",
|
||||
checkPrivate: match("uploadUrl", /^ssh\:\/\/.*\@.*\.git$|.*\@.*\:.*\.git$/),
|
||||
checkPrivate: match("uploadUrl", /^ssh:\/\/.+@.+$|.+@.+:.+$/),
|
||||
localFile: null,
|
||||
uploadUrl: null,
|
||||
uploadName: null,
|
||||
|
@ -79,6 +79,15 @@ acceptance("Admin - Themes - Install modal", function (needs) {
|
||||
|
||||
await fillIn(urlInput, "git@github.com:discourse/discourse.git");
|
||||
assert.ok(query(publicKey), "shows public key for valid github repo url");
|
||||
|
||||
await fillIn(urlInput, "git@github.com:discourse/discourse");
|
||||
assert.ok(query(publicKey), "shows public key for valid github repo url");
|
||||
|
||||
await fillIn(urlInput, "git@github.com/discourse/discourse");
|
||||
assert.notOk(
|
||||
query(publicKey),
|
||||
"does not shows public key for valid github repo url"
|
||||
);
|
||||
});
|
||||
|
||||
test("modal can be auto-opened with the right query params", async function (assert) {
|
||||
|
Loading…
Reference in New Issue
Block a user