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

help_icon.vue « components « security_reports « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3c606283c7d90e213e0c13c22ea89f160378b725 (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
56
57
58
<script>
import { GlButton, GlIcon, GlLink, GlPopover } from '@gitlab/ui';
import { s__ } from '~/locale';

export default {
  components: {
    GlButton,
    GlIcon,
    GlLink,
    GlPopover,
  },
  props: {
    helpPath: {
      type: String,
      required: true,
    },
    discoverProjectSecurityPath: {
      type: String,
      required: false,
      default: '',
    },
  },
  i18n: {
    securityReportsHelp: s__('SecurityReports|Security reports help page link'),
    upgradeToManageVulnerabilities: s__('SecurityReports|Upgrade to manage vulnerabilities'),
    upgradeToInteract: s__(
      'SecurityReports|Upgrade to interact, track and shift left with vulnerability management features in the UI.',
    ),
  },
};
</script>

<template>
  <span v-if="discoverProjectSecurityPath">
    <gl-button
      ref="discoverProjectSecurity"
      icon="information-o"
      category="tertiary"
      :aria-label="$options.i18n.upgradeToManageVulnerabilities"
    />

    <gl-popover
      :target="() => $refs.discoverProjectSecurity.$el"
      :title="$options.i18n.upgradeToManageVulnerabilities"
      placement="top"
      triggers="click blur"
    >
      {{ $options.i18n.upgradeToInteract }}
      <gl-link :href="discoverProjectSecurityPath" target="_blank" class="gl-font-sm">{{
        __('Learn more')
      }}</gl-link>
    </gl-popover>
  </span>

  <gl-link v-else target="_blank" :href="helpPath" :aria-label="$options.i18n.securityReportsHelp">
    <gl-icon name="question" />
  </gl-link>
</template>