Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Adjust regex pattern for changelog dialog #3129

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
### Fixed 🐞

- Fix crashing on focusing or hovering un-rendered buildings [#3123](https://github.com/MaibornWolff/codecharta/pull/3123)
- Fix showing changelog entries in the dialog when a new version is available [#3123](https://github.com/MaibornWolff/codecharta/pull/3129)

### Chore 👨‍💻 👩‍💻

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class ChangelogDialogComponent {
let changelogLines = markdownFile.split("\n")
const currentVersionFirstLine = this.findVersionLine(changelogLines, this.data.currentVersion)
const lastOpenedVersionFirstLine = this.findVersionLine(changelogLines, this.data.previousVersion)

//Add 1 to keep the version line so that it detects the end of the last set of changes
changelogLines = changelogLines.slice(currentVersionFirstLine, lastOpenedVersionFirstLine + 1)
const titles = ["Added 🚀", "Fixed 🐞", "Changed", "Removed 🗑", "Chore 👨‍💻 👩‍💻"]
Expand Down Expand Up @@ -47,7 +46,7 @@ export class ChangelogDialogComponent {
}

private findVersionLine(lines: string[], version: string): number {
const versionPattern = new RegExp(version.replace(".", "\\."))
const versionPattern = new RegExp(`\\[${version}]`)
return lines.findIndex(element => versionPattern.test(element))
}

Expand Down