Skip to content

Commit

Permalink
fix: add back template version and deprecate columns
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Dec 12, 2023
1 parent ebf013b commit 6ec25b5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions workspaces/www/lib/js/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const makeIssueColumns = ({ data: key, title, danger = 20, warning = 1 }) => ({
})

const getColumns = (rows) => {
const templateOSS = $$.templateOSS(rows)
const requiredTemplate = $$.templateVersion(rows)
const requiredNode = $$.nodeVersion(rows)

const rowWithIssues = rows.find((project) => project.issues && project.prs) || {}
Expand Down Expand Up @@ -149,6 +151,31 @@ const getColumns = (rows) => {
}
},
},
templateVersion: {
title: 'Template',
type: 'num',
render: (data, row) => {
if (data === null) {
return {
sort: -1,
filter: 'N/A',
display: EL.cell({ text: 'N/A', type: 'info' }),
}
}

const isTemplateOSS = $$.rowId(row) === $$.rowId(templateOSS)
const type = isTemplateOSS || data === requiredTemplate ? 'success'
: data && data !== requiredTemplate ? 'warning'
: 'danger'
const version = isTemplateOSS ? requiredTemplate : data
const text = version || 'None'
return {
sort: version ? util.semver.score(version) : 0,
filter: text,
display: EL.cell({ text, type }),
}
},
},
coverage: {
title: 'Coverage',
type: 'num',
Expand Down Expand Up @@ -203,6 +230,27 @@ const getColumns = (rows) => {
}
},
},
archived: {
// archived and deprecated are excluded so if something is here
// and it is archived then it needs to be deprecated
title: 'Deprecate',
type: 'num',
render: (data, row) => {
if ($$.isPrivate(row)) {
return {
sort: -1,
display: EL.noData({ type: 'info' }),
}
}
const opts = data ? { type: 'danger', text: 'TODO' } : { type: 'success', text: 'No' }
return {
sort: data ? 0 : 1,
filter: opts.text,
display: EL.cell(opts),
}
},
},

lastPublished: {
title: 'Published',
type: 'num',
Expand Down
1 change: 1 addition & 0 deletions workspaces/www/lib/js/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const overrides = {
// this is not portable but for now the template/node version checks
// can be changed here or removed in the columns.js file
export const templateOSS = (projects) => projects.find((p) => p.name === 'template-oss')
export const templateVersion = (projects) => templateOSS(projects)?.version
export const nodeVersion = (projects) => templateOSS(projects)?.node

export const colId = (col) => `${typeof col === 'string' ? col : col.name}:name`
Expand Down

0 comments on commit 6ec25b5

Please sign in to comment.