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

modal.vue « components « reports « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 78c355ecb7666aacebdac41c16929950cf45160d (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
59
60
61
<script>
// import { sprintf, __ } from '~/locale';
import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
import CodeBlock from '~/vue_shared/components/code_block.vue';
import { fieldTypes } from '../constants';

export default {
  components: {
    Modal: DeprecatedModal2,
    CodeBlock,
  },
  props: {
    title: {
      type: String,
      required: true,
    },
    modalData: {
      type: Object,
      required: true,
    },
  },
  fieldTypes,
};
</script>
<template>
  <modal
    id="modal-mrwidget-reports"
    :header-title-text="title"
    class="modal-security-report-dast modal-hide-footer"
  >
    <slot>
      <div
        v-for="(field, key, index) in modalData"
        v-if="field.value"
        :key="index"
        class="row prepend-top-10 append-bottom-10"
      >
        <strong class="col-sm-3 text-right"> {{ field.text }}: </strong>

        <div class="col-sm-9 text-secondary">
          <code-block v-if="field.type === $options.fieldTypes.codeBock" :code="field.value" />

          <template v-else-if="field.type === $options.fieldTypes.link">
            <a :href="field.value" target="_blank" rel="noopener noreferrer" class="js-modal-link">
              {{ field.value }}
            </a>
          </template>

          <template v-else-if="field.type === $options.fieldTypes.seconds">{{
            sprintf(__('%{value} s'), { value: field.value })
          }}</template>

          <template v-else-if="field.type === $options.fieldTypes.text">
            {{ field.value }}
          </template>
        </div>
      </div>
    </slot>
    <div slot="footer"></div>
  </modal>
</template>