Added validation while export into library

This commit is contained in:
Arun Nattarayan 2018-11-30 20:04:12 +05:30
parent 2f93bb969b
commit 06a1f30350
1 changed files with 3 additions and 1 deletions

View File

@ -447,7 +447,9 @@ RED.library = (function() {
click: function() {
//TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val();
if (!/^\s*$/.test(flowName)) {
if(flowName.split(/[\\/]/).pop() === "" || /^\s*$/.test(flowName)) {
RED.notify(RED._("library.invalidFilename"),"warning");
} else {
$.ajax({
url:'library/flows/'+flowName,
type: "POST",