From 9c9d3b724ad99d76906f0bf4f1e395b68c8d6163 Mon Sep 17 00:00:00 2001 From: Andrea Vesterhus Date: Wed, 10 Jan 2024 09:52:57 +0100 Subject: [PATCH] refactor: deprecated multiType to default example --- .../blueprints/Default.blueprint.json} | 8 +- .../data_grid/default/default.entity.json | 19 +++ .../multi_type/multiType.entity.json | 11 -- .../data_grid/default/default.recipe.json | 158 ++++++++++++++++++ .../multi_type/multiType.recipe.json | 31 ---- 5 files changed, 184 insertions(+), 43 deletions(-) rename example/app/data/DemoDataSource/plugins/data_grid/{multi_type/blueprints/MultiType.blueprint.json => default/blueprints/Default.blueprint.json} (72%) create mode 100644 example/app/data/DemoDataSource/plugins/data_grid/default/default.entity.json delete mode 100644 example/app/data/DemoDataSource/plugins/data_grid/multi_type/multiType.entity.json create mode 100644 example/app/data/DemoDataSource/recipes/plugins/data_grid/default/default.recipe.json delete mode 100644 example/app/data/DemoDataSource/recipes/plugins/data_grid/multi_type/multiType.recipe.json diff --git a/example/app/data/DemoDataSource/plugins/data_grid/multi_type/blueprints/MultiType.blueprint.json b/example/app/data/DemoDataSource/plugins/data_grid/default/blueprints/Default.blueprint.json similarity index 72% rename from example/app/data/DemoDataSource/plugins/data_grid/multi_type/blueprints/MultiType.blueprint.json rename to example/app/data/DemoDataSource/plugins/data_grid/default/blueprints/Default.blueprint.json index b253793ff..2dd0f4727 100644 --- a/example/app/data/DemoDataSource/plugins/data_grid/multi_type/blueprints/MultiType.blueprint.json +++ b/example/app/data/DemoDataSource/plugins/data_grid/default/blueprints/Default.blueprint.json @@ -1,5 +1,5 @@ { - "name": "MultiType", + "name": "Default", "type": "CORE:Blueprint", "attributes": [ { @@ -17,6 +17,12 @@ "type": "CORE:BlueprintAttribute", "attributeType": "string", "dimensions": "*,*" + }, + { + "name": "dimensional", + "type": "CORE:BlueprintAttribute", + "attributeType": "string", + "dimensions": "4,5" } ] } diff --git a/example/app/data/DemoDataSource/plugins/data_grid/default/default.entity.json b/example/app/data/DemoDataSource/plugins/data_grid/default/default.entity.json new file mode 100644 index 000000000..ef13b077a --- /dev/null +++ b/example/app/data/DemoDataSource/plugins/data_grid/default/default.entity.json @@ -0,0 +1,19 @@ +{ + "_id": "Default", + "type": "./blueprints/Default", + "name": "Default", + "data": [ + ["Dodge", "Bentley Model T", "Extended Cab Pickup", "1D3MX48D48B28FPJU"], + ["Volvo", "Volvo Camry", "Cargo Van", "5XYZGDAG8BDE8J42H"], + ["Lamborghini", "Smart ATS", "Sedan", "3FTEW31R691XKD94Y"], + ["Land Rover", "Mazda Countach", "Crew Cab Pickup", "3GTP2WE3XBUUMTGXS"], + ["Ford", "Jeep Spyder", "Wagon", "1G1ZS51F37ETTZW4Y"] + ], + "dimensional": [ + ["Dodge", "Bentley Model T", "Extended Cab Pickup", "1D3MX48D48B28FPJU"], + ["Volvo", "Volvo Camry", "Cargo Van", "5XYZGDAG8BDE8J42H"], + ["Lamborghini", "Smart ATS", "Sedan", "3FTEW31R691XKD94Y"], + ["Land Rover", "Mazda Countach", "Crew Cab Pickup", "3GTP2WE3XBUUMTGXS"], + ["Ford", "Jeep Spyder", "Wagon", "1G1ZS51F37ETTZW4Y"] + ] +} diff --git a/example/app/data/DemoDataSource/plugins/data_grid/multi_type/multiType.entity.json b/example/app/data/DemoDataSource/plugins/data_grid/multi_type/multiType.entity.json deleted file mode 100644 index 7eed6013d..000000000 --- a/example/app/data/DemoDataSource/plugins/data_grid/multi_type/multiType.entity.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "_id": "MultiType", - "type": "./blueprints/MultiType", - "name": "MultiType", - "data": [ - ["MooringLine1", "type1", "anch0", "fair0", "4367.5", "3247.5", "true"], - ["MooringLine2", "type2", "anch1", "fair1", "4438.3", "3848.3", "true"], - ["MooringLine3", "type3", "anch2", "fair2", "4585.0", "3545.0", "true"], - ["MooringLine4", "type4", "anch3", "fair3", "4399.6", "3149.6", "false"] - ] -} diff --git a/example/app/data/DemoDataSource/recipes/plugins/data_grid/default/default.recipe.json b/example/app/data/DemoDataSource/recipes/plugins/data_grid/default/default.recipe.json new file mode 100644 index 000000000..b920e6bb8 --- /dev/null +++ b/example/app/data/DemoDataSource/recipes/plugins/data_grid/default/default.recipe.json @@ -0,0 +1,158 @@ +{ + "type": "CORE:RecipeLink", + "_blueprintPath_": "/plugins/data_grid/default/blueprints/Default", + "initialUiRecipe": { + "name": "ViewSelector", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/view_selector/tabs", + "config": { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorConfig", + "items": [ + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Default", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Default", + "type": "CORE:UiRecipe", + "description": "Single multidimensional primitive", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["data"] + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Set dimensions", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Set Dimensions", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["dimensional"], + "title": "Datagrid with set dimensions", + "description": "Dimensions are set to 4,5" + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Custom labels", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Custom labels", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["dimensional"], + "title": "Datagrid with custom labels", + "description": "Set dimensions: 4,5. Custom column and row labels.", + "columnLabels": ["Manufacturer", "Name", "Type", "VIN"], + "rowLabels": ["John", "Joe", "Jason", "Jack", "Jay"] + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Combined labels", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Combined labels", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["dimensional"], + "title": "Datagrid with combined labels", + "description": "Set dimensions: 4,5. Combined custom and pre-defined column and row labels.", + "columnLabels": ["Manufacturer", "Name", "Type", "VIN"], + "rowLabels": ["John", "...123"] + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Hidden labels", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Hidden labels", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["dimensional"], + "title": "Hidden labels", + "editable": false, + "description": "Hide labels for rows and columns. Set dimensions: 4,5.", + "showColumns": false, + "showRows": false + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "No-edit columns and rows", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "No-edit columns and rows", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["data"], + "title": "No-edit columns and rows", + "description": "No-edit columns and rows. No set dimensions.", + "adjustableColumns": false, + "adjustableRows": false + } + }, + "scope": "self" + } + }, + { + "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", + "label": "Non-editable", + "viewConfig": { + "type": "CORE:InlineRecipeViewConfig", + "recipe": { + "name": "Non-editable", + "type": "CORE:UiRecipe", + "plugin": "@development-framework/dm-core-plugins/data_grid", + "config": { + "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", + "fieldNames": ["data"], + "title": "Non-editable datagrid", + "editable": false, + "description": "Non-editable. Unknown dimensions. Custom column and row labels.", + "columnLabels": ["Manufacturer", "Name", "Type", "VIN"], + "rowLabels": ["John", "Joe", "Jason", "Jack", "Jay"] + } + }, + "scope": "self" + } + } + ] + } + } +} diff --git a/example/app/data/DemoDataSource/recipes/plugins/data_grid/multi_type/multiType.recipe.json b/example/app/data/DemoDataSource/recipes/plugins/data_grid/multi_type/multiType.recipe.json deleted file mode 100644 index 872922a83..000000000 --- a/example/app/data/DemoDataSource/recipes/plugins/data_grid/multi_type/multiType.recipe.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "CORE:RecipeLink", - "_blueprintPath_": "/plugins/data_grid/multi_type/blueprints/MultiType", - "initialUiRecipe": { - "name": "ViewSelector", - "type": "CORE:UiRecipe", - "plugin": "@development-framework/dm-core-plugins/view_selector/tabs", - "config": { - "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorConfig", - "items": [ - { - "type": "PLUGINS:dm-core-plugins/view_selector/ViewSelectorItem", - "viewConfig": { - "type": "CORE:InlineRecipeViewConfig", - "recipe": { - "name": "multi_type", - "type": "CORE:UiRecipe", - "description": "Multitype datagrid", - "plugin": "@development-framework/dm-core-plugins/data_grid", - "config": { - "type": "PLUGINS:dm-core-plugins/data_grid/DataGridPluginConfig", - "fieldName": "data" - } - }, - "scope": "self" - } - } - ] - } - } -}