From 06266575b2f245fa6e0773dcb7bfadac0f166fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20=C5=BBegle=C5=84?= Date: Fri, 9 Apr 2021 13:17:34 +0200 Subject: [PATCH] Add multiline field plugins (#974) * Update schema * Add multiline field to plugins * Update changelog * Update stories * Update stories * -Trigger CI --- CHANGELOG.md | 1 + .../PluginSettings/PluginSettings.tsx | 6 + src/plugins/fixtures.ts | 9 ++ .../__snapshots__/Stories.test.ts.snap | 112 ++++++++++++++++++ 4 files changed, 128 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4317b3e2..643e15335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ All notable, unreleased changes to this project will be documented in this file. - Remove mailing settings - #1027 by @dominik-zeglen - Update schema to contain email plugin changes - #1029 by @dominik-zeglen - Unconfirmed order manipulation - #967 by @tomaszszymanski129 +- Add multiline field plugins - #974 by @dominik-zeglen # 2.11.1 diff --git a/src/plugins/components/PluginSettings/PluginSettings.tsx b/src/plugins/components/PluginSettings/PluginSettings.tsx index dcf4c6977..0f6f7761e 100644 --- a/src/plugins/components/PluginSettings/PluginSettings.tsx +++ b/src/plugins/components/PluginSettings/PluginSettings.tsx @@ -107,6 +107,12 @@ const PluginSettings: React.FC = ({ helperText={fieldData.helpText} label={fieldData.label} name={field.name} + multiline={ + fieldData.type === ConfigurationTypeFieldEnum.MULTILINE + } + InputProps={{ + rowsMax: 6 + }} fullWidth value={field.value} onChange={onChange} diff --git a/src/plugins/fixtures.ts b/src/plugins/fixtures.ts index fd0133132..e1608aa5d 100644 --- a/src/plugins/fixtures.ts +++ b/src/plugins/fixtures.ts @@ -72,6 +72,15 @@ export const plugin: Plugin_plugin = { name: "Use sandbox", type: ConfigurationTypeFieldEnum.BOOLEAN, value: "true" + }, + { + __typename: "ConfigurationItem", + helpText: "This is a multiline field", + label: "Multiline Field", + name: "multiline-field", + type: ConfigurationTypeFieldEnum.MULTILINE, + value: + "Lorem ipsum\ndolor sit\namet enim.\nEtiam ullamcorper.\nSuspendisse a\npellentesque dui,\nnon felis." } ], description: diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 6faef0cbb..9fad2550a 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -146671,6 +146671,62 @@ exports[`Storyshots Views / Plugins / Plugin details default 1`] = ` /> +
+
+ +
+ + +