Skip to content

Commit

Permalink
Merge pull request #1545 from open-formulieren/feature/1544-unclear-l…
Browse files Browse the repository at this point in the history
…abels

[#1544] Component selection: added key in brackets
  • Loading branch information
sergei-maertens authored Apr 28, 2022
2 parents a6b4c72 + 19b760d commit 7e28cc0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/openforms/js/components/admin/form_design/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const getFormComponents = (formSteps = []) => {
step => {
let compMap = FormioUtils.flattenComponents(step.configuration.components || [], true)
return Object.fromEntries(Object.entries(compMap).map(([key, component]) => {
const stepLabel = `${step.internalName || step.name}: ${component.label || component.key}`;
let stepLabel;
if (component.label) {
stepLabel = `${step.internalName || step.name}: ${component.label} (${component.key})`;
} else {
stepLabel = `${step.internalName || step.name}: ${component.key}`;
}
return [key, {...component, stepLabel}];
}));
}).reduce((acc, currentValue) => ({...acc, ...currentValue}), {});
Expand Down

0 comments on commit 7e28cc0

Please sign in to comment.