Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions webapp/packages/core-sdk/src/getObjectPropertyValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
import { getObjectPropertyType, type ObjectPropertyType } from './getObjectPropertyType.js';
import type { IObjectPropertyInfo, ObjectPropertyOption, ObjectPropertyOptionValue } from './IObjectPropertyInfo.js';

export function getObjectPropertyValue(property: IObjectPropertyInfo) {

Check warning on line 12 in webapp/packages/core-sdk/src/getObjectPropertyValue.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
const controlType = getObjectPropertyType(property);
return getValue(property.value, controlType);
}

export function getObjectPropertyDefaultValue(property: IObjectPropertyInfo) {

Check warning on line 17 in webapp/packages/core-sdk/src/getObjectPropertyValue.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
const controlType = getObjectPropertyType(property);
return getValue(property.defaultValue, controlType);
}

export function getObjectPropertyDisplayValue(property: IObjectPropertyInfo) {

Check warning on line 22 in webapp/packages/core-sdk/src/getObjectPropertyValue.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
const controlType = getObjectPropertyType(property);
return String(getValue(property.value, controlType));
}

function getValue(value: any, controlType: ObjectPropertyType) {
function getValue(value: any, controlType: ObjectPropertyType): any {
const checkbox = controlType === 'checkbox';

if (value === null || value === undefined) {
Expand All @@ -40,7 +40,7 @@
}

if (Array.isArray(value)) {
return value.join(', ');
return `[${value.map(v => getValue(v, controlType)).join(', ')}]`;
}

return value.value || value.displayName || JSON.stringify(value);
Expand Down
Loading