Skip to content

Commit

Permalink
only include counts after pipeline names if there is more than one in…
Browse files Browse the repository at this point in the history
…stance
  • Loading branch information
NickAkhmetov committed Oct 8, 2024
1 parent c52954b commit c981781
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ it('checks if dataset is published', () => {
it('counts pipelines and their occurrences', () => {
const { pipelinesText, pipelineCountsText } = usePipelineCountsInfo(testDatasets.map((dataset) => dataset._source));
expect(pipelinesText).toBe('Pipelines (2)');
expect(pipelineCountsText).toBe('Cytokit + SPRM (2), Segmentation Mask (1)');
expect(pipelineCountsText).toBe('Cytokit + SPRM (2), Segmentation Mask');
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function usePipelineCountsInfo(datasets: Pick<ProcessedDatasetInfo, 'pipe
);
const pipelinesText = `Pipelines (${Object.keys(pipelineCounts).length})`;
const pipelineCountsText = Object.entries(pipelineCounts)
.map(([pipeline, count]) => `${pipeline} (${count})`)
.map(([pipeline, count]) => (count > 1 ? `${pipeline} (${count})` : pipeline))
.join(', ');

return {
Expand Down

0 comments on commit c981781

Please sign in to comment.