mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
Merge branch 'WorkflowChange' of https://github.com/Tria-plc/emaui into estif-branch-1
This commit is contained in:
@@ -264,6 +264,16 @@ export interface WizardStep {
|
||||
* the stepper short. Anything ungrouped keeps a step of its own, so a licence
|
||||
* type that has not been grouped still behaves exactly as before.
|
||||
*/
|
||||
/** "identitySummary" -> "Identity Summary". Last resort for an untitled group. */
|
||||
function humanise(key: string): string {
|
||||
return key
|
||||
.replace(/[_-]+/g, ' ')
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
.replace(/^./, (c) => c.toUpperCase());
|
||||
}
|
||||
|
||||
export function buildWizardSteps(
|
||||
sections: FormSectionConfig[],
|
||||
formData: Record<string, Record<string, unknown>>,
|
||||
@@ -304,7 +314,11 @@ export function buildWizardSteps(
|
||||
}
|
||||
const step: WizardStep = {
|
||||
key: `group:${group}`,
|
||||
label: group,
|
||||
// A group is a config key, not a caption — showing it raw put
|
||||
// "identitySummary" and "applicant" in front of applicants. The first
|
||||
// section's own title is the readable name for the step it opens; the
|
||||
// humanised key is the fallback when a section carries no title.
|
||||
label: localized(section.title, options?.language) || humanise(group),
|
||||
kind: 'sections',
|
||||
sections: [section],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user