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
4671763a
Commit
4671763a
authored
Dec 02, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lexical "this" bug in jquery for Jira connect
- Also, add fallback message for jira connect errors
parent
fa60193b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
app/assets/javascripts/jira_connect/index.js
app/assets/javascripts/jira_connect/index.js
+8
-7
changelogs/unreleased/fix-jira-connect-jquery-code.yml
changelogs/unreleased/fix-jira-connect-jquery-code.yml
+5
-0
No files found.
app/assets/javascripts/jira_connect/index.js
View file @
4671763a
...
@@ -10,19 +10,20 @@ const initJiraFormHandlers = () => {
...
@@ -10,19 +10,20 @@ const initJiraFormHandlers = () => {
AP
.
navigator
.
reload
();
AP
.
navigator
.
reload
();
};
};
const
reqFailed
=
res
=>
{
const
reqFailed
=
(
res
,
fallbackErrorMessage
)
=>
{
const
{
responseJSON
:
{
error
}
=
{}
}
=
res
||
{};
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
alert
(
res
.
responseJSON
.
error
);
alert
(
error
||
fallbackErrorMessage
);
};
};
AP
.
getLocation
(
location
=>
{
AP
.
getLocation
(
location
=>
{
$
(
'
.js-jira-connect-sign-in
'
).
each
(
()
=>
{
$
(
'
.js-jira-connect-sign-in
'
).
each
(
function
updateSignInLink
()
{
const
updatedLink
=
`
${
$
(
this
).
attr
(
'
href
'
)}
?return_to=
${
location
}
`
;
const
updatedLink
=
`
${
$
(
this
).
attr
(
'
href
'
)}
?return_to=
${
location
}
`
;
$
(
this
).
attr
(
'
href
'
,
updatedLink
);
$
(
this
).
attr
(
'
href
'
,
updatedLink
);
});
});
});
});
$
(
'
#add-subscription-form
'
).
on
(
'
submit
'
,
e
=>
{
$
(
'
#add-subscription-form
'
).
on
(
'
submit
'
,
function
onAddSubscriptionForm
(
e
)
{
const
actionUrl
=
$
(
this
).
attr
(
'
action
'
);
const
actionUrl
=
$
(
this
).
attr
(
'
action
'
);
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -34,11 +35,11 @@ const initJiraFormHandlers = () => {
...
@@ -34,11 +35,11 @@ const initJiraFormHandlers = () => {
format
:
'
json
'
,
format
:
'
json
'
,
})
})
.
done
(
reqComplete
)
.
done
(
reqComplete
)
.
fail
(
reqFailed
);
.
fail
(
err
=>
reqFailed
(
err
,
'
Failed to add namespace. Please try again.
'
)
);
});
});
});
});
$
(
'
.remove-subscription
'
).
on
(
'
click
'
,
e
=>
{
$
(
'
.remove-subscription
'
).
on
(
'
click
'
,
function
onRemoveSubscriptionClick
(
e
)
{
const
href
=
$
(
this
).
attr
(
'
href
'
);
const
href
=
$
(
this
).
attr
(
'
href
'
);
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -53,7 +54,7 @@ const initJiraFormHandlers = () => {
...
@@ -53,7 +54,7 @@ const initJiraFormHandlers = () => {
},
},
})
})
.
done
(
reqComplete
)
.
done
(
reqComplete
)
.
fail
(
reqFailed
);
.
fail
(
err
=>
reqFailed
(
err
,
'
Failed to remove namespace. Please try again.
'
)
);
});
});
});
});
};
};
...
...
changelogs/unreleased/fix-jira-connect-jquery-code.yml
0 → 100644
View file @
4671763a
---
title
:
Resolve Cannot remove namespace
merge_request
:
48973
author
:
type
:
fixed
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