github.com/hernad/nomad@v1.6.112/ui/app/components/job-row.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import Component from '@ember/component';
     7  import { action } from '@ember/object';
     8  import { inject as service } from '@ember/service';
     9  import { lazyClick } from '../helpers/lazy-click';
    10  import {
    11    classNames,
    12    tagName,
    13    attributeBindings,
    14  } from '@ember-decorators/component';
    15  import classic from 'ember-classic-decorator';
    16  
    17  @classic
    18  @tagName('tr')
    19  @classNames('job-row', 'is-interactive')
    20  @attributeBindings('data-test-job-row')
    21  export default class JobRow extends Component {
    22    @service router;
    23    @service store;
    24    @service system;
    25  
    26    job = null;
    27  
    28    // One of independent, parent, or child. Used to customize the template
    29    // based on the relationship of this job to others.
    30    context = 'independent';
    31  
    32    click(event) {
    33      lazyClick([this.gotoJob, event]);
    34    }
    35  
    36    @action
    37    gotoJob() {
    38      const { job } = this;
    39      this.router.transitionTo('jobs.job.index', job.idWithNamespace);
    40    }
    41  }