* feat: Add Scanner Variant - Click to scan and always on to code scanenr * feat: Enhancements for code scanner's property pane - update help text, hide properties on always on * feat: Add Image Mirror button to code scanner * feat: Update code scanner video fit to contain * feat: Add DSL migrations for Code Scanner * feat: Make always on the default scanner layout, rename scannerVarient to scannerLayout * feat: Stop scanning and detecting codes in background for code scanner widget * test: Add Cypress tests for different scanner layouts for code scanner * refactor: fix minor code callouts here and there * refactor: Restructure cypress test suite * feat: Increase code scanner delay to avoid unintended detections * refactor: combine two different conditions into one ternary * feat: Remove one cy test case Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
19 lines
544 B
TypeScript
19 lines
544 B
TypeScript
import { WidgetProps } from "widgets/BaseWidget";
|
|
import { DSLWidget } from "widgets/constants";
|
|
|
|
export const migrateCodeScannerLayout = (currentDSL: DSLWidget) => {
|
|
currentDSL.children = currentDSL.children?.map((child: WidgetProps) => {
|
|
if (child.type === "CODE_SCANNER_WIDGET") {
|
|
if (!child.scannerLayout) {
|
|
child.scannerLayout = "CLICK_TO_SCAN";
|
|
}
|
|
} else if (child.children && child.children.length > 0) {
|
|
child = migrateCodeScannerLayout(child);
|
|
}
|
|
|
|
return child;
|
|
});
|
|
|
|
return currentDSL;
|
|
};
|