Simplify Builds page
Rather than showing the word "link" over and over in some columns, hyperlink appropriate values instead. Change -> change Result -> build Change-Id: I9fadb72a8b375631b24ea0cfcc17f6d54183a308
This commit is contained in:
parent
99c38c9375
commit
3dded2796a
|
@ -51,7 +51,7 @@ class BuildsPage extends TableFilters {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
document.title = 'Zuul Build'
|
document.title = 'Zuul Builds'
|
||||||
if (this.props.tenant.name) {
|
if (this.props.tenant.name) {
|
||||||
this.updateData(this.getFilterFromUrl())
|
this.updateData(this.getFilterFromUrl())
|
||||||
}
|
}
|
||||||
|
@ -67,47 +67,40 @@ class BuildsPage extends TableFilters {
|
||||||
const headerFormat = value => <Table.Heading>{value}</Table.Heading>
|
const headerFormat = value => <Table.Heading>{value}</Table.Heading>
|
||||||
const cellFormat = (value) => (
|
const cellFormat = (value) => (
|
||||||
<Table.Cell>{value}</Table.Cell>)
|
<Table.Cell>{value}</Table.Cell>)
|
||||||
const linkCellFormat = (value) => (
|
const linkBuildFormat = (value, rowdata) => (
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<a href={value} target='_blank' rel='noopener noreferrer'>link</a>
|
<Link to={this.props.tenant.linkPrefix + '/build/' + rowdata.rowData.uuid}>{value}</Link>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
)
|
)
|
||||||
const linkBuildFormat = (value) => (
|
const linkChangeFormat = (value, rowdata) => (
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<Link to={this.props.tenant.linkPrefix + '/build/' + value}>link</Link>
|
<a href={rowdata.rowData.ref_url}>{value ? rowdata.rowData.change+','+rowdata.rowData.patchset : rowdata.rowData.newrev.substring(7,1)}</a>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
)
|
)
|
||||||
this.columns = []
|
this.columns = []
|
||||||
this.filterTypes = []
|
this.filterTypes = []
|
||||||
const myColumns = [
|
const myColumns = [
|
||||||
'build',
|
|
||||||
'job',
|
'job',
|
||||||
'project',
|
'project',
|
||||||
'branch',
|
'branch',
|
||||||
'pipeline',
|
'pipeline',
|
||||||
'change',
|
'change',
|
||||||
'duration',
|
'duration',
|
||||||
'log',
|
|
||||||
'start time',
|
'start time',
|
||||||
'result']
|
'result']
|
||||||
myColumns.forEach(column => {
|
myColumns.forEach(column => {
|
||||||
let prop = column
|
let prop = column
|
||||||
let formatter = cellFormat
|
let formatter = cellFormat
|
||||||
// Adapt column name and property name
|
// Adapt column name and property name
|
||||||
if (column === 'build') {
|
|
||||||
prop = 'uuid'
|
|
||||||
formatter = linkBuildFormat
|
|
||||||
}
|
|
||||||
if (column === 'job') {
|
if (column === 'job') {
|
||||||
prop = 'job_name'
|
prop = 'job_name'
|
||||||
} else if (column === 'start time') {
|
} else if (column === 'start time') {
|
||||||
prop = 'start_time'
|
prop = 'start_time'
|
||||||
} else if (column === 'change') {
|
} else if (column === 'change') {
|
||||||
prop = 'ref_url'
|
prop = 'change'
|
||||||
formatter = linkCellFormat
|
formatter = linkChangeFormat
|
||||||
} else if (column === 'log') {
|
} else if (column === 'result') {
|
||||||
prop = 'log_url'
|
formatter = linkBuildFormat
|
||||||
formatter = linkCellFormat
|
|
||||||
}
|
}
|
||||||
const label = column.charAt(0).toUpperCase() + column.slice(1)
|
const label = column.charAt(0).toUpperCase() + column.slice(1)
|
||||||
this.columns.push({
|
this.columns.push({
|
||||||
|
|
Loading…
Reference in New Issue