summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/sidebar/components/time_tracking/help_state.vue
blob: 91c15061fb9c5c11dc2055d3deff606a726b6230 (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
<script>
import { GlButton, GlSafeHtmlDirective } from '@gitlab/ui';
import { joinPaths } from '~/lib/utils/url_utility';
import { sprintf, s__ } from '~/locale';

export default {
  name: 'TimeTrackingHelpState',
  components: {
    GlButton,
  },
  directives: {
    SafeHtml: GlSafeHtmlDirective,
  },
  computed: {
    href() {
      return joinPaths(gon.relative_url_root || '', '/help/user/project/time_tracking.md');
    },
    estimateText() {
      return sprintf(
        s__('estimateCommand|%{slash_command} overwrites the total estimated time.'),
        {
          slash_command: '<code>/estimate</code>',
        },
        false,
      );
    },
    spendText() {
      return sprintf(
        s__('spendCommand|%{slash_command} adds or subtracts time already spent.'),
        {
          slash_command: '<code>/spend</code>',
        },
        false,
      );
    },
  },
};
</script>

<template>
  <div
    data-testid="helpPane"
    class="sidebar-help-state gl-bg-white gl-border-gray-100 gl-border-t-solid gl-border-b-solid gl-border-1"
  >
    <div class="time-tracking-info">
      <h4>{{ __('Track time with quick actions') }}</h4>
      <p>{{ __('Quick actions can be used in description and comment boxes.') }}</p>
      <p v-safe-html="estimateText"></p>
      <p v-safe-html="spendText"></p>
      <gl-button :href="href">{{ __('Learn more') }}</gl-button>
    </div>
  </div>
</template>