FIX: render plugin's commit URL correctly and open in new window. (#22273)

Previously, the URLs are missed in the commit links in the version column. Follow up to: https://github.com/discourse/discourse/pull/22176
This commit is contained in:
Vinoth Kannan 2023-06-26 22:43:25 +05:30 committed by GitHub
parent 4bb4be958c
commit fa047d928d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,8 @@
{{#if this.commitHash}}
<a
href={{this.plugin.commit_url}}
href={{@plugin.commit_url}}
target="_blank"
rel="noopener noreferrer"
class="current commit-hash"
title={{this.commitHash}}
>{{this.shortCommitHash}}</a>

View File

@ -28,6 +28,9 @@ acceptance("Admin - Plugins", function (needs) {
enabled_setting: "testplugin_enabled",
has_settings: true,
is_official: true,
commit_hash: "1234567890abcdef",
commit_url:
"https://github.com/username/some-test-plugin/commit/1234567890abcdef",
},
],
})
@ -47,5 +50,11 @@ acceptance("Admin - Plugins", function (needs) {
exists(".admin-plugins .admin-container .alert-error"),
"displays an error for unknown routes"
);
assert.strictEqual(
table.querySelector("tr .version a.commit-hash").href,
"https://github.com/username/some-test-plugin/commit/1234567890abcdef",
"displays a commit hash with a link to commit url"
);
});
});