summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/import_projects/components/imported_project_table_row.vue
blob: ab2bd87ee9f3f782028e64f8aaa1b4fe6402f56e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script>
import ImportStatus from './import_status.vue';
import { STATUSES } from '../constants';

export default {
  name: 'ImportedProjectTableRow',
  components: {
    ImportStatus,
  },
  props: {
    project: {
      type: Object,
      required: true,
    },
  },

  computed: {
    displayFullPath() {
      return this.project.fullPath.replace(/^\//, '');
    },

    isFinished() {
      return this.project.importStatus === STATUSES.FINISHED;
    },
  },
};
</script>

<template>
  <tr class="js-imported-project import-row">
    <td>
      <a
        :href="project.providerLink"
        rel="noreferrer noopener"
        target="_blank"
        class="js-provider-link"
      >
        {{ project.importSource }}
      </a>
    </td>
    <td class="js-full-path">{{ displayFullPath }}</td>
    <td><import-status :status="project.importStatus" /></td>
    <td>
      <a
        v-if="isFinished"
        class="btn btn-default js-go-to-project"
        :href="project.fullPath"
        rel="noreferrer noopener"
        target="_blank"
      >
        {{ __('Go to project') }}
      </a>
    </td>
  </tr>
</template>