Skip to content
Snippets Groups Projects
Commit 7dd56bec authored by rhenck's avatar rhenck
Browse files

Fix likert option image position sanitization

parent b3e870b5
No related branches found
No related tags found
No related merge requests found
......@@ -372,13 +372,19 @@ export class SanitizationService {
return newElement as DropListElement;
}
private handleLikertElement(element: LikertElement): LikertElement {
return new LikertElement({
private handleLikertElement(element: Partial<LikertElement>): LikertElement {
element.options = element.options || element.columns as any;
return {
...element,
options: element.options || element.columns,
options: element.options?.map(option => ({
text: option.text,
imgSrc: option.imgSrc,
imgPosition: option.imgPosition || (option as any).position
})),
rows: element.rows
.map((row: LikertRowElement) => this.sanitizeElement(row as Record<string, UIElementValue>) as LikertRowElement)
});
?.map((row: LikertRowElement) => (
this.sanitizeElement(row as Record<string, UIElementValue>) as LikertRowElement))
} as LikertElement;
}
private static handleLikertRowElement(element: Record<string, UIElementValue>): Partial<LikertRowElement> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment