fix: plugin/download-counter: missing default value

Massimo Melina committed Apr 13, 2023 at 16:20 UTC 2c6b4b9aa1e732faaf5124526ae6a5efef7d64bf
2 files changed +6 -4
dev-plugins.md
+3 -3
@@ -50,9 +50,9 @@ All the following properties are essentially optional.
50 - `unload: function` called when unloading a plugin. This is a good place for example to clearInterval().
51 - `onDirEntry: ({ entry: DirEntry, listPath: string }) => void | false` by providing this callback you can manipulate the record
52 that is sent to the frontend (`entry`), or you can return false to exclude this entry from the results.
53 -- `config: { [key]: FieldDescriptor }` declare a set of admin-configurable values owned by the plugin that will be displayed inside Admin-panel for change.
54 - Each property is identified by its key, and the descriptor is another object with options about the field.
55 - A simple empty object `{}` is a text field.
53 +- `config: { [key]: FieldDescriptor }` declare a set of admin-configurable values owned by the plugin
54 + that will be displayed inside Admin-panel for change. Each property is identified by its key,
55 + and the descriptor is another object with options about the field.
56
57 Eg: you want a `message` text. You add this to your `plugin.js`:
58 ```js
plugins/download-counter/plugin.js
+3 -1
@@ -3,7 +3,9 @@ exports.version = 4 // config.where
3 exports.apiRequired = 8
4
5 exports.config = {
6 - where: { frontend: true, type: 'select', options: ['list', 'menu'] }
6 + where: { frontend: true, type: 'select', defaultValue: 'menu',
7 + options: ['list', { value: 'menu', label: "file menu" }],
8 + }
9 }
10 exports.configDialog = {
11 sx: { maxWidth: '20em' },