export function getRuleRepositories(parameters: {
q: string;
}): Promise<Array<{ key: string; language: string; name: string }>> {
- return getJSON('api/rules/repositories', parameters).then(
+ return getJSON('/api/rules/repositories', parameters).then(
({ repositories }) => repositories,
throwGlobalError
);
});
const bottomPadding = verticalBuffer ? verticalBuffer * LINE_HEIGHT : undefined;
+ const blocksLoaded = duplicationsCount > 0;
// default is true
const displayOptions = displayLineNumberOptions !== false;
{displayDuplications && (
<LineDuplicationBlock
- blocksLoaded={duplicationsCount > 0}
- duplicated={Boolean(line.duplicated)}
+ blocksLoaded={blocksLoaded}
+ duplicated={!blocksLoaded ? Boolean(line.duplicated) : duplications.includes(0)}
index={0}
key={0}
line={this.props.line}
/>
)}
- {duplicationsCount > 1 &&
- times(duplicationsCount - 1, index => (
- <LineDuplicationBlock
- blocksLoaded={true}
- duplicated={duplications.includes(index + 1)}
- index={index + 1}
- key={index + 1}
- line={this.props.line}
- renderDuplicationPopup={this.props.renderDuplicationPopup}
- />
- ))}
+ {blocksLoaded &&
+ times(duplicationsCount - 1, index => {
+ return (
+ <LineDuplicationBlock
+ blocksLoaded={blocksLoaded}
+ duplicated={duplications.includes(index + 1)}
+ index={index + 1}
+ key={index + 1}
+ line={this.props.line}
+ renderDuplicationPopup={this.props.renderDuplicationPopup}
+ />
+ );
+ })}
{displayCoverage && (
<LineCoverage