0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Prevented linking to GitHub for pre-releases

- if we're running a pre-release, we haven't released it on GitHub so
  Admin shouldn't provide a link to it
- instead of pulling in `semver`, I've just gone for the simpler method
  of looking for the pre-release string identifier
This commit is contained in:
Daniel Lockyer 2022-08-09 08:30:02 +02:00
parent db86e21512
commit 1d06439633
No known key found for this signature in database
GPG key ID: D21186F0B47295AD
2 changed files with 10 additions and 0 deletions

View file

@ -13,6 +13,12 @@ export default class WhatsNewController extends Controller {
return date.getFullYear();
}
get linkToGitHubReleases() {
// Don't link to GitHub Releases if the version contains the
// pre-release identifier
return !this.config.get('version').includes('-pre.');
}
get showSystemInfo() {
const isPro = !!this.config.get('hostSettings')?.siteId;

View file

@ -50,7 +50,11 @@
{{/if}}
<ul class="gh-env-list">
{{#if this.linkToGitHubReleases}}
<li><strong>Version:</strong> <a href="https://github.com/TryGhost/Ghost/releases/tag/v{{this.config.version}}" target="_blank" rel="noopener noreferrer">{{this.config.version}}</a></li>
{{else}}
<li><strong>Version:</strong> {{this.config.version}}</li>
{{/if}}
{{#if this.showSystemInfo}}
<li><strong>Environment:</strong> <span class="ttc">{{this.config.environment}}</span></li>
<li class="gh-env-list-database-type"><strong>Database:</strong> {{this.config.database}}</li>