Pins name fixed and tested

This commit is contained in:
barsdeveloper
2023-04-02 16:31:45 +02:00
parent f841b890a2
commit 80345543a9
8 changed files with 122 additions and 50 deletions

View File

@@ -337,10 +337,10 @@ export default class Utility {
.replace(/^\s*b/, "")
// Insert a space where needed, possibly removing unnecessary elading characters
.replaceAll(Configuration.nameRegexSpaceReplacement, " ")
.trim()
.split(" ")
.map(v => Utility.capitalFirstLetter(v))
.join(" ")
.trim()
}
/** @param {String} value */

View File

@@ -211,15 +211,15 @@ export default class PinEntity extends IEntity {
getDisplayName() {
let matchResult = null
if (this.PinFriendlyName) {
return Utility.formatStringName(this.PinFriendlyName.toString())
}
if (
this.PinToolTip
// Match up until the first \n excluded or last character
&& (matchResult = this.PinToolTip.match(/\s*(.+?(?=\n)|.+\S)\s*/))
) {
return Utility.formatStringName(matchResult[1])
return matchResult[1]
}
if (this.PinFriendlyName) {
return Utility.formatStringName(this.PinFriendlyName.toString())
}
return Utility.formatStringName(this.PinName)
}