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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-09 03:09:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-09 03:09:42 +0300
commit77914793a349059bf523b131fc925b34349d6884 (patch)
treee21ee34216768d49a3309c453a444b5e29675a78 /app/assets/javascripts/jira_connect
parentcb36ae7dd5fde175f8a24bfa97b20e9b2e2058bf (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/jira_connect')
-rw-r--r--app/assets/javascripts/jira_connect/components/app.vue13
-rw-r--r--app/assets/javascripts/jira_connect/index.js18
2 files changed, 29 insertions, 2 deletions
diff --git a/app/assets/javascripts/jira_connect/components/app.vue b/app/assets/javascripts/jira_connect/components/app.vue
index 7b8b46cb048..490bf2fdd66 100644
--- a/app/assets/javascripts/jira_connect/components/app.vue
+++ b/app/assets/javascripts/jira_connect/components/app.vue
@@ -1,3 +1,16 @@
+<script>
+export default {
+ name: 'JiraConnectApp',
+ computed: {
+ state() {
+ return this.$root.$data.state || {};
+ },
+ error() {
+ return this.state.error;
+ },
+ },
+};
+</script>
<template>
<div></div>
</template>
diff --git a/app/assets/javascripts/jira_connect/index.js b/app/assets/javascripts/jira_connect/index.js
index a7dc71ced1c..e7aa4c437bb 100644
--- a/app/assets/javascripts/jira_connect/index.js
+++ b/app/assets/javascripts/jira_connect/index.js
@@ -2,6 +2,15 @@ import Vue from 'vue';
import $ from 'jquery';
import App from './components/app.vue';
+const store = {
+ state: {
+ error: '',
+ },
+ setErrorMessage(errorMessage) {
+ this.state.error = errorMessage;
+ },
+};
+
/**
* Initialize necessary form handlers for the Jira Connect app
*/
@@ -11,9 +20,11 @@ const initJiraFormHandlers = () => {
};
const reqFailed = (res, fallbackErrorMessage) => {
- const { responseJSON: { error } = {} } = res || {};
+ const { responseJSON: { error = fallbackErrorMessage } = {} } = res || {};
+
+ store.setErrorMessage(error);
// eslint-disable-next-line no-alert
- alert(error || fallbackErrorMessage);
+ alert(error);
};
AP.getLocation(location => {
@@ -66,6 +77,9 @@ function initJiraConnect() {
return new Vue({
el,
+ data: {
+ state: store.state,
+ },
render(createElement) {
return createElement(App, {});
},