Welcome to mirror list, hosted at ThFree Co, Russian Federation.

work_item_root.vue « pages « work_items « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 493ee0aba01a7a6d9583e306de302b7c3454a93b (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
<script>
import workItemQuery from '../graphql/work_item.query.graphql';
import { widgetTypes } from '../constants';

export default {
  props: {
    id: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      workItem: null,
    };
  },
  apollo: {
    workItem: {
      query: workItemQuery,
      variables() {
        return {
          id: this.id,
        };
      },
    },
  },
  computed: {
    titleWidgetData() {
      return this.workItem?.widgets?.nodes?.find((widget) => widget.type === widgetTypes.title);
    },
  },
};
</script>

<template>
  <section>
    <!-- Title widget placeholder -->
    <div>
      <h2
        v-if="titleWidgetData"
        class="gl-font-weight-normal gl-sm-font-weight-bold gl-my-5"
        data-testid="title"
      >
        {{ titleWidgetData.contentText }}
      </h2>
    </div>
  </section>
</template>