From bb693b6beb4a517a93f1b4348983a457593d8128 Mon Sep 17 00:00:00 2001 From: Miyp Date: Thu, 12 Mar 2020 21:58:20 +0900 Subject: [PATCH 1/2] Change uketuke demo. Change uketuke demo. From Static Data node to REST node. with Noodl + microCMS. --- .gitignore | 2 + uketuke/project.json | 418 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 367 insertions(+), 53 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbc4dd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +uketuke/project.json diff --git a/uketuke/project.json b/uketuke/project.json index 0bf9fc1..64fa7a7 100644 --- a/uketuke/project.json +++ b/uketuke/project.json @@ -1,5 +1,5 @@ { - "name": "Untitled", + "name": "N2_Uketuke", "components": [ { "name": "/uketuke", @@ -62,7 +62,7 @@ "id": "9f9b3f6a-6834-eadc-fa52-54307c17cb2a", "type": "Text Input", "x": 20, - "y": 92, + "y": 128, "parameters": { "fontSize": { "value": 30, @@ -115,8 +115,8 @@ { "id": "75d61ef0-c0e4-1701-4715-6168339cf42f", "type": "Group", - "x": 20, - "y": 184, + "x": 156, + "y": 138.5, "parameters": { "width": { "value": 150, @@ -142,8 +142,8 @@ { "id": "0eea45f1-4224-57e7-2aa0-e8ae1ca7f5b9", "type": "Text", - "x": 73.19999999999999, - "y": 208.3, + "x": 176, + "y": 220.5, "parameters": { "sizeMode": "contentSize", "text": "送信!", @@ -241,18 +241,6 @@ "name": "/kanri", "graph": { "connections": [ - { - "fromId": "9d62194d-bda2-8933-273f-a79eb8e219bf", - "fromProperty": "items", - "toId": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", - "toProperty": "items" - }, - { - "fromId": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", - "fromProperty": "items", - "toId": "6a9537e8-7711-25fc-ecd8-bf8f7dc7853a", - "toProperty": "items" - }, { "fromId": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", "fromProperty": "items", @@ -276,16 +264,35 @@ "fromProperty": "trig", "toId": "1dd83ad6-a2d3-dc65-a4b5-9b050e0a8150", "toProperty": "send" + }, + { + "fromId": "26d648e7-5065-a183-4281-4408e00d8a4c", + "fromProperty": "onClick", + "toId": "7a81e0b6-6876-1aff-6cd9-84ed3c843b8e", + "toProperty": "fetch" + }, + { + "fromId": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", + "fromProperty": "items", + "toId": "6a9537e8-7711-25fc-ecd8-bf8f7dc7853a", + "toProperty": "items" + }, + { + "fromId": "7a81e0b6-6876-1aff-6cd9-84ed3c843b8e", + "fromProperty": "items", + "toId": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", + "toProperty": "items" } ], "roots": [ { "id": "3bf30146-579b-2c9e-30da-494ec7ef3b8f", "type": "Group", - "x": 252, - "y": 92.0333333333333, + "x": 261, + "y": 141.0333333333333, "parameters": { - "backgroundColor": "#EF8F45" + "backgroundColor": "#EF8F45", + "scrollBehavior": "noodl" }, "ports": [], "dynamicports": [], @@ -296,21 +303,92 @@ "x": 20, "y": 46, "parameters": { - "template": "/parts" + "template": "/parts2" }, "ports": [], "dynamicports": [], "children": [] + }, + { + "id": "26d648e7-5065-a183-4281-4408e00d8a4c", + "type": "Group", + "x": 20, + "y": 128, + "parameters": { + "width": { + "value": 150, + "unit": "px" + }, + "height": { + "value": 60, + "unit": "px" + }, + "position": "absolute", + "alignX": "right", + "alignY": "top", + "backgroundColor": "#004BBD", + "borderRadius": 20, + "zIndex": 2, + "marginTop": { + "value": 10, + "unit": "px" + }, + "marginRight": { + "value": 8, + "unit": "px" + }, + "borderStyle": "solid", + "borderWidth": { + "value": 1, + "unit": "px" + }, + "boxShadowEnabled": true, + "boxShadowOffsetX": { + "value": 5, + "unit": "px" + }, + "boxShadowOffsetY": { + "value": 5, + "unit": "px" + } + }, + "ports": [], + "dynamicports": [], + "children": [ + { + "id": "c76297e8-fbde-a26f-d7ba-431ef494af42", + "type": "Text", + "x": 20, + "y": 46, + "parameters": { + "sizeMode": "contentSize", + "text": "リスト更新", + "fontSize": { + "value": 25, + "unit": "px" + }, + "color": "#FFFFFF", + "position": "absolute", + "alignX": "center", + "alignY": "center" + }, + "ports": [], + "dynamicports": [], + "children": [] + } + ] } ] }, { "id": "9d62194d-bda2-8933-273f-a79eb8e219bf", "type": "Static Data", - "x": -130.7759412640325, - "y": 141.09149561902805, + "x": -121.07291613075961, + "y": 168.646311952803, "parameters": { - "csv": "id,表示名\r\n01,りんご\r\n02,みかん\r\n03,ゆず\r\n04,清水さん" + "csv": "id,name\r\n01,りんご\r\n02,みかん\r\n03,ゆず\r\n04,清水さん\r\n05,けん\r\n06,ちひ\r\n07,こと", + "type": "csv", + "json": "" }, "ports": [], "dynamicports": [], @@ -319,8 +397,8 @@ { "id": "23ae1c24-0667-1791-d278-5f79dd8cf2c5", "type": "Collection", - "x": 66.37210819046314, - "y": 125.00160845022708, + "x": 77.63411205712046, + "y": 174.00160845022708, "parameters": { "collectionId": "user" }, @@ -331,10 +409,10 @@ { "id": "8aa89c1f-1b54-0116-b89d-7769f9bb2f4d", "type": "Javascript2", - "x": 92.86417696968655, - "y": 293.33306825969544, + "x": 96.86417696968655, + "y": 454.3330682596955, "parameters": { - "code": "define({\r\n \t// The input ports of the Javascript node, name of input and type\r\n \tinputs:{\r\n \t // ExampleInput:'number',\r\n \t // Available types are 'number', 'string', 'boolean', 'color' and 'signal',\r\n \t data:'collection',\r\n \t name:'string',\r\n \t},\r\n\r\n \t// The output ports of the Javascript node, name of output and type\r\n \toutputs:{\r\n \t state:'string',\r\n \t trig:'boolean',\r\n \t},\r\n\r\n \t// All signal inputs need their own function with the corresponding name that\r\n \t// will be run when a signal is received on the input.\r\n \tmySignal:function(inputs,outputs) {\r\n \t\t// ...\r\n \t},\r\n\r\n \t// This function will be called when any of the inputs have changed\r\n \tchange:function(inputs,outputs) {\r\n \t\t// ...\r\n \t\tvar i;\r\n \t\tvar w_this = this;\r\n\r\n console.log(\"入力データ [\" + inputs.name + \"]\");\r\n\r\n \t\tfor(i=0; i Date: Fri, 13 Mar 2020 23:04:50 +0900 Subject: [PATCH 2/2] Adding icon field --- uketuke/project.json | 132 +++++++++++++++++++++++++++++++++---------- 1 file changed, 102 insertions(+), 30 deletions(-) diff --git a/uketuke/project.json b/uketuke/project.json index 64fa7a7..0b42f16 100644 --- a/uketuke/project.json +++ b/uketuke/project.json @@ -505,9 +505,9 @@ "id": "7a81e0b6-6876-1aff-6cd9-84ed3c843b8e", "type": "REST", "x": 79.41847090500985, - "y": 303.6515432586134, + "y": 304.6515432586134, "parameters": { - "code": "define({\n inputs:{\n apikey:'string'\n },\n outputs:{\n items:'collection'\n },\n request:function(inputs,request) {\n request.headers = {\"X-API-KEY\":inputs.apikey};\n\n },\n response:function(outputs,response) {\n console.log(response);\n outputs.items = response.content.contents;\n }\n \n})\n", + "code": "define({\n inputs:{\n apikey:'string'\n },\n outputs:{\n items:'collection'\n },\n request:function(inputs,request) {\n request.headers = {\"X-API-KEY\":inputs.apikey};\n },\n response:function(outputs,response) {\n for (i = 0; i < response.content.contents.length; i++) {\n response.content.contents[i].url=response.content.contents[i].icon.url\n }\n outputs.items = response.content.contents;\n }\n})\n", "resource": "/news", "apiKey": "fab15d58-7f93-427e-9ec8-e2732faac1a7" }, @@ -678,6 +678,12 @@ "fromProperty": "name", "toId": "6f6602ff-e100-fcf0-dd9e-3ab280ed6088", "toProperty": "text" + }, + { + "fromId": "5fa50415-c5d0-6e73-8f68-ea079c3a603f", + "fromProperty": "url", + "toId": "89bc3d7e-5a1c-8c7e-ce52-a9185fa470bf", + "toProperty": "src" } ], "roots": [ @@ -722,20 +728,33 @@ "value": 3, "unit": "px" }, - "borderRadius": 4 + "borderRadius": 4, + "flexDirection": "row" }, "ports": [], "dynamicports": [], "children": [ { - "id": "6f6602ff-e100-fcf0-dd9e-3ab280ed6088", - "type": "Text", - "label": "name", + "id": "89bc3d7e-5a1c-8c7e-ce52-a9185fa470bf", + "type": "Image", "x": 20, "y": 46, "parameters": { + "sizeMode": "explicit", + "height": { + "value": 15, + "unit": "%" + }, + "width": { + "value": 15, + "unit": "%" + }, "marginLeft": { - "value": 0, + "value": 5, + "unit": "px" + }, + "marginRight": { + "value": 5, "unit": "px" } }, @@ -744,44 +763,97 @@ "children": [] }, { - "id": "17be9735-b817-8301-f13b-1b79e0dc958e", - "type": "Text", - "label": "nickname", - "x": 20, - "y": 143, - "parameters": { - "color": "#006394" - }, - "ports": [], - "dynamicports": [], - "children": [] - }, - { - "id": "65be7bc3-c004-4656-1e82-369246dca6ad", - "type": "Text", - "label": "content", + "id": "aa3d5a7e-dc7a-85a3-fd2e-f7c6a539cfec", + "type": "Group", "x": 20, - "y": 240, + "y": 128, "parameters": { + "paddingTop": 0, + "marginTop": { + "value": 5, + "unit": "px" + }, + "marginRight": { + "value": 5, + "unit": "px" + }, + "marginBottom": { + "value": 5, + "unit": "px" + }, "marginLeft": { - "value": 10, + "value": 5, + "unit": "px" + }, + "boxShadowOffsetX": { + "value": 3, + "unit": "px" + }, + "boxShadowOffsetY": { + "value": 3, "unit": "px" } }, "ports": [], "dynamicports": [], - "children": [] + "children": [ + { + "id": "6f6602ff-e100-fcf0-dd9e-3ab280ed6088", + "type": "Text", + "label": "name", + "x": 491.5394298660184, + "y": 437.96766018514313, + "parameters": { + "marginLeft": { + "value": 0, + "unit": "px" + } + }, + "ports": [], + "dynamicports": [], + "children": [] + }, + { + "id": "17be9735-b817-8301-f13b-1b79e0dc958e", + "type": "Text", + "label": "nickname", + "x": 491.5394298660184, + "y": 534.9676601851431, + "parameters": { + "color": "#006394" + }, + "ports": [], + "dynamicports": [], + "children": [] + }, + { + "id": "65be7bc3-c004-4656-1e82-369246dca6ad", + "type": "Text", + "label": "content", + "x": 491.5394298660184, + "y": 631.9676601851431, + "parameters": { + "marginLeft": { + "value": 10, + "unit": "px" + } + }, + "ports": [], + "dynamicports": [], + "children": [] + } + ] } ] }, { "id": "5fa50415-c5d0-6e73-8f68-ea079c3a603f", "type": "Model", - "x": 209.34416914646187, - "y": 367.6477699734826, + "x": 210.40765489311235, + "y": 368.71125572013307, "parameters": { "modelId": "list", - "properties": "nickname,content,icon,name" + "properties": "nickname,content,url,name" }, "ports": [], "dynamicports": [ @@ -812,7 +884,7 @@ }, "plug": "input/output", "group": "Properties", - "name": "icon", + "name": "url", "index": 8 }, {