Skip to content

Commit

Permalink
feat(FOROME-1304): change button text (#814)
Browse files Browse the repository at this point in the history
* feat(FOROME-1304): change button text

* feat(FOROME-1304): remove quotes
  • Loading branch information
EvgeniySobolev authored Jul 18, 2022
1 parent 50795a7 commit 547b3c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface ISolutionControlPopoverProps extends IPopoverBaseProps {
onSelect: (solutionName: string) => void
onModify: (solutionName: string) => void
onDelete: (solutionName: string) => void
controlName: string
solutions: ISolutionEntryDescription[] | undefined
modifiedSolution?: string
selected: string
Expand All @@ -26,6 +27,7 @@ export const SolutionControlPopover = ({
solutions,
selected,
modifiedSolution,
controlName,
onSelect,
onApply,
onJoin,
Expand All @@ -34,6 +36,13 @@ export const SolutionControlPopover = ({
onClose,
...popoverProps
}: ISolutionControlPopoverProps): ReactElement => {
const applyButtonDictionary = {
[t('solutionControl.filterPreset')]: t('filter.applyCriterium'),
[t('solutionControl.decisionTree')]: t('dtree.applyFilter'),
}

const applyButtonText = applyButtonDictionary[controlName]

return (
<Popover onClose={onClose} offset={popoverOffset} {...popoverProps}>
<section className={styles.solutionControlCard}>
Expand Down Expand Up @@ -85,7 +94,7 @@ export const SolutionControlPopover = ({
textSize="sm"
padding="dense"
className={styles.solutionControlCard__button}
text={t('solutionControl.apply')}
text={applyButtonText}
disabled={!selected}
onClick={() => {
onClose?.()
Expand Down
1 change: 1 addition & 0 deletions src/components/solution-control/solution-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const SolutionControl = ({
<SolutionControlPopover
isOpen={isPopoverOpen}
onClose={closePopover}
controlName={controlName}
anchorEl={popoverAnchor}
solutions={solutions}
modifiedSolution={modifiedSolution}
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const en = {
selectSolution: 'Select {controlName}',
createEntry: 'Create {solutionName}',
join: 'Join',
apply: 'Apply Filter',
delete: 'Delete',
modify: 'Modify',
createDialog: {
Expand Down Expand Up @@ -240,6 +239,7 @@ export const en = {
functionalUnits: 'Functional Units',
},
filter: {
applyCriterium: 'Apply criterium',
switcher: 'Only starts with',
method: 'Filtering method',
results: 'Results',
Expand Down

0 comments on commit 547b3c3

Please sign in to comment.