From e752ba7c6abcdde229258aa1562e6de518c3556e Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 25 Sep 2019 21:57:22 +0100 Subject: [PATCH] Use the dependents and parent-plugin fields to automatically install dependencies --- core/ui/ControlPanel/Modals/AddPlugins.tid | 17 +++++++++++++++++ plugins/tiddlywiki/aws/plugin.info | 3 ++- plugins/tiddlywiki/text-slicer/plugin.info | 3 ++- plugins/tiddlywiki/xlsx-utils/plugin.info | 3 ++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/core/ui/ControlPanel/Modals/AddPlugins.tid b/core/ui/ControlPanel/Modals/AddPlugins.tid index 95159bc9b..f5b35b53c 100644 --- a/core/ui/ControlPanel/Modals/AddPlugins.tid +++ b/core/ui/ControlPanel/Modals/AddPlugins.tid @@ -5,6 +5,13 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/
<$button class={{{ [get[original-title]get[version]then[tc-reinstall]] tc-btn-invisible tc-install-plugin +[join[ ]] }}}> <$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/> +<$set name="url" value={{!!url}}> +<$set name="currentTiddler" value=<>> +<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[title]]" variable="dependency"> +<$action-sendmessage $message="tm-load-plugin-from-library" url=<> title=<>/> + + + {{$:/core/images/download-button}} <$list filter="[get[original-title]get[version]]" variable="installedVersion" emptyMessage="""{{$:/language/ControlPanel/Plugins/Install/Caption}}"""> {{$:/language/ControlPanel/Plugins/Reinstall/Caption}} @@ -57,6 +64,16 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ {{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}} +<$set name="currentTiddler" value=<>> +<$list filter="[enlist{!!dependents}] [get[parent-plugin]] +[limit[1]]" variable="ignore"> +
+Also requires: +<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[title]]" variable="dependency"> +<$text text=<>/> + +
+ +
<$transclude tiddler=<> field="readme" mode="block"/> diff --git a/plugins/tiddlywiki/aws/plugin.info b/plugins/tiddlywiki/aws/plugin.info index 89f248824..e01c82d7c 100644 --- a/plugins/tiddlywiki/aws/plugin.info +++ b/plugins/tiddlywiki/aws/plugin.info @@ -2,5 +2,6 @@ "title": "$:/plugins/tiddlywiki/aws", "name": "AWS", "description": "Amazon Web Services extensions and tools", - "list": "readme setup commands lambda" + "list": "readme setup commands lambda", + "dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"] } diff --git a/plugins/tiddlywiki/text-slicer/plugin.info b/plugins/tiddlywiki/text-slicer/plugin.info index 937014060..a05456570 100644 --- a/plugins/tiddlywiki/text-slicer/plugin.info +++ b/plugins/tiddlywiki/text-slicer/plugin.info @@ -2,5 +2,6 @@ "title": "$:/plugins/tiddlywiki/text-slicer", "name": "Text Slicer", "description": "Tools for slicing text into tiddlers", - "list": "readme docs" + "list": "readme docs", + "dependents": ["$:/plugins/tiddlywiki/sax"] } diff --git a/plugins/tiddlywiki/xlsx-utils/plugin.info b/plugins/tiddlywiki/xlsx-utils/plugin.info index 1fe58b75e..b269439a2 100644 --- a/plugins/tiddlywiki/xlsx-utils/plugin.info +++ b/plugins/tiddlywiki/xlsx-utils/plugin.info @@ -2,5 +2,6 @@ "title": "$:/plugins/tiddlywiki/xlsx-utils", "name": "XLSX Utils", "description": "XLSX spreadsheet utilities", - "list": "readme controls license" + "list": "readme controls license", + "dependents": ["$:/plugins/tiddlywiki/jszip"] }