Skip to content

Commit

Permalink
NU-1882 rename Add list item to "Suggested values" and "Possible values"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzuming committed Nov 19, 2024
1 parent 74022e2 commit b776b63
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion designer/client/cypress/e2e/fragment.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:")}
/>
<InitialValue
path={path}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const FixedListVariant = ({ item, path, onChange, readOnly, variableTypes
typ={item.typ}
name={item.name}
initialValue={item.initialValue}
userDefinedListInputLabel={t("fragment.userDefinedList.label.possibleValues", "Possible values:")}
/>
<InitialValue
path={path}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface FixedValuesSetting extends Pick<FixedListParameterVariant, "presetSele
typ: ReturnedType;
name: string;
initialValue: FixedValuesOption;
userDefinedListInputLabel: string;
}

export function FixedValuesSetting({
Expand All @@ -30,6 +31,7 @@ export function FixedValuesSetting({
typ,
name,
initialValue,
userDefinedListInputLabel,
}: FixedValuesSetting) {
return (
<>
Expand All @@ -47,6 +49,7 @@ export function FixedValuesSetting({
typ={typ}
name={name}
initialValue={initialValue}
inputLabel={userDefinedListInputLabel}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Props {
typ: ReturnedType;
name: string;
initialValue: FixedValuesOption;
inputLabel?: string;
}

export const UserDefinedListInput = ({
Expand All @@ -39,6 +40,7 @@ export const UserDefinedListInput = ({
typ,
name,
initialValue,
inputLabel,
}: Props) => {
const { t } = useTranslation();
const [temporaryListItem, setTemporaryListItem] = useState("");
Expand Down Expand Up @@ -166,7 +168,7 @@ export const UserDefinedListInput = ({

return (
<FormControl>
<SettingLabelStyled>{t("fragment.addListItem", "Add list item:")}</SettingLabelStyled>
<SettingLabelStyled>{inputLabel || t("fragment.addListItem", "Add list item:")}</SettingLabelStyled>
<Box width={"80%"} flex={1}>
<Stack direction="row" paddingY={1} spacing={1} justifyContent={"space-between"} alignItems={"start"}>
<EditableEditor
Expand Down

0 comments on commit b776b63

Please sign in to comment.