Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public friendTypeName() {
return Ro.friendlyTypeName(this.domainType);
}
}
private renderFieldDetails(field: Ro.IField, value: Ro.Value): string {
const fieldName = Usermessages.fieldName(field.extensions().friendlyName());
const desc = field.extensions().description();
const descAndPrefix = desc ? `\n${Usermessages.descriptionFieldPrefix} ${desc}` : '';
const types = `\n${Usermessages.typePrefix} ${Ro.friendlyTypeName(field.extensions().returnType()!)}`;
let postFix = '';
if (field instanceof Ro.PropertyMember && field.disabledReason()) {
postFix = `\n${Usermessages.unModifiablePrefix(field.disabledReason())}`;
} else {
postFix = field.extensions().optional() ? `\n${Usermessages.optional}` : `\n${Usermessages.mandatory}`;
const choices = field.choices();
if (choices) {
const label = `\n${Usermessages.choices}: `;
const labelAndChoices = reduce(choices, (ss, cho) => ss + cho + ' ', label);
postFix = `${postFix}${labelAndChoices}`;
}
}
return `${fieldName}${descAndPrefix}${types}${postFix}`;
}
}