diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index 1c50476a7..e618c18a0 100644 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -424,6 +424,8 @@ "updated": "updated", "install": "install", "installed": "installed", + "conflict": "conflict", + "conflictTip": "

This module cannot be installed as it includes a
node type that has already been installed

Conflicts with __module__

", "loading": "Loading catalogues...", "tab-nodes": "Nodes", "tab-install": "Install", diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json index 346efe8f6..2720fc7a4 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -106,6 +106,7 @@ "warning": "警告: __message__", "warnings": { "undeployedChanges": "ノードの変更をデプロイしていません", + "nodeActionDisabled": "ノードのアクションは無効になっています", "nodeActionDisabledSubflow": "ノードのアクションは、サブフロー内で無効になっています", "missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください。", "safe-mode": "

セーフモードでフローを停止しました

フローを変更し、再起動するために変更をデプロイできます

", @@ -160,8 +161,10 @@ "subflow_plural": "__count__ 個のサブフロー", "selectNodes": "上のテキストを選択し、クリップボードへコピーしてください", "pasteNodes": "JSON形式のフローデータを貼り付けてください", + "selectFile": "読み込むファイルを選択してください", "importNodes": "フローをクリップボートから読み込み", "exportNodes": "フローをクリップボードへ書き出し", + "download": "ダウンロード", "importUnrecognised": "認識できない型が読み込まれました:", "importUnrecognised_plural": "認識できない型が読み込まれました:", "nodesExported": "クリップボードへフローを書き出しました", @@ -510,7 +513,8 @@ "empty": "データが存在しません", "node": "Node", "flow": "Flow", - "global": "Global" + "global": "Global", + "deleteConfirm": "データを削除しても良いですか?" }, "palette": { "name": "パレットの管理", diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index c4b8e2b34..c24d95bc0 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -955,11 +955,11 @@ RED.nodes = (function() { def = registry.getNodeType(n.type); if (!def || def.category != "config") { var node = { - x:n.x, - y:n.y, + x:parseFloat(n.x || 0), + y:parseFloat(n.y || 0), z:n.z, type:0, - wires:n.wires, + wires:n.wires||[], inputLabels: n.inputLabels, outputLabels: n.outputLabels, icon: n.icon, diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index 9dfc1282c..626abcf76 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -1612,6 +1612,7 @@ RED.editor = (function() { $("#node-config-dialog-user-count").find("span").text(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show(); } trayBody.i18n(); + trayFooter.i18n(); finishedBuilding = true; done(); }); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js index 12febdcf2..c8f4e3d7d 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js @@ -321,7 +321,7 @@ RED.palette.editor = (function() { var catalogueLoadStart; var catalogueLoadErrors = false; - var activeSort = sortModulesAZ; + var activeSort = sortModulesRelevance; function handleCatalogResponse(err,catalog,index,v) { catalogueLoadStatus.push(err||v); @@ -333,6 +333,9 @@ RED.palette.editor = (function() { if (m.keywords) { m.index = m.index.concat(m.keywords); } + if (m.types) { + m.index = m.index.concat(m.types); + } if (m.updated_at) { m.timestamp = new Date(m.updated_at).getTime(); } else { @@ -413,6 +416,17 @@ RED.palette.editor = (function() { packageList.editableList('addItem',{start:10,more:filteredList.length-10}) } } + function sortModulesRelevance(A,B) { + var currentFilter = searchInput.searchBox('value').trim(); + if (currentFilter === "") { + return sortModulesAZ(A,B); + } + var i = A.info.index.indexOf(currentFilter) - B.info.index.indexOf(currentFilter); + if (i === 0) { + return sortModulesAZ(A,B); + } + return i; + } function sortModulesAZ(A,B) { return A.info.id.localeCompare(B.info.id); } @@ -747,32 +761,29 @@ RED.palette.editor = (function() { $('').text(RED._("palette.editor.sort")+' ').appendTo(toolBar); var sortGroup = $('').appendTo(toolBar); - var sortAZ = $('').appendTo(sortGroup); - var sortRecent = $('').appendTo(sortGroup); + var sortRelevance = $('').appendTo(sortGroup); + var sortAZ = $('').appendTo(sortGroup); + var sortRecent = $('').appendTo(sortGroup); - sortAZ.click(function(e) { - e.preventDefault(); - if ($(this).hasClass("selected")) { - return; - } - $(this).addClass("selected"); - sortRecent.removeClass("selected"); - activeSort = sortModulesAZ; - refreshFilteredItems(); + + var sortOpts = [ + {button: sortRelevance, func: sortModulesRelevance}, + {button: sortAZ, func: sortModulesAZ}, + {button: sortRecent, func: sortModulesRecent} + ] + sortOpts.forEach(function(opt) { + opt.button.click(function(e) { + e.preventDefault(); + if ($(this).hasClass("selected")) { + return; + } + $(".palette-editor-install-sort-option").removeClass("selected"); + $(this).addClass("selected"); + activeSort = opt.func; + refreshFilteredItems(); + }); }); - sortRecent.click(function(e) { - e.preventDefault(); - if ($(this).hasClass("selected")) { - return; - } - $(this).addClass("selected"); - sortAZ.removeClass("selected"); - activeSort = sortModulesRecent; - refreshFilteredItems(); - }); - - var refreshSpan = $('').appendTo(toolBar); var refreshButton = $('').appendTo(refreshSpan); refreshButton.click(function(e) { @@ -814,10 +825,23 @@ RED.palette.editor = (function() { $('').attr('href',entry.url).appendTo(titleRow); var descRow = $('
').appendTo(headerRow); $('
',{class:"palette-module-description"}).text(entry.description).appendTo(descRow); - var metaRow = $('
').appendTo(headerRow); $(' '+entry.version+'').appendTo(metaRow); $(' '+formatUpdatedAt(entry.updated_at)+'').appendTo(metaRow); + + var duplicateType = false; + if (entry.types && entry.types.length > 0) { + + for (var i=0;i',{class:"palette-module-meta"}).text(entry.types.join(",")).appendTo(headerRow); + } + var buttonRow = $('
',{class:"palette-module-meta"}).appendTo(headerRow); var buttonGroup = $('
',{class:"palette-module-button-group"}).appendTo(buttonRow); var installButton = $('').text(RED._('palette.editor.install')).appendTo(buttonGroup); @@ -830,6 +854,16 @@ RED.palette.editor = (function() { if (nodeEntries.hasOwnProperty(entry.id)) { installButton.addClass('disabled'); installButton.text(RED._('palette.editor.installed')); + } else if (duplicateType) { + installButton.addClass('disabled'); + installButton.text(RED._('palette.editor.conflict')); + RED.popover.create({ + target:installButton, + content: RED._('palette.editor.conflictTip',{module:duplicateType}), + trigger:"hover", + direction:"bottom", + delay:{show:750,hide:50} + }) } object.elements = { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index fffe21e65..7a8da060e 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -107,8 +107,8 @@ RED.workspaces = (function() { changed = true; workspace.info = info; } - $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled); - $("#workspace").toggleClass("workspace-disabled",workspace.disabled); + $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',!!workspace.disabled); + $("#workspace").toggleClass("workspace-disabled",!!workspace.disabled); if (changed) { var historyEvent = { @@ -254,10 +254,9 @@ RED.workspaces = (function() { } activeWorkspace = tab.id; event.workspace = activeWorkspace; - // $("#workspace").toggleClass("workspace-disabled",tab.disabled); RED.events.emit("workspace:change",event); window.location.hash = 'flow/'+tab.id; - $("#workspace").toggleClass("workspace-disabled",tab.disabled); + $("#workspace").toggleClass("workspace-disabled",!!tab.disabled); RED.sidebar.config.refresh(); RED.view.focus(); }, diff --git a/packages/node_modules/@node-red/editor-client/src/sass/popover.scss b/packages/node_modules/@node-red/editor-client/src/sass/popover.scss index 55b88452f..d703b29a7 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/popover.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/popover.scss @@ -159,3 +159,8 @@ border-color: #666 !important; } } +.red-ui-popover code { + border: none; + background: none; + color: #ccc; +} diff --git a/packages/node_modules/@node-red/nodes/locales/ja/messages.json b/packages/node_modules/@node-red/nodes/locales/ja/messages.json index fb1e8fd8c..df3974aac 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/ja/messages.json @@ -410,7 +410,9 @@ "json-error": "JSONの構文解析エラー", "no-url": "URLが設定されていません", "deprecated-call": "非推奨の呼び出しです __method__", - "invalid-transport": "httpでないトランスポートが要求されました" + "invalid-transport": "httpでないトランスポートが要求されました", + "timeout-isnan": "タイムアウト値が数値ではないため無視します", + "timeout-isnegative": "タイムアウト値が負数のため無視します" }, "status": { "requesting": "要求中"