1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix project credential secret reset handling

Part of #2868
This commit is contained in:
Nick O'Leary 2021-04-19 11:32:26 +01:00
parent 3f43dc1855
commit ff00afb5d7
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -928,11 +928,11 @@ RED.projects.settings = (function() {
saveDisabled = isFlowInvalid || credFileLabelText.text()===""; saveDisabled = isFlowInvalid || credFileLabelText.text()==="";
if (credentialSecretExistingInput.is(":visible")) { if (credentialSecretExistingRow.is(":visible")) {
credentialSecretExistingInput.toggleClass("input-error", credentialSecretExistingInput.val() === ""); credentialSecretExistingInput.toggleClass("input-error", credentialSecretExistingInput.val() === "");
saveDisabled = saveDisabled || credentialSecretExistingInput.val() === ""; saveDisabled = saveDisabled || credentialSecretExistingInput.val() === "";
} }
if (credentialSecretNewInput.is(":visible")) { if (credentialSecretNewRow.is(":visible")) {
credentialSecretNewInput.toggleClass("input-error", credentialSecretNewInput.val() === ""); credentialSecretNewInput.toggleClass("input-error", credentialSecretNewInput.val() === "");
saveDisabled = saveDisabled || credentialSecretNewInput.val() === ""; saveDisabled = saveDisabled || credentialSecretNewInput.val() === "";
} }
@ -1130,7 +1130,7 @@ RED.projects.settings = (function() {
} }
if (credentialSecretResetButton.hasClass('selected') || credentialSecretEditButton.hasClass('selected')) { if (credentialSecretResetButton.hasClass('selected') || credentialSecretEditButton.hasClass('selected')) {
payload.credentialSecret = credentialSecretNewInput.val(); payload.credentialSecret = credentialSecretNewInput.val();
if (credentialSecretExistingInput.is(":visible")) { if (credentialSecretExistingRow.is(":visible")) {
payload.currentCredentialSecret = credentialSecretExistingInput.val(); payload.currentCredentialSecret = credentialSecretExistingInput.val();
} }
} }