|
1 | 1 | import { ExperimentsOutput } from '../../../cli/reader' |
2 | | -import { collectColumns } from '../../../experiments/columns/collect' |
3 | | -import { collectExperiments } from '../../../experiments/model/collect' |
4 | | -import { copyOriginalColors } from '../../../experiments/model/status/colors' |
5 | | -import { TableData } from '../../../experiments/webview/contract' |
| 2 | +import { |
| 3 | + Column, |
| 4 | + ColumnType, |
| 5 | + TableData |
| 6 | +} from '../../../experiments/webview/contract' |
6 | 7 |
|
7 | 8 | export const deeplyNestedOutput: ExperimentsOutput = { |
8 | 9 | workspace: { |
@@ -70,13 +71,210 @@ export const deeplyNestedOutput: ExperimentsOutput = { |
70 | 71 | } |
71 | 72 | } |
72 | 73 |
|
73 | | -export const columns = collectColumns(deeplyNestedOutput) |
| 74 | +export const columns: Column[] = [ |
| 75 | + { |
| 76 | + hasChildren: true, |
| 77 | + name: 'params.yaml', |
| 78 | + parentPath: 'params', |
| 79 | + path: 'params:params.yaml', |
| 80 | + type: ColumnType.PARAMS |
| 81 | + }, |
| 82 | + { |
| 83 | + hasChildren: true, |
| 84 | + name: 'nested1', |
| 85 | + parentPath: 'params:params.yaml', |
| 86 | + path: 'params:params.yaml:nested1', |
| 87 | + type: ColumnType.PARAMS |
| 88 | + }, |
| 89 | + { |
| 90 | + hasChildren: false, |
| 91 | + maxStringLength: 15, |
| 92 | + name: 'doubled', |
| 93 | + parentPath: 'params:params.yaml:nested1', |
| 94 | + path: 'params:params.yaml:nested1.doubled', |
| 95 | + pathArray: ['params', 'params.yaml', 'nested1', 'doubled'], |
| 96 | + type: ColumnType.PARAMS, |
| 97 | + types: ['string'] |
| 98 | + }, |
| 99 | + { |
| 100 | + hasChildren: true, |
| 101 | + name: 'nested1.nested2.nested3.nested4', |
| 102 | + parentPath: 'params:params.yaml', |
| 103 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4', |
| 104 | + type: ColumnType.PARAMS |
| 105 | + }, |
| 106 | + { |
| 107 | + hasChildren: true, |
| 108 | + name: 'nested5', |
| 109 | + parentPath: 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4', |
| 110 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4.nested5', |
| 111 | + type: ColumnType.PARAMS |
| 112 | + }, |
| 113 | + { |
| 114 | + hasChildren: true, |
| 115 | + name: 'nested6', |
| 116 | + parentPath: |
| 117 | + 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4.nested5', |
| 118 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4.nested5.nested6', |
| 119 | + type: ColumnType.PARAMS |
| 120 | + }, |
| 121 | + { |
| 122 | + hasChildren: false, |
| 123 | + maxStringLength: 6, |
| 124 | + name: 'nested7', |
| 125 | + parentPath: |
| 126 | + 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4.nested5.nested6', |
| 127 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3%2Enested4.nested5.nested6.nested7', |
| 128 | + pathArray: [ |
| 129 | + 'params', |
| 130 | + 'params.yaml', |
| 131 | + 'nested1', |
| 132 | + 'nested2', |
| 133 | + 'nested3', |
| 134 | + 'nested4', |
| 135 | + 'nested5', |
| 136 | + 'nested6', |
| 137 | + 'nested7' |
| 138 | + ], |
| 139 | + type: ColumnType.PARAMS, |
| 140 | + types: ['string'] |
| 141 | + }, |
| 142 | + { |
| 143 | + hasChildren: true, |
| 144 | + name: 'nested1.nested2.nested3', |
| 145 | + parentPath: 'params:params.yaml', |
| 146 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3', |
| 147 | + type: ColumnType.PARAMS |
| 148 | + }, |
| 149 | + { |
| 150 | + hasChildren: true, |
| 151 | + name: 'nested4', |
| 152 | + parentPath: 'params:params.yaml:nested1%2Enested2%2Enested3', |
| 153 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3.nested4', |
| 154 | + type: ColumnType.PARAMS |
| 155 | + }, |
| 156 | + { |
| 157 | + hasChildren: true, |
| 158 | + name: 'nested5b', |
| 159 | + parentPath: 'params:params.yaml:nested1%2Enested2%2Enested3.nested4', |
| 160 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b', |
| 161 | + type: ColumnType.PARAMS |
| 162 | + }, |
| 163 | + { |
| 164 | + hasChildren: false, |
| 165 | + maxStringLength: 23, |
| 166 | + name: 'nested6', |
| 167 | + parentPath: |
| 168 | + 'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b', |
| 169 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b.nested6', |
| 170 | + pathArray: [ |
| 171 | + 'params', |
| 172 | + 'params.yaml', |
| 173 | + 'nested1', |
| 174 | + 'nested2', |
| 175 | + 'nested3', |
| 176 | + 'nested4', |
| 177 | + 'nested5b', |
| 178 | + 'nested6' |
| 179 | + ], |
| 180 | + type: ColumnType.PARAMS, |
| 181 | + types: ['string'] |
| 182 | + }, |
| 183 | + { |
| 184 | + hasChildren: false, |
| 185 | + maxStringLength: 16, |
| 186 | + name: 'doubled', |
| 187 | + parentPath: |
| 188 | + 'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b', |
| 189 | + path: 'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b.doubled', |
| 190 | + pathArray: [ |
| 191 | + 'params', |
| 192 | + 'params.yaml', |
| 193 | + 'nested1', |
| 194 | + 'nested2', |
| 195 | + 'nested3', |
| 196 | + 'nested4', |
| 197 | + 'nested5b', |
| 198 | + 'doubled' |
| 199 | + ], |
| 200 | + type: ColumnType.PARAMS, |
| 201 | + types: ['string'] |
| 202 | + }, |
| 203 | + { |
| 204 | + hasChildren: false, |
| 205 | + maxStringLength: 1, |
| 206 | + name: 'outlier', |
| 207 | + parentPath: 'params:params.yaml', |
| 208 | + path: 'params:params.yaml:outlier', |
| 209 | + pathArray: ['params', 'params.yaml', 'outlier'], |
| 210 | + type: ColumnType.PARAMS, |
| 211 | + types: ['number'], |
| 212 | + maxNumber: 1, |
| 213 | + minNumber: 1 |
| 214 | + } |
| 215 | +] |
74 | 216 |
|
75 | | -const { workspace, branches } = collectExperiments(deeplyNestedOutput) |
76 | | -const colors = copyOriginalColors() |
77 | 217 | export const rows = [ |
78 | | - { ...workspace, displayColor: colors[0] }, |
79 | | - ...branches.map((branch, i) => ({ ...branch, displayColor: colors[i + 1] })) |
| 218 | + { |
| 219 | + id: 'workspace', |
| 220 | + label: 'workspace', |
| 221 | + timestamp: null, |
| 222 | + queued: false, |
| 223 | + running: false, |
| 224 | + executor: null, |
| 225 | + params: { |
| 226 | + 'params.yaml': { |
| 227 | + nested1: { |
| 228 | + doubled: 'first instance!', |
| 229 | + nested2: { |
| 230 | + nested3: { |
| 231 | + nested4: { |
| 232 | + nested5: { nested6: { nested7: 'Lucky!' } }, |
| 233 | + nested5b: { |
| 234 | + nested6: 'Wow!!!!!!!!!!!!!!!!!!!!', |
| 235 | + doubled: 'second instance!' |
| 236 | + } |
| 237 | + } |
| 238 | + } |
| 239 | + } |
| 240 | + }, |
| 241 | + outlier: 1 |
| 242 | + } |
| 243 | + }, |
| 244 | + displayColor: '#945dd6', |
| 245 | + selected: true |
| 246 | + }, |
| 247 | + { |
| 248 | + id: 'main', |
| 249 | + label: 'main', |
| 250 | + timestamp: '2020-11-21T19:58:22', |
| 251 | + queued: false, |
| 252 | + running: false, |
| 253 | + executor: null, |
| 254 | + name: 'main', |
| 255 | + sha: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77', |
| 256 | + params: { |
| 257 | + 'params.yaml': { |
| 258 | + nested1: { |
| 259 | + doubled: 'first instance!', |
| 260 | + nested2: { |
| 261 | + nested3: { |
| 262 | + nested4: { |
| 263 | + nested5: { nested6: { nested7: 'Lucky!' } }, |
| 264 | + nested5b: { |
| 265 | + nested6: 'Wow!!!!!!!!!!!!!!!!!!!!', |
| 266 | + doubled: 'second instance!' |
| 267 | + } |
| 268 | + } |
| 269 | + } |
| 270 | + } |
| 271 | + }, |
| 272 | + outlier: 1 |
| 273 | + } |
| 274 | + }, |
| 275 | + displayColor: '#13adc7', |
| 276 | + selected: true |
| 277 | + } |
80 | 278 | ] |
81 | 279 |
|
82 | 280 | const deeplyNestedTableData: TableData = { |
|
0 commit comments