in src/app/agile-board-widget.js [284:388]
renderWidgetBody(agile, sprint) {
if (!agile || !sprint) {
return this.renderLoadDataError();
}
const boardData = sprint.board;
const boardProgressBars = countBoardProgress(boardData);
const progressBarWrapperStyle = {
height: `${MAX_PROGRESS_BAR_HEIGHT}px`
};
const tooltipHeight = 40;
const plotWidthPercents = 100;
const progressBarCSSWidthValue = `calc(${plotWidthPercents / boardProgressBars.length}% - 8px)`;
const progressBarStyle = {
height: `${MAX_PROGRESS_BAR_HEIGHT}px`,
width: progressBarCSSWidthValue
};
const getProgressDataClassName = progressBarData => classNames(
{
[styles.sprintProgressData]: true,
[styles.sprintProgressDataOverdue]: progressBarData.overdue
}
);
const homeUrl = this.state.youTrack.homeUrl;
const getColumnUrl = columnId => {
const column = (boardData.columns || []).
filter(currentColumn => currentColumn.id === columnId)[0];
if (!column) {
return '';
}
const searchUrl = getColumnSearchUrl(
agile, sprint, column
);
return `${homeUrl}issues?q=${searchUrl}`;
};
return (
<div className={styles.widget}>
{
sprint.goal &&
(
<div className={styles.sprintCommonInfo}>
{sprint.goal}
</div>
)
}
<div className={styles.sprintCommonInfo}>
<b>{i18n('Owner:')}</b>
<SmartUserCardTooltip userDataSource={this.loadAgileOwner}>
<Link
href={`${homeUrl}users/${agile.owner.ringId}`}
>
{agile.owner.fullName}
</Link>
</SmartUserCardTooltip>
</div>
<div
className={styles.sprintProgress}
style={progressBarWrapperStyle}
>
{
boardProgressBars.map(boardProgressBar => (
<Link
key={`link-${boardProgressBar.columnId}`}
href={getColumnUrl(boardProgressBar.columnId)}
>
<Tooltip
key={`tooltip-${boardProgressBar.columnId}`}
popupProps={{top: -(MAX_PROGRESS_BAR_HEIGHT + tooltipHeight)}}
title={boardProgressBar.title}
>
<span
key={`bar-${boardProgressBar.columnId}`}
className={styles.sprintProgressBar}
style={progressBarStyle}
>
<span
key={`data-${boardProgressBar.columnId}`}
className={getProgressDataClassName(boardProgressBar)}
style={{height: `${boardProgressBar.height}px`}}
/>
</span>
</Tooltip>
</Link>
))
}
</div>
<div>
{
boardProgressBars.map(boardProgressBar => (
<span
key={`bar-label-${boardProgressBar.columnId}`}
className={styles.sprintProgressBarLabel}
style={{width: progressBarCSSWidthValue}}
>
{boardProgressBar.columnName}
</span>
))
}
</div>
</div>
);
}