NIFI-10814: Display description for selected flow (#6693)

* display description for selected flow

* NIFI-10814: add border when content overflows and increase height

* NIFI-10814: add padding to description

* NIFI-10814: remove duplicate CSS property from declaration block

* NIFI-10814: a few more CSS tweaks

This closes #6693
This commit is contained in:
Shane Ardell 2022-11-22 17:01:38 -05:00 committed by GitHub
parent 8e417c890a
commit aa6f6dd61d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 5 deletions

View File

@ -45,6 +45,12 @@
<div id="import-flow-version-label"></div>
</div>
</div>
<div class="setting">
<div class="setting-name">Flow Description</div>
<div class="setting-field" id="import-flow-description-container">
<div id="import-flow-version-details"></div>
</div>
</div>
<div id="import-flow-version-table"></div>
</div>
</div>

View File

@ -44,10 +44,9 @@ div.connection-terminal-label {
}
#relationship-names {
padding: 2px;
height: 150px;
overflow-y: auto;
overflow-x: hidden;
overflow-x: hidden;
border: 0 solid #cccccc;
padding: 2px;
padding-bottom: 0;

View File

@ -247,11 +247,24 @@ div.progress-label {
#import-flow-version-table {
overflow: hidden;
position: absolute;
top: 190px;
top: 270px;
left: 0px;
right: 0px;
bottom: 0px;
height: 225px;
height: 155px;
}
#import-flow-description-container {
border-color: rgba(0,0,0,0.12);
border-style: solid;
border-width: 0;
height: 48px;
overflow-y: auto;
width: calc(100% - 2px);
}
#import-flow-version-details {
padding: 2px;
}
#change-version-percent-complete {

View File

@ -820,6 +820,37 @@
});
};
/**
* Loads details for a specified flow.
*
* @param registryIdentifier
* @param bucketIdentifier
* @param flowIdentifier
*/
var loadFlowDetails = function (registryIdentifier, bucketIdentifier, flowIdentifier) {
return $.ajax({
type: 'GET',
url: '../nifi-api/flow/registries/' + encodeURIComponent(registryIdentifier) + '/buckets/' + encodeURIComponent(bucketIdentifier) + '/flows/' + encodeURIComponent(flowIdentifier) + '/details',
dataType: 'json'
}).done(function (response) {
var flowVersionDetailsEl = $('#import-flow-version-details');
var flowDescriptionContainerEl = $('#import-flow-description-container');
if (response.versionedFlow.description) {
flowVersionDetailsEl.text(response.versionedFlow.description);
// show borders if appropriate
if (flowVersionDetailsEl.get(0).scrollHeight > Math.round(flowDescriptionContainerEl.innerHeight())) {
flowDescriptionContainerEl.css('border-width', '1px');
} else {
flowDescriptionContainerEl.css('border-width', '0');
}
} else {
flowVersionDetailsEl.text('No description provided.');
flowDescriptionContainerEl.css('border-width', '0');
}
}).fail(nfErrorHandler.handleAjaxError);
};
/**
* Loads the flow versions for the specified registry, bucket, and flow.
*
@ -910,7 +941,8 @@
options: versionedFlows,
select: function (selectedFlow) {
if (nfCommon.isDefinedAndNotNull(selectedFlow.value)) {
selectFlow(registryIdentifier, bucketIdentifier, selectedFlow.value)
selectFlow(registryIdentifier, bucketIdentifier, selectedFlow.value);
loadFlowDetails(registryIdentifier, bucketIdentifier, selectedFlow.value);
} else {
var importFlowVersionGrid = $('#import-flow-version-table').data('gridInstance');
var importFlowVersionData = importFlowVersionGrid.getData();