Skip to content

Commit

Permalink
fix: fix issue with wrong repo_name in links to github
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
  • Loading branch information
meteyou committed Jul 29, 2023
1 parent 288a9e0 commit 320c8f7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/components/panels/Machine/UpdatePanel/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,12 @@ export default class UpdatePanelEntry extends Mixins(BaseMixin) {
return semver.gt(this.remoteVersion, this.localVersion)
}
get repo_name() {
return this.repo.repo_name ?? this.repo.name ?? ''
}
get webLinkRelease() {
return `https://github.com/${this.repo.owner}/${this.repo.name}/releases/tag/${this.repo.remote_version}`
return `https://github.com/${this.repo.owner}/${this.repo_name}/releases/tag/${this.repo.remote_version}`
}
get hideUpdateWarning() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ export default class GitCommitsListDayCommit extends Mixins(BaseMixin) {
})
}
get repo_name() {
return this.repo.repo_name ?? this.repo.name ?? ''
}
get commitHref() {
return `https://github.com/${this.repo.owner}/${this.repo.name}/commit/${this.commit.sha}`
return `https://github.com/${this.repo.owner}/${this.repo_name}/commit/${this.commit.sha}`
}
get commitShortSha() {
Expand Down
8 changes: 6 additions & 2 deletions src/components/panels/Machine/UpdatePanel/UpdateHintAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ export default class UpdateHintAlert extends Mixins(BaseMixin) {
return null
}
get repo_name() {
return this.repo.repo_name ?? this.repo.name ?? ''
}
get externalLink() {
if (this.name === 'klipper') return '//www.klipper3d.org/Config_Changes.html'
if (this.name === 'moonraker') return '//moonraker.readthedocs.io/en/latest/changelog/'
if (this.repo?.configured_type === 'web')
return `//github.com/${this.repo.owner}/${this.repo.name}/releases/tag/${this.repo.remote_version}`
return `//github.com/${this.repo.owner}/${this.repo_name}/releases/tag/${this.repo.remote_version}`
return `//github.com/${this.repo.owner}/${this.repo.name}`
return `//github.com/${this.repo.owner}/${this.repo_name}`
}
get externalLinkText() {
Expand Down
1 change: 1 addition & 0 deletions src/store/server/updateManager/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface ServerUpdateManagerStateGitRepoCommit {

export interface ServerUpdateManagerStateGitRepo {
name: string
repo_name?: string
configured_type: string
detected_type?: string
channel?: string
Expand Down

0 comments on commit 320c8f7

Please sign in to comment.