mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(editor): Handle pin data edge cases and unify validation (no-changelog) (#6685)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -660,24 +660,12 @@ export default defineComponent({
|
||||
if (shouldPinDataBeforeClosing === MODAL_CONFIRM) {
|
||||
const { value } = this.outputPanelEditMode;
|
||||
|
||||
if (!this.isValidPinDataSize(value)) {
|
||||
dataPinningEventBus.emit('data-pinning-error', {
|
||||
errorType: 'data-too-large',
|
||||
source: 'on-ndv-close-modal',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.isValidPinDataJSON(value)) {
|
||||
dataPinningEventBus.emit('data-pinning-error', {
|
||||
errorType: 'invalid-json',
|
||||
source: 'on-ndv-close-modal',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.activeNode) {
|
||||
this.workflowsStore.pinData({ node: this.activeNode, data: jsonParse(value) });
|
||||
try {
|
||||
this.setPinData(this.activeNode, jsonParse(value), 'on-ndv-close-modal');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user