PromucFlow_constructor/app/client/src/utils/DSLMigrationsUtils.test.ts

1806 lines
76 KiB
TypeScript
Raw Normal View History

import { transformDSL } from "./DSLMigrations";
import { LATEST_PAGE_VERSION, RenderModes } from "constants/WidgetConstants";
import { ContainerWidgetProps } from "widgets/ContainerWidget/widget";
import { WidgetProps } from "widgets/BaseWidget";
import { OverflowTypes } from "widgets/TextWidget/constants";
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600) * feat: When there are multiple input widgets with different label lengths then the input box looks misaligned -- Create a new property control for a label position -- Create a new property control for a label alignment -- Prototype a label section for Input widget * feat: When there are multiple input widgets with different label lengths then the input box looks misaligned -- Add a property, labelWidth in the property pane * feat: Controls for labels in widgets to align the widgets in forms and other places -- Input widget: Implement all the requirements in case its type is Text * feat: Controls for labels in widgets to align the widgets in forms and other places -- Adapt the functionalty on other types of the input widget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into DropdownWidget -- Clean up for the input widget and DRY * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into MultiSelectWidget -- Eliminate unnecessary component prop, columns * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalties into Tree Select widget -- Add styles for alignment between lable and input control over the widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into MultiSelectTreeWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Introduce label functionalities into DatePickerWidget2 -- Use width instead of columns prop in InputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into RichTextEditorWidget -- Eliminate compactMode from StyledLabel * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into CheckboxGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement switch group for the correct meaning of right alignment * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into RadioGroupWidget -- Add new properties, alignment and inline for consistency * feat: Controls for labels in widgets to align the widgets in forms and other places -- Adjust cols and rows for RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused StyledRadioProps * feat: Controls for labels in widgets to align the widgets in forms and other places -- Complete first MVP of enhanced SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Complete the first MVP of enhanced RadioGroupWidget -- Eliminate unused StyledSwitch component for SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add min-height, align-self rules for LabelContainer * feat: Controls for labels in widgets to align the widgets in forms and other places -- Use original label property for RadioGroupWidget -- Add a migration for adding isInline and alignment properties for RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Update version to latest one in DSLMigrationsUtils.test.ts * fix failing jest test * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused imports in DSLMigrationsUtils * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the label related test case which is failed in Input_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on #10119: The label text truncates on resizing the input widget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget * fix: Widget Popup test * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement width and alginment features on the level of label element -- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing -- Enable label feature on a RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set label container's default width to 33% when width is not set * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set flex-grow to zero on input types other than TEXT * feat: Controls for labels in widgets to align the widgets in forms and other places -- Implement label features on newly created MultiSelectWidgetV2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate LabelPositionTypes, directly using enum LabelPosition -- Add a comment for a constant LABEL_MAX_WIDTH_RATE -- Directly import React for LabelAlignmentOptionsControl -- Remove unnecessary constructor for LabelAlignmentOptionsControl -- Define handleAlign instance method as a higher-order function -- Only migrate alignment property for RadioGroupWidget -- Use Object.hasOwnProperty instead of in operator * feat: Controls for labels in widgets to align the widgets in forms and other places -- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Revert currentDSL.version to 52 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add a Jest test case for RadioGroupWidget's alignment property migration * feat: Controls for labels in widgets to align the widgets in forms and other places -- Replace all nested ternary operators with if statements * feat: Controls for labels in widgets to align the widgets in forms and other places -- Implement label feature on new version of SelectWidget -- Add Cypress tests for widgets' label section * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor code for BaseInputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change CSS selector for step buttons for Numeric BaseInputWidget -- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on typo about migrateRadioGroupAlignmentProperty * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add data-testid attributes for Cypress selectors * feat: Deprecate form button widget -- Assert flex-direction to row in CheckboxGroup_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add a missing data-testid for SelectWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2 * fix: Select popup DSL * feat: Controls for labels in widgets to align the widgets in forms and other places -- Create a new property control, NumericInputControl -- Replace all the label properties with the newly created controls * feat: Controls for labels in widgets to align the widgets in forms and other places -- Create a new Cypress command, checkLabelWidth and apply to all related test cases -- Increase width in checkboxgroupDsl.json -- Rename className for label in MultiSelectWidgetV2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement the tooltip feature for labels -- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency -- Apply default values into label section * feat: Controls for labels in widgets to align the widgets in forms and other places -- Extract the label related parts from the various widgets as an independent component * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate TypeScript any type from BaseInputComponent * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change labelPosition property type to DROP_DOWN -- Modify LabelAlignmentOptionsControl to use ButtonTabComponent * feat: Controls for labels in widgets to align the widgets in forms and other places -- Define getLabelWidth method into BaseWidget -- Extract the common CSS rules for the widget containers -- Revert rows and columns for SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the failed test case in DSLMigrationsUtils.test.ts * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on overflow issue on CheckboxGroupWidget -- Create a distinctive spec file for label feature -- Eliminate the redundant label specs with the relevant widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx -- Revise wrong comment for checkLabelForWidget Cypress command * feat: Controls for labels in widgets to align the widgets in forms and other places -- Do not set the label width only if its value is 0 -- Clean up the component for DatePickerWidget2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused imports in DatePickerWidget2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Make RadioGroupWidget's layout flexible in all modes * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec -- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change getLabelWidth method to not have any argument -- Define some constants for label numbers -- Extract the common styles for SwitchGroupWidget and RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor some constants * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused width prop from RadioGroupWidget -- Get labelWidth from getLabelWidth * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate the min-height restriction on a label -- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add one more condition checking if the current input type is text * feat: Controls for labels in widgets to align the widgets in forms and other places -- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2 -- Apply a few CSS fixes on the scrollbar issue select related widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply some tweaks for earlier widgets with labels so as not to be broken UX * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the failed Cypress test case in Widget_Popup_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT * feat: Controls for labels in widgets to align the widgets in forms and other places -- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set the font size to 14px for NumericInputControl Co-authored-by: ohansFavour <fohanekwu@gmail.com> Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
import { migrateRadioGroupAlignmentProperty } from "./migrations/RadioGroupWidget";
describe("correctly migrate dsl", () => {
it("AddsPrivateWidgetsToAllListWidgets", () => {
const currentVersion = 49;
const nextVersion = LATEST_PAGE_VERSION;
const currentDSL: ContainerWidgetProps<WidgetProps> = {
backgroundColor: "none",
bottomRow: 740,
canExtend: true,
children: [
{
widgetName: "Input1",
displayName: "Input",
iconSVG: "/static/media/icon.9f505595.svg",
topRow: 18,
bottomRow: 22,
parentRowSpace: 10,
autoFocus: false,
type: "INPUT_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 15.0625,
dynamicTriggerPathList: [],
resetOnSubmit: true,
leftColumn: 23,
dynamicBindingPathList: [],
labelStyle: "",
inputType: "TEXT",
isDisabled: false,
key: "ftefjorusw",
isRequired: false,
rightColumn: 43,
widgetId: "lz9hvhcltl",
isVisible: true,
label: "",
allowCurrencyChange: false,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
iconAlign: "left",
defaultText: "",
},
{
widgetName: "Button1",
onClick:
'{{Api1.run(()=>{\ndownload((\nfunction(){\nreturn "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQUExYUFBQWFhYYGBgYGBYWFhgWFhgYFhYYGBYYGBgZHioiGR4nHhgWIzMjJystMDAwGCE2OzYvOiovMC0BCwsLDw4PGBERGC8eHh4vLS8vLy0vLS8tLy8tLy8vLy8vLy8vLy8vLy8vLy8vLS0vLy8vLS8vLS8vLy0vLS8vL//AABEIAMEBBQMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQEGB//EAEcQAAICAQICBQYKBwYGAwAAAAECAAMRBCExQQUGElFhE3GBkdHwByIjMnOSobGywRQkQlJUcvEzU2KCk+FDY6KzwtIVFjT/xAAaAQEBAAMBAQAAAAAAAAAAAAABAAIEBQMG/8QAOREAAgECAgUJBQcFAAAAAAAAAAECAxEEQRIhMVFxBRMyYYGRsdHxI1KhwfAUIjNCcpKyBjRTguH/2gAMAwEAAhEDEQA/APkYEus4sJiBkQCXScSFQQZFwsIolqwIcJMRIghVGZwLCKICWUQi5la+MP2fvmIoGsvjf33hQvLE5jl/WQlexKEd2Yf1wTbSIXskWvaGde0TJUp3HKLBCxHn4y1PHeHK45en2SImTsD7+5kVihEIhzyhBueEsPNAQfku/wD2nbKcQ3OduQ4OPfeRCAlmrndwcn8vRCPvIAGBylHEPK2pMgF7RtANGLgRABc7yIC0G0PYsC8SBEQTCHIgXSQA8SToPm9MkiAJDIJRFh0mVwLpXLqsgha1mIl0WHVJxFh1gJFEv2d+EuiQ9dffMRQFE3xD9jeEFXhCVLg8JCD7Mqyc+Xn3hyn2SKnhAQTCVJ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1+aNepRmoSlzjdsn6sLo2PktP9Cv4njgBgujKs00fQr+J4+tG85VSSU5/ql/Jm1S6EeB5z4RsjSU7n555wHwU9IXNbbQWL1CvymGJbybB1UFcnbPaII54HdPTdM9Apq60rdnTsEnKhd8+eavVjq/VpEZKgfjEF3bBdscASANhvsNt5lLF0o4KVFq8m77NS13unvtu7dVzzqU5SrKaepJGrSMQWoqDK4PAo4PmKGOOm0x+tWtWjS2uT8ZlNdY73cY28wyfROPSi6k1GO2TS7z0lJRTbPjVeSoJ5ifaup/8A+LTfQVf9tZ8asTAn2jqef1LS/QU/9tZ9H/UPQpvrZp4P83Z8zRsM+U/Cv0hdVrKhXZYgOnQkIzAZ8tcMkDnsPVPrFm/CL6jHMAnxAM4GDrKjVjNx0rX1dluvwNqpBzVk7fXYfAq+nNV/EX/6r+2aS622xB5S135gO5IHmBM+vWKP3V9Qnk/hDAWinAA+WPAYz8nPocLyjSqVoQjQUW3tTW5v3Vu3mrVoyjBtzb+uLA/Bqvy130X5mbGvUYyBgjjMb4MW+Xu+i/Mzc1qzUx7tjZ8I+BsYd+yXb4syHGcg7908P1p6T1Caq1UuuVQVACWOFHya8ADie7uTEQ1b+J9c9sNOMZ3lFSVtj7Nex7iqRclZSa4eqPC0dM6r+J1H+tZ7Yeu53OXZ2Pe7Fj62M3b7m7z6zM3X2/2YPc2/fvOvh5w0vu01G+7v3I0qsHa7k3bf6sIghAIvWYfM2zwKwNmYaBdu+RA2klSJ2JBKxCkwVcIZAUaBcwrQLyEpph8qn809JXPP9H/2yec/hM9EiETnY7prh82bWG6L4+Q5pqu0QoG54cvtMd1OlNWPKGtM7Dt21rk9w7TRXo3JtQZxv+Rml8KWlGKvGw/hM5N3LEQpJ20r9eztRuaowctwpTqqwyk207EH+2r7/Bov8IGsquevyVtdnZ7Xa8m6uBsuM9knHAzzNekHdDCk
buttonColor: "#03B365",
dynamicPropertyPathList: [
{
key: "onClick",
},
],
displayName: "Button",
iconSVG: "/static/media/icon.cca02633.svg",
topRow: 29,
bottomRow: 33,
tooltip: "",
parentRowSpace: 10,
type: "BUTTON_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.0625,
dynamicTriggerPathList: [
{
key: "onClick",
},
],
leftColumn: 20,
dynamicBindingPathList: [],
text: "Submit",
isDisabled: false,
key: "pg01cxraj1",
rightColumn: 36,
isDefaultClickDisabled: true,
widgetId: "d229q1ydul",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
buttonVariant: "PRIMARY",
placement: "CENTER",
},
{
widgetName: "Input2",
displayName: "Input",
iconSVG: "/static/media/icon.9f505595.svg",
topRow: 44,
bottomRow: 48,
parentRowSpace: 10,
autoFocus: false,
type: "INPUT_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.0625,
resetOnSubmit: true,
leftColumn: 9,
labelStyle: "",
inputType: "TEXT",
isDisabled: false,
key: "519sr07k1u",
isRequired: false,
rightColumn: 29,
widgetId: "eenq4c022d",
isVisible: true,
label: "",
allowCurrencyChange: false,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
iconAlign: "left",
defaultText: "",
},
{
version: 1,
template: {
Image1: {
isVisible: true,
defaultImage: "https://assets.appsmith.com/widgets/default.png",
imageShape: "RECTANGLE",
maxZoomLevel: 1,
enableRotation: false,
enableDownload: false,
objectFit: "contain",
image: "{{List1.listData.map((currentItem) => currentItem.img)}}",
widgetName: "Image1",
version: 1,
animateLoading: true,
type: "IMAGE_WIDGET",
hideCard: false,
displayName: "Image",
key: "9cn4ooadxj",
iconSVG: "/static/media/icon.52d8fb96.svg",
dynamicBindingPathList: [
{
key: "image",
},
],
dynamicTriggerPathList: [],
widgetId: "yqofym38tn",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 0,
rightColumn: 16,
topRow: 0,
bottomRow: 8.4,
parentId: "vqn2okwc6a",
},
Text1: {
isVisible: true,
text: "{{List1.listData.map((currentItem) => currentItem.name)}}",
fontSize: "PARAGRAPH",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text1",
shouldScroll: false,
shouldTruncate: false,
version: 1,
animateLoading: true,
type: "TEXT_WIDGET",
hideCard: false,
displayName: "Text",
key: "yd217bk315",
iconSVG: "/static/media/icon.97c59b52.svg",
textStyle: "HEADING",
dynamicBindingPathList: [
{
key: "text",
},
],
dynamicTriggerPathList: [],
widgetId: "zeqf6yfm3s",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 16,
rightColumn: 28,
topRow: 0,
bottomRow: 4,
parentId: "vqn2okwc6a",
},
Text2: {
isVisible: true,
text: "{{List1.listData.map((currentItem) => currentItem.id)}}",
fontSize: "PARAGRAPH",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text2",
shouldScroll: false,
shouldTruncate: false,
version: 1,
animateLoading: true,
type: "TEXT_WIDGET",
hideCard: false,
displayName: "Text",
key: "yd217bk315",
iconSVG: "/static/media/icon.97c59b52.svg",
textStyle: "BODY",
dynamicBindingPathList: [
{
key: "text",
},
],
dynamicTriggerPathList: [],
widgetId: "8wyekp2o6e",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 16,
rightColumn: 24,
topRow: 4,
bottomRow: 8,
parentId: "vqn2okwc6a",
},
},
widgetName: "List1",
listData: [
{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
},
],
isCanvas: true,
displayName: "List",
iconSVG: "/static/media/icon.9925ee17.svg",
topRow: 34,
bottomRow: 74,
parentRowSpace: 10,
type: "LIST_WIDGET",
hideCard: false,
gridGap: 0,
animateLoading: true,
parentColumnSpace: 14.0625,
leftColumn: 39,
dynamicBindingPathList: [
{
key: "template.Image1.image",
},
{
key: "template.Text1.text",
},
{
key: "template.Text2.text",
},
],
gridType: "vertical",
enhancements: true,
children: [
{
widgetName: "Canvas1",
displayName: "Canvas",
topRow: 0,
bottomRow: 400,
parentRowSpace: 1,
type: "CANVAS_WIDGET",
canExtend: false,
hideCard: true,
dropDisabled: true,
openParentPropertyPane: true,
minHeight: 400,
noPad: true,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
boxShadow: "NONE",
widgetName: "Container1",
borderColor: "transparent",
disallowCopy: true,
isCanvas: true,
displayName: "Container",
iconSVG: "/static/media/icon.1977dca3.svg",
topRow: 0,
bottomRow: 12,
dragDisabled: true,
type: "CONTAINER_WIDGET",
hideCard: false,
openParentPropertyPane: true,
isDeletable: false,
animateLoading: true,
leftColumn: 0,
children: [
{
widgetName: "Canvas2",
detachFromLayout: true,
displayName: "Canvas",
widgetId: "vqn2okwc6a",
containerStyle: "none",
topRow: 0,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "9e77epyavg",
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "Image1",
displayName: "Image",
iconSVG: "/static/media/icon.52d8fb96.svg",
topRow: 0,
bottomRow: 8.4,
type: "IMAGE_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
imageShape: "RECTANGLE",
dynamicBindingPathList: [
{
key: "image",
},
],
leftColumn: 0,
defaultImage:
"https://assets.appsmith.com/widgets/default.png",
key: "9cn4ooadxj",
image: "{{currentItem.img}}",
rightColumn: 16,
objectFit: "contain",
widgetId: "yqofym38tn",
logBlackList: {
isVisible: true,
defaultImage: true,
imageShape: true,
maxZoomLevel: true,
enableRotation: true,
enableDownload: true,
objectFit: true,
image: true,
widgetName: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
maxZoomLevel: 1,
enableDownload: false,
enableRotation: false,
},
{
widgetName: "Text1",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 0,
bottomRow: 4,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
dynamicBindingPathList: [
{
key: "text",
},
],
leftColumn: 16,
shouldTruncate: false,
truncateButtonColor: "#FFC13D",
text: "{{currentItem.name}}",
key: "yd217bk315",
rightColumn: 28,
textAlign: "LEFT",
widgetId: "zeqf6yfm3s",
logBlackList: {
isVisible: true,
text: true,
fontSize: true,
fontStyle: true,
textAlign: true,
textColor: true,
truncateButtonColor: true,
widgetName: true,
shouldScroll: true,
shouldTruncate: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
textStyle: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
shouldScroll: false,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
fontSize: "PARAGRAPH",
textStyle: "HEADING",
},
{
widgetName: "Text2",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 4,
bottomRow: 8,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
dynamicBindingPathList: [
{
key: "text",
},
],
leftColumn: 16,
shouldTruncate: false,
truncateButtonColor: "#FFC13D",
text: "{{currentItem.id}}",
key: "yd217bk315",
rightColumn: 24,
textAlign: "LEFT",
widgetId: "8wyekp2o6e",
logBlackList: {
isVisible: true,
text: true,
fontSize: true,
fontStyle: true,
textAlign: true,
textColor: true,
truncateButtonColor: true,
widgetName: true,
shouldScroll: true,
shouldTruncate: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
textStyle: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
shouldScroll: false,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
fontSize: "PARAGRAPH",
textStyle: "BODY",
},
],
key: "omhgz5cakp",
},
],
borderWidth: "0",
key: "ca3a42k2a4",
disablePropertyPane: true,
backgroundColor: "white",
rightColumn: 64,
widgetId: "9e77epyavg",
containerStyle: "card",
isVisible: true,
version: 1,
parentId: "q3ype57cdo",
renderMode: "CANVAS",
isLoading: false,
borderRadius: "0",
},
],
key: "omhgz5cakp",
rightColumn: 337.5,
detachFromLayout: true,
widgetId: "q3ype57cdo",
containerStyle: "none",
isVisible: true,
version: 1,
parentId: "iupz1d99ka",
renderMode: "CANVAS",
isLoading: false,
},
],
key: "axex98spx3",
backgroundColor: "transparent",
rightColumn: 63,
itemBackgroundColor: "#FFFFFF",
widgetId: "iupz1d99ka",
isVisible: true,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
},
],
containerStyle: "none",
detachFromLayout: true,
dynamicBindingPathList: [],
dynamicTriggerPathList: [],
leftColumn: 0,
minHeight: 640,
parentColumnSpace: 1,
parentRowSpace: 1,
rightColumn: 912,
snapColumns: 64,
snapRows: 125,
topRow: 0,
type: "CANVAS_WIDGET",
version: currentVersion,
widgetId: "0",
widgetName: "MainContainer",
renderMode: "CANVAS",
isLoading: false,
};
const expectedNextDSL: ContainerWidgetProps<WidgetProps> = {
backgroundColor: "none",
bottomRow: 740,
canExtend: true,
version: nextVersion,
children: [
{
widgetName: "Input1",
displayName: "Input",
iconSVG: "/static/media/icon.9f505595.svg",
topRow: 18,
bottomRow: 22,
parentRowSpace: 10,
autoFocus: false,
type: "INPUT_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 15.0625,
dynamicTriggerPathList: [],
resetOnSubmit: true,
leftColumn: 23,
dynamicBindingPathList: [],
labelStyle: "",
inputType: "TEXT",
isDisabled: false,
key: "ftefjorusw",
isRequired: false,
rightColumn: 43,
widgetId: "lz9hvhcltl",
isVisible: true,
label: "",
allowCurrencyChange: false,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
iconAlign: "left",
defaultText: "",
},
{
widgetName: "Button1",
onClick:
'{{Api1.run(()=>{\ndownload((\nfunction(){\nreturn "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQUExYUFBQWFhYYGBgYGBYWFhgWFhgYFhYYGBYYGBgZHioiGR4nHhgWIzMjJystMDAwGCE2OzYvOiovMC0BCwsLDw4PGBERGC8eHh4vLS8vLy0vLS8tLy8tLy8vLy8vLy8vLy8vLy8vLy8vLS0vLy8vLS8vLS8vLy0vLS8vL//AABEIAMEBBQMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAACBQEGB//EAEcQAAICAQICBQYKBwYGAwAAAAECAAMRBCExQQUGElFhE3GBkdHwByIjMnOSobGywRQkQlJUcvEzU2KCk+FDY6KzwtIVFjT/xAAaAQEBAAMBAQAAAAAAAAAAAAABAAIEBQMG/8QAOREAAgECAgUJBQcFAAAAAAAAAAECAxEEQRIhMVFxBRMyYYGRsdHxI1KhwfAUIjNCcpKyBjRTguH/2gAMAwEAAhEDEQA/APkYEus4sJiBkQCXScSFQQZFwsIolqwIcJMRIghVGZwLCKICWUQi5la+MP2fvmIoGsvjf33hQvLE5jl/WQlexKEd2Yf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cwrQLyEpph8qn809JXPP9H/2yec/hM9EiETnY7prh82bWG6L4+Q5pqu0QoG54cvtMd1OlNWPKGtM7Dt21rk9w7TRXo3JtQZxv+Rml8KWlGKvGw/hM5N3LEQpJ20r9eztRuaowctwpTqqwyk207EH+2r7/Bov8IGsquevyVtdnZ7Xa8m6uBsuM9knHAzzNekHdDCk
buttonColor: "#03B365",
dynamicPropertyPathList: [
{
key: "onClick",
},
],
displayName: "Button",
iconSVG: "/static/media/icon.cca02633.svg",
topRow: 29,
bottomRow: 33,
tooltip: "",
parentRowSpace: 10,
type: "BUTTON_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.0625,
dynamicTriggerPathList: [
{
key: "onClick",
},
],
leftColumn: 20,
dynamicBindingPathList: [],
text: "Submit",
isDisabled: false,
key: "pg01cxraj1",
rightColumn: 36,
isDefaultClickDisabled: true,
widgetId: "d229q1ydul",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
buttonVariant: "PRIMARY",
placement: "CENTER",
},
{
widgetName: "Input2",
displayName: "Input",
iconSVG: "/static/media/icon.9f505595.svg",
topRow: 44,
bottomRow: 48,
parentRowSpace: 10,
autoFocus: false,
type: "INPUT_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.0625,
resetOnSubmit: true,
leftColumn: 9,
labelStyle: "",
inputType: "TEXT",
isDisabled: false,
key: "519sr07k1u",
isRequired: false,
rightColumn: 29,
widgetId: "eenq4c022d",
isVisible: true,
label: "",
allowCurrencyChange: false,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
iconAlign: "left",
defaultText: "",
},
{
widgetName: "List1",
template: {
Image1: {
isVisible: true,
defaultImage: "https://assets.appsmith.com/widgets/default.png",
imageShape: "RECTANGLE",
maxZoomLevel: 1,
enableRotation: false,
enableDownload: false,
objectFit: "contain",
image: "{{List1.listData.map((currentItem) => currentItem.img)}}",
widgetName: "Image1",
version: 1,
animateLoading: true,
type: "IMAGE_WIDGET",
hideCard: false,
displayName: "Image",
key: "9cn4ooadxj",
iconSVG: "/static/media/icon.52d8fb96.svg",
dynamicBindingPathList: [
{
key: "image",
},
],
dynamicTriggerPathList: [],
widgetId: "yqofym38tn",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 0,
rightColumn: 16,
topRow: 0,
bottomRow: 8.4,
parentId: "vqn2okwc6a",
},
Text1: {
isVisible: true,
text: "{{List1.listData.map((currentItem) => currentItem.name)}}",
fontSize: "PARAGRAPH",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text1",
shouldScroll: false,
shouldTruncate: false,
version: 1,
animateLoading: true,
type: "TEXT_WIDGET",
hideCard: false,
displayName: "Text",
key: "yd217bk315",
iconSVG: "/static/media/icon.97c59b52.svg",
textStyle: "HEADING",
dynamicBindingPathList: [
{
key: "text",
},
],
dynamicTriggerPathList: [],
widgetId: "zeqf6yfm3s",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 16,
rightColumn: 28,
topRow: 0,
bottomRow: 4,
parentId: "vqn2okwc6a",
},
Text2: {
isVisible: true,
text: "{{List1.listData.map((currentItem) => currentItem.id)}}",
fontSize: "PARAGRAPH",
fontStyle: "BOLD",
textAlign: "LEFT",
textColor: "#231F20",
truncateButtonColor: "#FFC13D",
widgetName: "Text2",
shouldScroll: false,
shouldTruncate: false,
version: 1,
animateLoading: true,
type: "TEXT_WIDGET",
hideCard: false,
displayName: "Text",
key: "yd217bk315",
iconSVG: "/static/media/icon.97c59b52.svg",
textStyle: "BODY",
dynamicBindingPathList: [
{
key: "text",
},
],
dynamicTriggerPathList: [],
widgetId: "8wyekp2o6e",
renderMode: "CANVAS",
isLoading: false,
leftColumn: 16,
rightColumn: 24,
topRow: 4,
bottomRow: 8,
parentId: "vqn2okwc6a",
},
},
listData: [
{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
},
],
isCanvas: true,
displayName: "List",
iconSVG: "/static/media/icon.9925ee17.svg",
topRow: 34,
bottomRow: 74,
parentRowSpace: 10,
type: "LIST_WIDGET",
hideCard: false,
gridGap: 0,
animateLoading: true,
parentColumnSpace: 14.0625,
leftColumn: 39,
dynamicBindingPathList: [
{
key: "template.Image1.image",
},
{
key: "template.Text1.text",
},
{
key: "template.Text2.text",
},
],
gridType: "vertical",
enhancements: true,
children: [
{
widgetName: "Canvas1",
displayName: "Canvas",
topRow: 0,
bottomRow: 400,
parentRowSpace: 1,
type: "CANVAS_WIDGET",
canExtend: false,
hideCard: true,
dropDisabled: true,
openParentPropertyPane: true,
minHeight: 400,
noPad: true,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
boxShadow: "NONE",
widgetName: "Container1",
borderColor: "transparent",
disallowCopy: true,
isCanvas: true,
displayName: "Container",
iconSVG: "/static/media/icon.1977dca3.svg",
topRow: 0,
bottomRow: 12,
dragDisabled: true,
type: "CONTAINER_WIDGET",
hideCard: false,
openParentPropertyPane: true,
isDeletable: false,
animateLoading: true,
leftColumn: 0,
children: [
{
widgetName: "Canvas2",
detachFromLayout: true,
displayName: "Canvas",
widgetId: "vqn2okwc6a",
containerStyle: "none",
topRow: 0,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "9e77epyavg",
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "Image1",
displayName: "Image",
iconSVG: "/static/media/icon.52d8fb96.svg",
topRow: 0,
bottomRow: 8.4,
type: "IMAGE_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
imageShape: "RECTANGLE",
dynamicBindingPathList: [
{
key: "image",
},
],
leftColumn: 0,
defaultImage:
"https://assets.appsmith.com/widgets/default.png",
key: "9cn4ooadxj",
image: "{{currentItem.img}}",
rightColumn: 16,
objectFit: "contain",
widgetId: "yqofym38tn",
logBlackList: {
isVisible: true,
defaultImage: true,
imageShape: true,
maxZoomLevel: true,
enableRotation: true,
enableDownload: true,
objectFit: true,
image: true,
widgetName: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
maxZoomLevel: 1,
enableDownload: false,
enableRotation: false,
},
{
widgetName: "Text1",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 0,
bottomRow: 4,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
dynamicBindingPathList: [
{
key: "text",
},
],
leftColumn: 16,
truncateButtonColor: "#FFC13D",
text: "{{currentItem.name}}",
key: "yd217bk315",
rightColumn: 28,
textAlign: "LEFT",
widgetId: "zeqf6yfm3s",
logBlackList: {
isVisible: true,
text: true,
fontSize: true,
fontStyle: true,
textAlign: true,
textColor: true,
truncateButtonColor: true,
widgetName: true,
shouldScroll: true,
shouldTruncate: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
textStyle: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
overflow: OverflowTypes.NONE,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
fontSize: "PARAGRAPH",
textStyle: "HEADING",
},
{
widgetName: "Text2",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 4,
bottomRow: 8,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
dynamicTriggerPathList: [],
dynamicBindingPathList: [
{
key: "text",
},
],
leftColumn: 16,
truncateButtonColor: "#FFC13D",
text: "{{currentItem.id}}",
key: "yd217bk315",
rightColumn: 24,
textAlign: "LEFT",
widgetId: "8wyekp2o6e",
logBlackList: {
isVisible: true,
text: true,
fontSize: true,
fontStyle: true,
textAlign: true,
textColor: true,
truncateButtonColor: true,
widgetName: true,
shouldScroll: true,
shouldTruncate: true,
version: true,
animateLoading: true,
type: true,
hideCard: true,
displayName: true,
key: true,
iconSVG: true,
isCanvas: true,
textStyle: true,
dynamicBindingPathList: true,
dynamicTriggerPathList: true,
minHeight: true,
widgetId: true,
renderMode: true,
isLoading: true,
parentColumnSpace: true,
parentRowSpace: true,
leftColumn: true,
rightColumn: true,
topRow: true,
bottomRow: true,
parentId: true,
},
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
overflow: OverflowTypes.NONE,
version: 1,
parentId: "vqn2okwc6a",
renderMode: "CANVAS",
isLoading: false,
fontSize: "PARAGRAPH",
textStyle: "BODY",
},
],
key: "omhgz5cakp",
},
],
borderWidth: "0",
key: "ca3a42k2a4",
disablePropertyPane: true,
backgroundColor: "white",
rightColumn: 64,
widgetId: "9e77epyavg",
containerStyle: "card",
isVisible: true,
version: 1,
parentId: "q3ype57cdo",
renderMode: "CANVAS",
isLoading: false,
borderRadius: "0",
},
],
key: "omhgz5cakp",
rightColumn: 337.5,
detachFromLayout: true,
widgetId: "q3ype57cdo",
containerStyle: "none",
isVisible: true,
version: 1,
parentId: "iupz1d99ka",
renderMode: "CANVAS",
isLoading: false,
},
],
privateWidgets: {
Image1: true,
Text1: true,
Text2: true,
},
key: "axex98spx3",
backgroundColor: "transparent",
rightColumn: 63,
itemBackgroundColor: "#FFFFFF",
widgetId: "iupz1d99ka",
isVisible: true,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
version: 1,
},
],
containerStyle: "none",
detachFromLayout: true,
dynamicBindingPathList: [],
dynamicTriggerPathList: [],
leftColumn: 0,
minHeight: 640,
parentColumnSpace: 1,
parentRowSpace: 1,
rightColumn: 912,
snapColumns: 64,
snapRows: 125,
topRow: 0,
type: "CANVAS_WIDGET",
widgetId: "0",
widgetName: "MainContainer",
renderMode: RenderModes.CANVAS,
isLoading: false,
};
const actualNextDsl = transformDSL(currentDSL, false);
expect(actualNextDsl).toEqual(expectedNextDSL);
});
feat: Controls for labels in widgets to align the widgets in forms and other places (#10600) * feat: When there are multiple input widgets with different label lengths then the input box looks misaligned -- Create a new property control for a label position -- Create a new property control for a label alignment -- Prototype a label section for Input widget * feat: When there are multiple input widgets with different label lengths then the input box looks misaligned -- Add a property, labelWidth in the property pane * feat: Controls for labels in widgets to align the widgets in forms and other places -- Input widget: Implement all the requirements in case its type is Text * feat: Controls for labels in widgets to align the widgets in forms and other places -- Adapt the functionalty on other types of the input widget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into DropdownWidget -- Clean up for the input widget and DRY * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into MultiSelectWidget -- Eliminate unnecessary component prop, columns * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalties into Tree Select widget -- Add styles for alignment between lable and input control over the widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add label functionalities into MultiSelectTreeWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Introduce label functionalities into DatePickerWidget2 -- Use width instead of columns prop in InputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into RichTextEditorWidget -- Eliminate compactMode from StyledLabel * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into CheckboxGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement switch group for the correct meaning of right alignment * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply label functionalities into RadioGroupWidget -- Add new properties, alignment and inline for consistency * feat: Controls for labels in widgets to align the widgets in forms and other places -- Adjust cols and rows for RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused StyledRadioProps * feat: Controls for labels in widgets to align the widgets in forms and other places -- Complete first MVP of enhanced SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Complete the first MVP of enhanced RadioGroupWidget -- Eliminate unused StyledSwitch component for SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add min-height, align-self rules for LabelContainer * feat: Controls for labels in widgets to align the widgets in forms and other places -- Use original label property for RadioGroupWidget -- Add a migration for adding isInline and alignment properties for RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Update version to latest one in DSLMigrationsUtils.test.ts * fix failing jest test * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement label functionalities on BaseInputWidget, InputWidgetV2, CurrencyInputWidget, PhoneInputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused imports in DSLMigrationsUtils * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the label related test case which is failed in Input_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on #10119: The label text truncates on resizing the input widget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix scroll issue when shrink with MultiSelectWidget and MultiSelectTreeWidget * fix: Widget Popup test * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement width and alginment features on the level of label element -- Prevent actual inputs from DropdownWidget, MultiSelectWidget, SingleSelectTreeWidget, MultiSelectTreeWidget from overflow when resizing -- Enable label feature on a RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set label container's default width to 33% when width is not set * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix crash issue when labelWidth is filled by non-numeric value, eliminating passing NaN as its value * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set flex-grow to zero on input types other than TEXT * feat: Controls for labels in widgets to align the widgets in forms and other places -- Implement label features on newly created MultiSelectWidgetV2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate LabelPositionTypes, directly using enum LabelPosition -- Add a comment for a constant LABEL_MAX_WIDTH_RATE -- Directly import React for LabelAlignmentOptionsControl -- Remove unnecessary constructor for LabelAlignmentOptionsControl -- Define handleAlign instance method as a higher-order function -- Only migrate alignment property for RadioGroupWidget -- Use Object.hasOwnProperty instead of in operator * feat: Controls for labels in widgets to align the widgets in forms and other places -- Migrate alignment property of RadioGroupWidget in case of currentDSL.version is 52 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Revert currentDSL.version to 52 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add a Jest test case for RadioGroupWidget's alignment property migration * feat: Controls for labels in widgets to align the widgets in forms and other places -- Replace all nested ternary operators with if statements * feat: Controls for labels in widgets to align the widgets in forms and other places -- Implement label feature on new version of SelectWidget -- Add Cypress tests for widgets' label section * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor code for BaseInputWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change CSS selector for step buttons for Numeric BaseInputWidget -- Directly use migrateRadioGroupAlignmentProperty migration function without using transformDSL * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on typo about migrateRadioGroupAlignmentProperty * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add data-testid attributes for Cypress selectors * feat: Deprecate form button widget -- Assert flex-direction to row in CheckboxGroup_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add a missing data-testid for SelectWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on failed test cases: CheckboxGroup_spec, DatePicker_2_spec, MultiSelectWidgetV2 * fix: Select popup DSL * feat: Controls for labels in widgets to align the widgets in forms and other places -- Create a new property control, NumericInputControl -- Replace all the label properties with the newly created controls * feat: Controls for labels in widgets to align the widgets in forms and other places -- Create a new Cypress command, checkLabelWidth and apply to all related test cases -- Increase width in checkboxgroupDsl.json -- Rename className for label in MultiSelectWidgetV2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Reimplement the tooltip feature for labels -- Add missing props for labels in DateField, MultiSelectField, RadioGroupField, SelectField fields for JSONFormWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor property controls, including LabelPositionOptionsControl, LabelAlignmentOptionsControl, NumericInputControl to keep consistency -- Apply default values into label section * feat: Controls for labels in widgets to align the widgets in forms and other places -- Extract the label related parts from the various widgets as an independent component * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate TypeScript any type from BaseInputComponent * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change labelPosition property type to DROP_DOWN -- Modify LabelAlignmentOptionsControl to use ButtonTabComponent * feat: Controls for labels in widgets to align the widgets in forms and other places -- Define getLabelWidth method into BaseWidget -- Extract the common CSS rules for the widget containers -- Revert rows and columns for SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the failed test case in DSLMigrationsUtils.test.ts * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on overflow issue on CheckboxGroupWidget -- Create a distinctive spec file for label feature -- Eliminate the redundant label specs with the relevant widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Delete unnecessary files, including Select_spec.js, LabelButton.tsx and LabelPositionOptionsControl.tsx -- Revise wrong comment for checkLabelForWidget Cypress command * feat: Controls for labels in widgets to align the widgets in forms and other places -- Do not set the label width only if its value is 0 -- Clean up the component for DatePickerWidget2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused imports in DatePickerWidget2 * feat: Controls for labels in widgets to align the widgets in forms and other places -- Make RadioGroupWidget's layout flexible in all modes * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on Cypress test case for RadioGroupWidget in Widgets_Labels_spec -- Change Cypress commands, including addAction, addSuccessMessage, enterActionValue to accept parentSelector * feat: Controls for labels in widgets to align the widgets in forms and other places -- Change getLabelWidth method to not have any argument -- Define some constants for label numbers -- Extract the common styles for SwitchGroupWidget and RadioGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Refactor some constants * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate unused width prop from RadioGroupWidget -- Get labelWidth from getLabelWidth * feat: Controls for labels in widgets to align the widgets in forms and other places -- Eliminate the min-height restriction on a label -- Eliminate the scroll on the earlier InputWidgetV2 which was not in compact mode * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add one more condition checking if the current input type is text * feat: Controls for labels in widgets to align the widgets in forms and other places -- Extract common code base for MultiSelectTreeWidget and MultiSelectWidgetV2 -- Apply a few CSS fixes on the scrollbar issue select related widgets * feat: Controls for labels in widgets to align the widgets in forms and other places -- Apply some tweaks for earlier widgets with labels so as not to be broken UX * feat: Controls for labels in widgets to align the widgets in forms and other places -- Fix on the failed Cypress test case in Widget_Popup_spec.js * feat: Controls for labels in widgets to align the widgets in forms and other places -- Add constants, LABEL_DEFAULT_WIDTH_RATE, SELECT_DEFAULT_HEIGHT, LABEL_MARGIN_OLD_SELECT * feat: Controls for labels in widgets to align the widgets in forms and other places -- Increase the widths of CheckboxGroupWidget and SwitchGroupWidget * feat: Controls for labels in widgets to align the widgets in forms and other places -- Set the font size to 14px for NumericInputControl Co-authored-by: ohansFavour <fohanekwu@gmail.com> Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2022-04-14 08:47:25 +00:00
it("RadioGroupWidget: Add alignment property, set to LEFT", () => {
const currentVersion = 51;
const currentDSL: ContainerWidgetProps<WidgetProps> = {
widgetName: "MainContainer",
renderMode: RenderModes.CANVAS,
isLoading: false,
backgroundColor: "none",
rightColumn: 909,
snapColumns: 64,
detachFromLayout: true,
widgetId: "0",
topRow: 0,
bottomRow: 710,
containerStyle: "none",
snapRows: 125,
parentRowSpace: 1,
type: "CANVAS_WIDGET",
canExtend: true,
version: currentVersion,
minHeight: 690,
parentColumnSpace: 1,
dynamicBindingPathList: [],
leftColumn: 0,
children: [
{
widgetName: "RadioGroup1",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 6,
bottomRow: 14,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 3,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 27,
widgetId: "zo3fvq3exo",
isVisible: true,
label: "",
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
},
{
boxShadow: "NONE",
widgetName: "Container1",
borderColor: "transparent",
isCanvas: true,
displayName: "Container",
iconSVG: "/static/media/icon.1977dca3.svg",
topRow: 17,
bottomRow: 35,
parentRowSpace: 10,
type: "CONTAINER_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 3,
children: [
{
widgetName: "Canvas1",
rightColumn: 336.375,
detachFromLayout: true,
displayName: "Canvas",
widgetId: "07bpn6tbfi",
containerStyle: "none",
topRow: 0,
bottomRow: 390,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "tt24x0w1w8",
minHeight: 400,
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "RadioGroup2",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 2,
bottomRow: 10,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 4.943359375,
leftColumn: 2,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 64,
widgetId: "cu4xgfuj9c",
isVisible: true,
label: "",
version: 1,
parentId: "07bpn6tbfi",
renderMode: "CANVAS",
isLoading: false,
},
],
key: "xtt3p4czog",
},
],
borderWidth: "0",
key: "0s5opm25jx",
backgroundColor: "#FFFFFF",
rightColumn: 27,
widgetId: "tt24x0w1w8",
containerStyle: "card",
isVisible: true,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
borderRadius: "0",
},
{
widgetName: "Form1",
version: 1,
backgroundColor: "white",
rightColumn: 54,
isCanvas: true,
displayName: "Form",
iconSVG: "/static/media/icon.ea3e08d1.svg",
widgetId: "ybeukm257w",
topRow: 6,
bottomRow: 46,
parentRowSpace: 10,
isVisible: true,
type: "FORM_WIDGET",
hideCard: false,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 30,
children: [
{
widgetName: "Canvas2",
rightColumn: 336.375,
detachFromLayout: true,
displayName: "Canvas",
widgetId: "ilkump68xe",
containerStyle: "none",
topRow: 0,
bottomRow: 390,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "ybeukm257w",
minHeight: 400,
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "Text1",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 1,
bottomRow: 5,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
leftColumn: 1.5,
shouldTruncate: false,
truncateButtonColor: "#FFC13D",
text: "Form",
key: "jh3gip369p",
rightColumn: 25.5,
textAlign: "LEFT",
widgetId: "yp585y41d6",
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
shouldScroll: false,
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
fontSize: "HEADING1",
},
{
resetFormOnClick: true,
widgetName: "FormButton1",
buttonColor: "#03B365",
displayName: "FormButton",
iconSVG: "/static/media/icon.c8f649ed.svg",
topRow: 33,
bottomRow: 37,
type: "FORM_BUTTON_WIDGET",
hideCard: true,
animateLoading: true,
leftColumn: 46,
text: "Submit",
key: "ahb522obua",
rightColumn: 62,
isDefaultClickDisabled: true,
widgetId: "jrpy8ke6tw",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
disabledWhenInvalid: true,
buttonVariant: "PRIMARY",
},
{
resetFormOnClick: true,
widgetName: "FormButton2",
buttonColor: "#03B365",
displayName: "FormButton",
iconSVG: "/static/media/icon.c8f649ed.svg",
topRow: 33,
bottomRow: 37,
type: "FORM_BUTTON_WIDGET",
hideCard: true,
animateLoading: true,
leftColumn: 30,
text: "Reset",
key: "ahb522obua",
rightColumn: 46,
isDefaultClickDisabled: true,
widgetId: "j1uwneh0zn",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
disabledWhenInvalid: false,
buttonVariant: "SECONDARY",
},
{
widgetName: "RadioGroup3",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 7,
bottomRow: 15,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 4.943359375,
leftColumn: 1,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 64,
widgetId: "d3orpb3ele",
isVisible: true,
label: "",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
},
],
key: "xtt3p4czog",
},
],
key: "04103tgkwj",
},
],
};
const expectedNextDSL: ContainerWidgetProps<WidgetProps> = {
widgetName: "MainContainer",
renderMode: RenderModes.CANVAS,
isLoading: false,
backgroundColor: "none",
rightColumn: 909,
snapColumns: 64,
detachFromLayout: true,
widgetId: "0",
topRow: 0,
bottomRow: 710,
containerStyle: "none",
snapRows: 125,
parentRowSpace: 1,
type: "CANVAS_WIDGET",
canExtend: true,
version: currentVersion,
minHeight: 690,
parentColumnSpace: 1,
dynamicBindingPathList: [],
leftColumn: 0,
children: [
{
widgetName: "RadioGroup1",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 6,
bottomRow: 14,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 3,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 27,
widgetId: "zo3fvq3exo",
isVisible: true,
label: "",
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
alignment: "left",
},
{
boxShadow: "NONE",
widgetName: "Container1",
borderColor: "transparent",
isCanvas: true,
displayName: "Container",
iconSVG: "/static/media/icon.1977dca3.svg",
topRow: 17,
bottomRow: 35,
parentRowSpace: 10,
type: "CONTAINER_WIDGET",
hideCard: false,
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 3,
children: [
{
widgetName: "Canvas1",
rightColumn: 336.375,
detachFromLayout: true,
displayName: "Canvas",
widgetId: "07bpn6tbfi",
containerStyle: "none",
topRow: 0,
bottomRow: 390,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "tt24x0w1w8",
minHeight: 400,
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "RadioGroup2",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 2,
bottomRow: 10,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 4.943359375,
leftColumn: 2,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 64,
widgetId: "cu4xgfuj9c",
isVisible: true,
label: "",
version: 1,
parentId: "07bpn6tbfi",
renderMode: "CANVAS",
isLoading: false,
alignment: "left",
},
],
key: "xtt3p4czog",
},
],
borderWidth: "0",
key: "0s5opm25jx",
backgroundColor: "#FFFFFF",
rightColumn: 27,
widgetId: "tt24x0w1w8",
containerStyle: "card",
isVisible: true,
version: 1,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
borderRadius: "0",
},
{
widgetName: "Form1",
version: 1,
backgroundColor: "white",
rightColumn: 54,
isCanvas: true,
displayName: "Form",
iconSVG: "/static/media/icon.ea3e08d1.svg",
widgetId: "ybeukm257w",
topRow: 6,
bottomRow: 46,
parentRowSpace: 10,
isVisible: true,
type: "FORM_WIDGET",
hideCard: false,
parentId: "0",
renderMode: "CANVAS",
isLoading: false,
animateLoading: true,
parentColumnSpace: 14.015625,
leftColumn: 30,
children: [
{
widgetName: "Canvas2",
rightColumn: 336.375,
detachFromLayout: true,
displayName: "Canvas",
widgetId: "ilkump68xe",
containerStyle: "none",
topRow: 0,
bottomRow: 390,
parentRowSpace: 1,
isVisible: true,
type: "CANVAS_WIDGET",
canExtend: false,
version: 1,
hideCard: true,
parentId: "ybeukm257w",
minHeight: 400,
renderMode: "CANVAS",
isLoading: false,
parentColumnSpace: 1,
leftColumn: 0,
children: [
{
widgetName: "Text1",
displayName: "Text",
iconSVG: "/static/media/icon.97c59b52.svg",
topRow: 1,
bottomRow: 5,
type: "TEXT_WIDGET",
hideCard: false,
animateLoading: true,
leftColumn: 1.5,
shouldTruncate: false,
truncateButtonColor: "#FFC13D",
text: "Form",
key: "jh3gip369p",
rightColumn: 25.5,
textAlign: "LEFT",
widgetId: "yp585y41d6",
isVisible: true,
fontStyle: "BOLD",
textColor: "#231F20",
shouldScroll: false,
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
fontSize: "HEADING1",
},
{
resetFormOnClick: true,
widgetName: "FormButton1",
buttonColor: "#03B365",
displayName: "FormButton",
iconSVG: "/static/media/icon.c8f649ed.svg",
topRow: 33,
bottomRow: 37,
type: "FORM_BUTTON_WIDGET",
hideCard: true,
animateLoading: true,
leftColumn: 46,
text: "Submit",
key: "ahb522obua",
rightColumn: 62,
isDefaultClickDisabled: true,
widgetId: "jrpy8ke6tw",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
disabledWhenInvalid: true,
buttonVariant: "PRIMARY",
},
{
resetFormOnClick: true,
widgetName: "FormButton2",
buttonColor: "#03B365",
displayName: "FormButton",
iconSVG: "/static/media/icon.c8f649ed.svg",
topRow: 33,
bottomRow: 37,
type: "FORM_BUTTON_WIDGET",
hideCard: true,
animateLoading: true,
leftColumn: 30,
text: "Reset",
key: "ahb522obua",
rightColumn: 46,
isDefaultClickDisabled: true,
widgetId: "j1uwneh0zn",
isVisible: true,
recaptchaType: "V3",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
disabledWhenInvalid: false,
buttonVariant: "SECONDARY",
},
{
widgetName: "RadioGroup3",
displayName: "Radio Group",
iconSVG: "/static/media/icon.ba2b2ee0.svg",
topRow: 7,
bottomRow: 15,
parentRowSpace: 10,
type: "RADIO_GROUP_WIDGET",
hideCard: false,
defaultOptionValue: "Y",
animateLoading: true,
parentColumnSpace: 4.943359375,
leftColumn: 1,
options: [
{
label: "Yes",
value: "Y",
},
{
label: "No",
value: "N",
},
],
isDisabled: false,
key: "pfm838nmst",
isRequired: false,
rightColumn: 64,
widgetId: "d3orpb3ele",
isVisible: true,
label: "",
version: 1,
parentId: "ilkump68xe",
renderMode: "CANVAS",
isLoading: false,
alignment: "left",
},
],
key: "xtt3p4czog",
},
],
key: "04103tgkwj",
},
],
};
const actualNextDSL = migrateRadioGroupAlignmentProperty(currentDSL);
expect(actualNextDSL).toEqual(expectedNextDSL);
});
});