Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
351de0d1
Commit
351de0d1
authored
Nov 30, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic shared state to jira connect Vue app
parent
d53fc7f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
app/assets/javascripts/jira_connect/components/app.vue
app/assets/javascripts/jira_connect/components/app.vue
+13
-0
app/assets/javascripts/jira_connect/index.js
app/assets/javascripts/jira_connect/index.js
+17
-2
No files found.
app/assets/javascripts/jira_connect/components/app.vue
View file @
351de0d1
<
script
>
export
default
{
name
:
'
JiraConnectApp
'
,
computed
:
{
state
()
{
return
this
.
$root
.
$data
.
state
||
{};
},
error
()
{
return
this
.
state
.
error
;
},
},
};
</
script
>
<
template
>
<
template
>
<div></div>
<div></div>
</
template
>
</
template
>
app/assets/javascripts/jira_connect/index.js
View file @
351de0d1
...
@@ -2,6 +2,15 @@ import Vue from 'vue';
...
@@ -2,6 +2,15 @@ import Vue from 'vue';
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
App
from
'
./components/app.vue
'
;
import
App
from
'
./components/app.vue
'
;
const
store
=
{
state
:
{
error
:
''
,
},
setErrorMessage
(
errorMessage
)
{
store
.
state
.
error
=
errorMessage
;
},
};
/**
/**
* Initialize necessary form handlers for the Jira Connect app
* Initialize necessary form handlers for the Jira Connect app
*/
*/
...
@@ -11,9 +20,12 @@ const initJiraFormHandlers = () => {
...
@@ -11,9 +20,12 @@ const initJiraFormHandlers = () => {
};
};
const
reqFailed
=
(
res
,
fallbackErrorMessage
)
=>
{
const
reqFailed
=
(
res
,
fallbackErrorMessage
)
=>
{
const
{
responseJSON
:
{
error
}
=
{}
}
=
res
||
{};
const
{
responseJSON
:
{
error
=
fallbackErrorMessage
}
=
{}
}
=
res
||
{};
store
.
setErrorMessage
(
error
);
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
alert
(
error
||
fallbackErrorMessage
);
alert
(
error
);
};
};
AP
.
getLocation
(
location
=>
{
AP
.
getLocation
(
location
=>
{
...
@@ -66,6 +78,9 @@ function initJiraConnect() {
...
@@ -66,6 +78,9 @@ function initJiraConnect() {
return
new
Vue
({
return
new
Vue
({
el
,
el
,
data
:
{
state
:
store
.
state
,
},
render
(
createElement
)
{
render
(
createElement
)
{
return
createElement
(
App
,
{});
return
createElement
(
App
,
{});
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment