function getHeaderText()

in karavan-designer/src/designer/route/element/DslElementHeader.tsx [274:294]


    function getHeaderText(step: CamelElement): string {
        if (isKamelet() && step.dslName === 'ToDefinition' && (step as any).uri === 'kamelet:sink') {
            return "Sink";
        } else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') {
            return "Source";
        } else {
            const description: string = (step as any).description;
            if (description === undefined && step.dslName.startsWith('Set')) {
                const name = (step as any).name || '';
                const result = CamelUi.getElementTitle(step).concat(' ', name);
                return result.length > 32 ? result.substring(0, 32).concat("...") : result;
            } else if (description === undefined && step.dslName.startsWith('Convert')) {
                const type = (step as any).type || '';
                const result = CamelUi.getElementTitle(step).concat(' ', type);
                return result.length > 32 ? result.substring(0, 32).concat("...") : result;
            } else {
                const result = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description;
                return result || CamelUi.getElementTitle(step);
            }
        }
    }