## Description QA branch for mobile responsiveness --------- Co-authored-by: Aswath K <aswath@appsmith.com> Co-authored-by: Arsalan Yaldram <arsalanyaldram0211@outlook.com> Co-authored-by: Aswath K <aswath.sana@gmail.com> Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com> Co-authored-by: rahulramesha <rahul@appsmith.com>
34 lines
835 B
TypeScript
34 lines
835 B
TypeScript
import type { UpdatePropertyArgs } from "sagas/WidgetBlueprintSagas";
|
|
|
|
/**
|
|
* Util method that makes it easier
|
|
* and takes in readable updates and converts them to blueprint updates
|
|
* @param widgetUpdates
|
|
* @returns
|
|
*/
|
|
export function getWidgetBluePrintUpdates(widgetUpdates: {
|
|
[key: string]: any;
|
|
}): UpdatePropertyArgs[] {
|
|
const widgetIds = Object.keys(widgetUpdates);
|
|
|
|
const updates: UpdatePropertyArgs[] = [];
|
|
|
|
for (const widgetId of widgetIds) {
|
|
const updateProps = widgetUpdates[widgetId];
|
|
|
|
if (updateProps) {
|
|
const propertyNames = Object.keys(updateProps);
|
|
|
|
for (const propertyName of propertyNames) {
|
|
updates.push({
|
|
widgetId: widgetId,
|
|
propertyName: propertyName,
|
|
propertyValue: updateProps[propertyName],
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
return updates;
|
|
}
|