Added dependencies for issues (#2196) (#2531)

This commit is contained in:
kolaente 2018-07-17 23:23:58 +02:00 committed by techknowlogick
parent 7be5935c55
commit 1bff02de55
29 changed files with 967 additions and 48 deletions

View file

@ -1769,6 +1769,7 @@ $(document).ready(function () {
initTopicbar();
initU2FAuth();
initU2FRegister();
initIssueList();
// Repo clone url.
if ($('#repo-clone-url').length > 0) {
@ -2488,3 +2489,41 @@ function updateDeadline(deadlineString) {
}
});
}
function deleteDependencyModal(id, type) {
$('.remove-dependency')
.modal({
closable: false,
duration: 200,
onApprove: function () {
$('#removeDependencyID').val(id);
$('#dependencyType').val(type);
$('#removeDependencyForm').submit();
}
}).modal('show')
;
}
function initIssueList() {
var repolink = $('#repolink').val();
$('.new-dependency-drop-list')
.dropdown({
apiSettings: {
url: '/api/v1/repos' + repolink + '/issues?q={query}',
onResponse: function(response) {
var filteredResponse = {'success': true, 'results': []};
// Parse the response from the api to work with our dropdown
$.each(response, function(index, issue) {
filteredResponse.results.push({
'name' : '#' + issue.number + ' ' + issue.title,
'value' : issue.id
});
});
return filteredResponse;
},
},
fullTextSearch: true
})
;
}