summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/sidebar/components/time_tracking/help_state.js
blob: 19f74ad3c6dd8bd429ed98ceac1bcb4382a15052 (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
import { sprintf, s__ } from '../../../locale';

export default {
  name: 'time-tracking-help-state',
  props: {
    rootPath: {
      type: String,
      required: true,
    },
  },
  computed: {
    href() {
      return `${this.rootPath}help/workflow/time_tracking.md`;
    },
    estimateText() {
      return sprintf(
        s__('estimateCommand|%{slash_command} will update the estimated time with the latest command.'), {
          slash_command: '<code>/estimate</code>',
        }, false,
      );
    },
    spendText() {
      return sprintf(
        s__('spendCommand|%{slash_command} will update the sum of the time spent.'), {
          slash_command: '<code>/spend</code>',
        }, false,
      );
    },
  },
  template: `
    <div class="time-tracking-help-state">
      <div class="time-tracking-info">
        <h4>
          {{ __('Track time with quick actions') }}
        </h4>
        <p>
          {{ __('Quick actions can be used in the issues description and comment boxes.') }}
        </p>
        <p v-html="estimateText">
        </p>
        <p v-html="spendText">
        </p>
        <a
          class="btn btn-default learn-more-button"
          :href="href"
        >
          {{ __('Learn more') }}
        </a>
      </div>
    </div>
  `,
};