Refactor conditionsHint function in JunctionChain component for improved readability
Updated the conditionsHint function to enhance code clarity by adjusting the formatting of the conditional statement that processes dayparts. This change improves maintainability and aligns with best practices for code structure.
This commit is contained in:
@@ -46,7 +46,8 @@ function conditionsHint(element: JunctionElementDto, t: Translate) {
|
|||||||
if (c && c.minMinutesBetween > 0)
|
if (c && c.minMinutesBetween > 0)
|
||||||
parts.push(t('admin.junctions.badgeInterval', { minutes: c.minMinutesBetween }))
|
parts.push(t('admin.junctions.badgeInterval', { minutes: c.minMinutesBetween }))
|
||||||
if (c?.timeWindow) parts.push(`${c.timeWindow.from.slice(0, 5)}–${c.timeWindow.to.slice(0, 5)}`)
|
if (c?.timeWindow) parts.push(`${c.timeWindow.from.slice(0, 5)}–${c.timeWindow.to.slice(0, 5)}`)
|
||||||
if (c?.dayparts?.length) parts.push(c.dayparts.map((d) => t(`admin.channels.dayparts.${d}`)).join('/'))
|
if (c?.dayparts?.length)
|
||||||
|
parts.push(c.dayparts.map((d) => t(`admin.channels.dayparts.${d}`)).join('/'))
|
||||||
return parts.join(' · ')
|
return parts.join(' · ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user