summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jira_connect.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /app/assets/javascripts/jira_connect.js
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/jira_connect.js')
-rw-r--r--app/assets/javascripts/jira_connect.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/app/assets/javascripts/jira_connect.js b/app/assets/javascripts/jira_connect.js
deleted file mode 100644
index 0864a3024ac..00000000000
--- a/app/assets/javascripts/jira_connect.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* eslint-disable func-names, no-var, no-alert */
-/* global $ */
-/* global AP */
-
-/**
- * This script is not going through Webpack bundling
- * as it is only included in `app/views/jira_connect/subscriptions/index.html.haml`
- * which is going to be rendered within iframe on Jira app dashboard
- * hence any code written here needs to be IE11+ compatible (no fully ES6)
- */
-
-function onLoaded() {
- var reqComplete = function() {
- AP.navigator.reload();
- };
-
- var reqFailed = function(res) {
- alert(res.responseJSON.error);
- };
-
- AP.getLocation(function(location) {
- $('.js-jira-connect-sign-in').each(function() {
- var updatedLink = `${$(this).attr('href')}?return_to=${location}`;
- $(this).attr('href', updatedLink);
- });
- });
-
- $('#add-subscription-form').on('submit', function(e) {
- var actionUrl = $(this).attr('action');
- e.preventDefault();
-
- AP.context.getToken(function(token) {
- // eslint-disable-next-line no-jquery/no-ajax
- $.post(actionUrl, {
- jwt: token,
- namespace_path: $('#namespace-input').val(),
- format: 'json',
- })
- .done(reqComplete)
- .fail(reqFailed);
- });
- });
-
- $('.remove-subscription').on('click', function(e) {
- var href = $(this).attr('href');
- e.preventDefault();
-
- AP.context.getToken(function(token) {
- // eslint-disable-next-line no-jquery/no-ajax
- $.ajax({
- url: href,
- method: 'DELETE',
- data: {
- jwt: token,
- format: 'json',
- },
- })
- .done(reqComplete)
- .fail(reqFailed);
- });
- });
-}
-document.addEventListener('DOMContentLoaded', onLoaded);