Skip to content

Commit

Permalink
dataset display update
Browse files Browse the repository at this point in the history
Signed-off-by: ArvinHuang <[email protected]>
  • Loading branch information
idwenwen committed Aug 16, 2023
1 parent f726a3c commit e2a28d5
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions resources-front-end/src/views/job-dashboard/board/Board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,23 @@ const ascending = (a, b) => {
const getDatasetFromSummary = obj => {
const { roles, dataset } = obj
const result = Object.keys(roles).map(role => {
const options = roles[role].map(item => ({ value: item, label: item }))
return {
role: role.toUpperCase(),
options,
roleValue: options[0].label,
datasetData: dataset[role] || ''
}
})
result.sort((a, b) => {
return ascending(ROLE_ORDER_MAP[a.role], ROLE_ORDER_MAP[b.role])
})
return result
if (obj && roles && dataset) {
const result = Object.keys(roles).map(role => {
const options = roles[role].map(item => ({ value: item, label: item }))
return {
role: role.toUpperCase(),
options,
roleValue: options[0].label,
datasetData: dataset[role] || ''
}
})
result.sort((a, b) => {
return ascending(ROLE_ORDER_MAP[a.role], ROLE_ORDER_MAP[b.role])
})
return result
} else {
return []
}
}
export default {
Expand Down

0 comments on commit e2a28d5

Please sign in to comment.