mirror of https://github.com/apache/nifi.git
NIFI-12972 - Only show selected relationships in read-only connection details (#8582)
* NIFI-12972 - Only show selected relationships in read-only connection details * review This closes #8582
This commit is contained in:
parent
88d434f9ec
commit
644d086ff2
|
@ -38,8 +38,7 @@
|
|||
</div>
|
||||
<div id="read-only-relationship-names-container" class="setting">
|
||||
<div class="setting-name">
|
||||
Relationships
|
||||
<div class="fa fa-question-circle" alt="Info" title="Selected relationships are in bold."></div>
|
||||
Selected relationships
|
||||
</div>
|
||||
<div class="setting-field">
|
||||
<div id="read-only-relationship-names"></div>
|
||||
|
@ -161,4 +160,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -370,7 +370,7 @@
|
|||
* @argument {string} name The relationship name
|
||||
*/
|
||||
var createRelationshipOption = function (name) {
|
||||
$('<div class="available-relationship-container"></div>').append(
|
||||
return $('<div class="available-relationship-container"></div>').append(
|
||||
$('<div class="relationship-name"></div>').text(name)).appendTo('#read-only-relationship-names');
|
||||
};
|
||||
|
||||
|
@ -496,30 +496,17 @@
|
|||
var availableRelationships = connection.availableRelationships;
|
||||
var selectedRelationships = connection.selectedRelationships;
|
||||
|
||||
// show the available relationship if applicable
|
||||
// show the selected relationships if applicable
|
||||
if (nfCommon.isDefinedAndNotNull(availableRelationships) || nfCommon.isDefinedAndNotNull(selectedRelationships)) {
|
||||
// populate the available connections
|
||||
$.each(availableRelationships, function (i, name) {
|
||||
createRelationshipOption(name);
|
||||
});
|
||||
|
||||
// ensure all selected relationships are present
|
||||
// (may be undefined) and selected
|
||||
// populate the selected connections
|
||||
$.each(selectedRelationships, function (i, name) {
|
||||
// mark undefined relationships accordingly
|
||||
if ($.inArray(name, availableRelationships) === -1) {
|
||||
var option = createRelationshipOption(name);
|
||||
$(option).children('div.relationship-name').addClass('undefined');
|
||||
} else {
|
||||
createRelationshipOption(name);
|
||||
}
|
||||
|
||||
// ensure all selected relationships are bold
|
||||
var relationships = $('#read-only-relationship-names').children('div');
|
||||
$.each(relationships.children('div.relationship-name'), function (i, relationshipNameElement) {
|
||||
var relationshipName = $(relationshipNameElement);
|
||||
if (relationshipName.text() === name) {
|
||||
relationshipName.css('font-weight', 'bold');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#selected-relationship-text').show();
|
||||
|
@ -580,4 +567,4 @@
|
|||
}).fail(nfErrorHandler.handleAjaxError);
|
||||
}
|
||||
};
|
||||
}));
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue