diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 18:10:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-26 18:10:29 +0300 |
commit | c82ca12a1c5a359325cb45aaf01b483d1fa0efcb (patch) | |
tree | 86bba20fccbaf79f3277ffcba125201492f3e92b /app/assets/javascripts/blob | |
parent | ff579119e2ecf2608370a1f24c4d791d28f269d9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/suggest_web_ide_ci/components/web_ide_alert.vue | 50 | ||||
-rw-r--r-- | app/assets/javascripts/blob/suggest_web_ide_ci/index.js | 20 |
2 files changed, 70 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/suggest_web_ide_ci/components/web_ide_alert.vue b/app/assets/javascripts/blob/suggest_web_ide_ci/components/web_ide_alert.vue new file mode 100644 index 00000000000..1308ca53e74 --- /dev/null +++ b/app/assets/javascripts/blob/suggest_web_ide_ci/components/web_ide_alert.vue @@ -0,0 +1,50 @@ +<script> +import { GlAlert, GlButton } from '@gitlab/ui'; +import axios from '~/lib/utils/axios_utils'; + +export default { + components: { + GlAlert, + GlButton, + }, + props: { + dismissEndpoint: { + type: String, + required: true, + }, + featureId: { + type: String, + required: true, + }, + editPath: { + type: String, + required: true, + }, + }, + data() { + return { + showAlert: true, + }; + }, + methods: { + dismissAlert() { + this.showAlert = false; + + return axios.post(this.dismissEndpoint, { + feature_name: this.featureId, + }); + }, + }, +}; +</script> + +<template> + <gl-alert v-if="showAlert" class="gl-mt-5" @dismiss="dismissAlert"> + {{ __('The Web IDE offers advanced syntax highlighting capabilities and more.') }} + <div class="gl-mt-5"> + <gl-button :href="editPath" category="primary" variant="info">{{ + __('Open Web IDE') + }}</gl-button> + </div> + </gl-alert> +</template> diff --git a/app/assets/javascripts/blob/suggest_web_ide_ci/index.js b/app/assets/javascripts/blob/suggest_web_ide_ci/index.js new file mode 100644 index 00000000000..eadf3cd6216 --- /dev/null +++ b/app/assets/javascripts/blob/suggest_web_ide_ci/index.js @@ -0,0 +1,20 @@ +import Vue from 'vue'; +import WebIdeAlert from './components/web_ide_alert.vue'; + +export default el => { + const { dismissEndpoint, featureId, editPath } = el.dataset; + + // eslint-disable-next-line no-new + new Vue({ + el, + render(createElement) { + return createElement(WebIdeAlert, { + props: { + dismissEndpoint, + featureId, + editPath, + }, + }); + }, + }); +}; |