scottyaslan commented on a change in pull request #3683: NIFI-6506 - Add
ability to convert properties to parameters
URL: https://github.com/apache/nifi/pull/3683#discussion_r320485308
##########
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
##########
@@ -1856,6 +1841,58 @@
initParameterTable();
};
+ /**
+ * Opens the Add Parameter Dialog.
+ * @param {Object} callbacks object with callbacks for handling the cancel
and apply button functionality:
+ *
+ * @example
+ * openAddParameterDialog({
+ * onApply: function () {
+ * // handle the apply button being clicked
+ * },
+ * onCancel: function() {
+ * // handle the cancel button being clicked
+ * }
+ * });
+ */
+ var openAddParameterDialog = function (callbacks) {
+ $('#parameter-dialog')
+ .modal('setHeaderText', 'Add Parameter')
+ .modal('setButtonModel', [{
+ buttonText: 'Apply',
+ color: {
+ base: '#728E9B',
+ hover: '#004849',
+ text: '#ffffff'
+ },
+ disabled: function () {
+ var param = serializeParameter();
+ var isUpdatingParameterContext =
$('#parameter-context-updating-status').hasClass('show-status');
+
+ if (isUpdatingParameterContext || _.isEmpty(param.name)) {
+ return true;
+ }
+ return false;
+ },
+ handler: {
+ click: callbacks.onApply
+ }
+ }, {
+ buttonText: 'Cancel',
+ color: {
+ base: '#E3E8EB',
+ hover: '#C7D2D7',
+ text: '#004849'
+ },
+ handler: {
+ click: callbacks.onCancel
+ }
+ }])
+ .modal('show');
+
+ $('#parameter-dialog').modal('show');
Review comment:
You already show the modal on line 1891...
There is also an extra `modal('show')` on line 1812...
----------------------------------------------------------------
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]
With regards,
Apache Git Services