rfellows commented on a change in pull request #4969:
URL: https://github.com/apache/nifi/pull/4969#discussion_r606012263
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-parameter-contexts.js
##########
@@ -498,293 +525,261 @@
var referencingControllerServices = [];
var unauthorizedReferencingComponents = [];
- // clear the referencing components from the previous selection
- resetUsage();
-
- var parameterReferencingComponentsContainer =
$('#parameter-referencing-components-container');
-
- // referencing component will be undefined when a new parameter is
added
- if (nfCommon.isUndefined(referencingComponents)) {
- // set to pending
- $('<div class="referencing-component-container"><span
class="unset">Pending
Apply</span></div>').appendTo(parameterReferencingComponentsContainer);
- } else {
- var referencingComponentsForBulletinRetrieval = [];
+ var spinner = $('#parameter-context-usage
.referencing-components-loading');
- // bin the referencing components according to their type
- $.each(referencingComponents, function (_,
referencingComponentEntity) {
- if (referencingComponentEntity.permissions.canRead === true &&
referencingComponentEntity.permissions.canWrite === true) {
-
referencingComponentsForBulletinRetrieval.push(referencingComponentEntity.id);
+ var loadingDeferred = $.Deferred(function (deferred) {
+ spinner.addClass('ajax-loading');
+ deferred.resolve();
+ });
+ loadingDeferred.then(function () {
Review comment:
Actually, no. I originally had it there but putting it in its own
`.then` after the resolve give it enough time to actually render the spinner
before we begin resetting the dom. WIthout this, it never show up until after
it clears it out and when there are a large number of items in there, it can
appear frozen for a second or 2. This was the best balance that I could find.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]