Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2022-01-18 15:29:23 +0300
committerGitHub <noreply@github.com>2022-01-18 15:29:23 +0300
commitb1b6d17e0f37b69e16bb874546e88a8ea74d3ec4 (patch)
tree97df186dff60b16cb750ad2f473c4b4d93fca6f1 /core
parent0e730b7042fb784a91dd678a3d028b2beebd0e74 (diff)
support custom field component in multipair and array field config (#18626)
Diffstat (limited to 'core')
-rw-r--r--core/Settings/FieldConfig/ArrayField.php9
-rw-r--r--core/Settings/FieldConfig/MultiPair.php10
2 files changed, 19 insertions, 0 deletions
diff --git a/core/Settings/FieldConfig/ArrayField.php b/core/Settings/FieldConfig/ArrayField.php
index 8410cf4c04..9628e29255 100644
--- a/core/Settings/FieldConfig/ArrayField.php
+++ b/core/Settings/FieldConfig/ArrayField.php
@@ -40,6 +40,14 @@ class ArrayField
public $customUiControlTemplateFile = '';
/**
+ * Array like ['plugin' => 'MyPlugin', 'component' => 'MyExportedCustomFieldComponent']. For an example see
+ * "plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue"
+ *
+ * @var string[]
+ */
+ public $customFieldComponent = null;
+
+ /**
* This setting's display name, for example, `'Refresh Interval'`.
*
* Be sure to escape any user input as HTML can be used here.
@@ -72,6 +80,7 @@ class ArrayField
'title' => $this->title,
'uiControl' => $this->uiControl,
'templateFile' => $this->customUiControlTemplateFile,
+ 'component' => $this->customFieldComponent,
'availableValues' => $this->availableValues,
);
}
diff --git a/core/Settings/FieldConfig/MultiPair.php b/core/Settings/FieldConfig/MultiPair.php
index 40b27c97bd..22788e76b4 100644
--- a/core/Settings/FieldConfig/MultiPair.php
+++ b/core/Settings/FieldConfig/MultiPair.php
@@ -44,10 +44,19 @@ class MultiPair
* "formField.value" angular model. For an example see "plugins/CorePluginsAdmin/angularjs/form-field/field-text.html"
*
* @var string
+ * @deprecated use customFieldComponent instead
*/
public $customUiControlTemplateFile = '';
/**
+ * Array like ['plugin' => 'MyPlugin', 'component' => 'MyExportedCustomFieldComponent']. For an example see
+ * "plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue"
+ *
+ * @var string[]
+ */
+ public $customFieldComponent = null;
+
+ /**
* This setting's display name, for example, `'Refresh Interval'`.
*
* Be sure to escape any user input as HTML can be used here.
@@ -82,6 +91,7 @@ class MultiPair
'title' => $this->title,
'uiControl' => $this->uiControl,
'templateFile' => $this->customUiControlTemplateFile,
+ 'component' => $this->customFieldComponent,
'availableValues' => $this->availableValues,
);
}