From b776b63298ed02be1f385b7775df0d1ba89a60f5 Mon Sep 17 00:00:00 2001 From: Dawid Poliszak Date: Tue, 19 Nov 2024 14:32:03 +0100 Subject: [PATCH] NU-1882 rename Add list item to "Suggested values" and "Possible values" --- designer/client/cypress/e2e/fragment.cy.ts | 2 +- .../StringBooleanVariants/AnyValueWithSuggestionVariant.tsx | 1 + .../variants/StringBooleanVariants/FixedListVariant.tsx | 1 + .../settings/variants/fields/FixedValuesSetting.tsx | 3 +++ .../settings/variants/fields/UserDefinedListInput.tsx | 4 +++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/designer/client/cypress/e2e/fragment.cy.ts b/designer/client/cypress/e2e/fragment.cy.ts index c31cfcd6b48..7545c06fcf9 100644 --- a/designer/client/cypress/e2e/fragment.cy.ts +++ b/designer/client/cypress/e2e/fragment.cy.ts @@ -66,7 +66,7 @@ describe("Fragment", () => { cy.get("[data-testid='settings:4']").contains("Typing...").should("not.exist"); cy.get("[data-testid='settings:4']").find("[id='ace-editor']").type("{enter}"); cy.get("[data-testid='settings:4']") - .contains(/Add list item/i) + .contains(/Suggested values/i) .siblings() .eq(0) .find("[data-testid='form-helper-text']") diff --git a/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/AnyValueWithSuggestionVariant.tsx b/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/AnyValueWithSuggestionVariant.tsx index 9e44691e5bb..2139a7e6a8d 100644 --- a/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/AnyValueWithSuggestionVariant.tsx +++ b/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/StringBooleanVariants/AnyValueWithSuggestionVariant.tsx @@ -44,6 +44,7 @@ export const AnyValueWithSuggestionVariant = ({ item, path, onChange, variableTy typ={item.typ} name={item.name} initialValue={item.initialValue} + userDefinedListInputLabel={t("fragment.userDefinedList.label.suggestedValues", "Suggested values:")} /> @@ -47,6 +49,7 @@ export function FixedValuesSetting({ typ={typ} name={name} initialValue={initialValue} + inputLabel={userDefinedListInputLabel} /> )} diff --git a/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/UserDefinedListInput.tsx b/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/UserDefinedListInput.tsx index f2d5ffe005c..a6fac7ca079 100644 --- a/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/UserDefinedListInput.tsx +++ b/designer/client/src/components/graph/node-modal/fragment-input-definition/settings/variants/fields/UserDefinedListInput.tsx @@ -27,6 +27,7 @@ interface Props { typ: ReturnedType; name: string; initialValue: FixedValuesOption; + inputLabel?: string; } export const UserDefinedListInput = ({ @@ -39,6 +40,7 @@ export const UserDefinedListInput = ({ typ, name, initialValue, + inputLabel, }: Props) => { const { t } = useTranslation(); const [temporaryListItem, setTemporaryListItem] = useState(""); @@ -166,7 +168,7 @@ export const UserDefinedListInput = ({ return ( - {t("fragment.addListItem", "Add list item:")} + {inputLabel || t("fragment.addListItem", "Add list item:")}