- Documentation Repository:
+
@@ -205,10 +220,12 @@
$("#code-or-doc-repo-modal #code-repo-btn").click(function() {
// Set code repo val and reset doc repo val
- $('select[name="code_repo_id"]').val($(this).attr("data-code-repo-id"));
- $('select[name="documentation_repo_id"]').prop('selectedIndex',0);
+ // $('select[name="documentation_repo_id"]').prop('selectedIndex',0);
$("#attach-documentation-modal div.modal-title span").first().text("Attach Documentation repository");
$("#attach-documentation-modal .for-repo-text").text("For "+ $(this).attr("data-code-repo-full-name"));
+ $("#attach-documentation-modal .doc-repo-field input[name='code_repo_id']").val($(this).attr("data-code-repo-id"));
+
+
// Show hide appropriate fields
$("#attach-documentation-modal .code-repo-field").hide();
$("#attach-documentation-modal .doc-repo-field").show();
@@ -223,13 +240,16 @@
// Set code repo val and reset doc repo val
- $('select[name="documentation_repo_id"]').val($(this).attr("data-doc-repo-id"));
- $('select[name="code_repo_id"]').prop('selectedIndex',0);
+ // $('select[name="documentation_repo_id"]').val($(this).attr("data-doc-repo-id"));
+ // $('select[name="code_repo_id"]').prop('selectedIndex',0);
$("#attach-documentation-modal div.modal-title span").first().text("Attach Code repository");
// Show hide appropriate fields
$("#attach-documentation-modal .doc-repo-field").hide();
$("#attach-documentation-modal .code-repo-field").show();
$("#attach-documentation-modal .for-repo-text").text("For "+ $(this).attr("data-doc-repo-full-name"));
+
+ $("#attach-documentation-modal .code-repo-field input[name='documentation_repo_id']").val($(this).attr("data-doc-repo-id"));
+
// Open the modal
$("#attach-documentation-modal").addClass("opened");
@@ -269,7 +289,7 @@
});
- $("#attach-repos-form").submit(function() {
+ $("form.attach-repos-form").submit(function() {
data = objectifyForm($(this).serializeArray());
if (data["documentation_repo_id"] == data["code_repo_id"]){
alert("Documentation and Code Repository cannot be same");
@@ -290,6 +310,13 @@
$(".clickable-row").click(function(){
window.location.href = $(this).find("a.cta").attr("href")
});
+ $(".search .modal-repo-filter").on("keyup change", function() {
+ search_query = $(this).val();
+ $(".repo-connection-list .repo-connection-list-item").hide().filter(function( index ) {
+ return $( this ).attr("data-repo-full-name").toLowerCase().includes(search_query.toLowerCase());
+ })
+ .show();
+ });
{% else %}