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

create_dashboard_modal.vue « components « monitoring « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 10178366db5f55451281108249516566d0a02410 (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
62
63
64
65
66
<script>
import { GlButton, GlModal, GlSprintf } from '@gitlab/ui';
import { isSafeURL } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';

export default {
  components: { GlButton, GlModal, GlSprintf },
  props: {
    modalId: {
      type: String,
      required: true,
    },
    projectPath: {
      type: String,
      required: true,
      validator: isSafeURL,
    },
    addDashboardDocumentationPath: {
      type: String,
      required: true,
    },
  },
  methods: {
    cancelHandler() {
      this.$refs.modal.hide();
    },
  },
  i18n: {
    titleText: s__('Metrics|Create your dashboard configuration file'),
    mainText: s__(
      'Metrics|To create a new dashboard, add a new YAML file to %{codeStart}.gitlab/dashboards%{codeEnd} at the root of this project.',
    ),
  },
};
</script>

<template>
  <gl-modal ref="modal" :modal-id="modalId" :title="$options.i18n.titleText">
    <p>
      <gl-sprintf :message="$options.i18n.mainText">
        <template #code="{ content }">
          <code>{{ content }}</code>
        </template>
      </gl-sprintf>
    </p>
    <template #modal-footer>
      <gl-button category="secondary" @click="cancelHandler">{{ s__('Metrics|Cancel') }}</gl-button>
      <gl-button
        category="secondary"
        variant="confirm"
        target="_blank"
        :href="addDashboardDocumentationPath"
        data-testid="create-dashboard-modal-docs-button"
      >
        {{ s__('Metrics|View documentation') }}
      </gl-button>
      <gl-button
        variant="confirm"
        data-testid="create-dashboard-modal-repo-button"
        :href="projectPath"
      >
        {{ s__('Metrics|Open repository') }}
      </gl-button>
    </template>
  </gl-modal>
</template>