openings.ts 749 B

12345678910111213141516171819202122
  1. import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
  2. import { displayTable } from '../../helpers/display'
  3. import _ from 'lodash'
  4. export default class WorkingGroupsOpenings extends WorkingGroupsCommandBase {
  5. static description = 'Shows an overview of given working group openings'
  6. static flags = {
  7. ...WorkingGroupsCommandBase.flags,
  8. }
  9. async run() {
  10. const openings = await this.getApi().openingsByGroup(this.group)
  11. const openingsRows = openings.map((o) => ({
  12. 'WG Opening ID': o.wgOpeningId,
  13. Type: o.type.type,
  14. Stage: `${_.startCase(o.stage.status)}${o.stage.block ? ` (#${o.stage.block})` : ''}`,
  15. Applications: o.applications.length,
  16. }))
  17. displayTable(openingsRows, 5)
  18. }
  19. }