Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 12, 2021
1 parent e815635 commit 2c6240a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/combination/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// - The sorting order of combinations in reporters
// - The order of dimensions when printing combinationName in reporters,
// previews and `dev`
export const COMBINATION_DIMENSIONS = [
export const DIMENSIONS = [
{
dimension: 'task',
idName: 'taskId',
Expand All @@ -30,9 +30,7 @@ export const COMBINATION_DIMENSIONS = [

// Dimensions created by users, not by plugins
const getUserDimensions = function () {
return new Set(
COMBINATION_DIMENSIONS.filter(isUserDimension).map(getDimensionName),
)
return new Set(DIMENSIONS.filter(isUserDimension).map(getDimensionName))
}

const isUserDimension = function ({ createdByUser }) {
Expand Down
6 changes: 3 additions & 3 deletions src/combination/ids.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { titleColor, noteColor } from '../report/utils/colors.js'

import { COMBINATION_DIMENSIONS, USER_DIMENSIONS } from './dimensions.js'
import { DIMENSIONS, USER_DIMENSIONS } from './dimensions.js'
import { getInputIds } from './inputs.js'

export const isSameDimension = function (combinationA, combinationB) {
return COMBINATION_DIMENSIONS.every(
return DIMENSIONS.every(
({ idName }) => combinationA[idName] === combinationB[idName],
)
}
Expand Down Expand Up @@ -34,7 +34,7 @@ const titleize = function (string) {
}

const getIdInfos = function (combination) {
return COMBINATION_DIMENSIONS.map(getIdInfo.bind(undefined, combination))
return DIMENSIONS.map(getIdInfo.bind(undefined, combination))
}

const getIdInfo = function (combination, { dimension, idName }) {
Expand Down
4 changes: 2 additions & 2 deletions src/combination/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sortOn from 'sort-on'
import { getMean } from '../stats/sum.js'
import { groupBy } from '../utils/group.js'

import { COMBINATION_DIMENSIONS } from './dimensions.js'
import { DIMENSIONS } from './dimensions.js'

// Sort `result.combinations` based on their `stats.mean`.
// Combinations with the same dimension are grouped together in the sorting
Expand All @@ -17,7 +17,7 @@ import { COMBINATION_DIMENSIONS } from './dimensions.js'
// - Variations being runner-specific
// - Those should be filtered out, as opposed to showing empty rows|columns
export const sortCombinations = function (result) {
const sortFunctions = COMBINATION_DIMENSIONS.map(({ idName }) =>
const sortFunctions = DIMENSIONS.map(({ idName }) =>
getSortFunction(idName, result.combinations),
)
const combinations = sortOn(result.combinations, sortFunctions)
Expand Down
4 changes: 2 additions & 2 deletions src/report/normalize/titles_add.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { COMBINATION_DIMENSIONS } from '../../combination/dimensions.js'
import { DIMENSIONS } from '../../combination/dimensions.js'

import { padTitles } from './titles_pad.js'

Expand All @@ -13,7 +13,7 @@ export const addCombinationsTitles = function (result, titles, showTitles) {
}

const addCombinationTitles = function (combination, titles) {
return COMBINATION_DIMENSIONS.reduce(
return DIMENSIONS.reduce(
(combinationA, { idName, titleName }) =>
addTitle(combinationA, { idName, titleName, titles }),
combination,
Expand Down
6 changes: 3 additions & 3 deletions src/report/normalize/titles_pad.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { COMBINATION_DIMENSIONS } from '../../combination/dimensions.js'
import { DIMENSIONS } from '../../combination/dimensions.js'

// Add:
// - `combination.task|runner|systemTitlePadded`: like
Expand All @@ -11,8 +11,8 @@ export const padTitles = function (combinations) {
}

const getUniqueTitleNames = function (combinations) {
const titleNames = COMBINATION_DIMENSIONS.map(getTitleName).filter(
(titleName) => shouldShowProp(titleName, combinations),
const titleNames = DIMENSIONS.map(getTitleName).filter((titleName) =>
shouldShowProp(titleName, combinations),
)
return titleNames.length === 0 ? DEFAULT_TITLE_NAMES : titleNames
}
Expand Down

0 comments on commit 2c6240a

Please sign in to comment.