Skip to content

Commit

Permalink
Add back the 'When' prefix for file-based script trigger titles (#2360)
Browse files Browse the repository at this point in the history
Fix regression from #2352.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
  • Loading branch information
jimtng authored Feb 16, 2024
1 parent 18db55d commit 02317ea
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,13 @@ export default {
let triggerDescriptionComments = `${commentChar} Triggers:\n`
for (const trigger of this.rule.triggers) {
const triggerModuleType = this.moduleTypes.triggers.find((t) => t.uid === trigger.type)
triggerDescriptionComments += `${commentChar} - ${this.suggestedModuleTitle(trigger, triggerModuleType, 'trigger')}\n`
let description = this.suggestedModuleTitle(trigger, triggerModuleType, 'trigger')
if (triggerModuleType.uid === 'timer.GenericCronTrigger') {
description = description.charAt(0).toUpperCase() + description.slice(1)
} else {
description = 'When ' + description
}
triggerDescriptionComments += `${commentChar} - ${description}\n`
}
this.script = triggerDescriptionComments + '\n' + this.script
}
Expand Down

0 comments on commit 02317ea

Please sign in to comment.