From 016682df212722010a115156ba86ee0d973bae73 Mon Sep 17 00:00:00 2001 From: Swapnil Bhalgat Date: Tue, 17 Dec 2024 17:05:48 -0800 Subject: [PATCH] serialize Locked --- schemas/pa-yaml/v3.0/pa.schema.yaml | 2 + .../PaYaml/Models/SchemaV3/ControlInstance.cs | 2 + .../Examples/Src/Screens/FormsScreen2.pa.yaml | 57 +++++++++++++++++++ src/schemas/pa-yaml/v3.0/pa.schema.yaml | 2 + 4 files changed, 63 insertions(+) diff --git a/schemas/pa-yaml/v3.0/pa.schema.yaml b/schemas/pa-yaml/v3.0/pa.schema.yaml index d81680c5..2e19473e 100644 --- a/schemas/pa-yaml/v3.0/pa.schema.yaml +++ b/schemas/pa-yaml/v3.0/pa.schema.yaml @@ -212,6 +212,8 @@ definitions: Layout: type: string minLength: 1 + Locked: + type: boolean Group: true Properties: true Children: { $ref: "#/definitions/Children-Control-instance-sequence" } diff --git a/src/Persistence/PaYaml/Models/SchemaV3/ControlInstance.cs b/src/Persistence/PaYaml/Models/SchemaV3/ControlInstance.cs index f08da803..8d8c5777 100644 --- a/src/Persistence/PaYaml/Models/SchemaV3/ControlInstance.cs +++ b/src/Persistence/PaYaml/Models/SchemaV3/ControlInstance.cs @@ -28,6 +28,8 @@ public ControlInstance(string controlType) public string? Layout { get; init; } + public bool? Locked { get; init; } + /// /// The name of the group of controls that this control should be grouped with. /// This does not impact the visual layout of the control or behavior, but is used to group controls together for organizational purposes from within the Studio. diff --git a/src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/FormsScreen2.pa.yaml b/src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/FormsScreen2.pa.yaml index 6bc881bb..949910e6 100644 --- a/src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/FormsScreen2.pa.yaml +++ b/src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/FormsScreen2.pa.yaml @@ -46,6 +46,7 @@ Screens: Children: - "First Name_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -65,6 +66,7 @@ Screens: Children: - DataCardKey7: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -76,6 +78,7 @@ Screens: - DataCardValue7: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -94,6 +97,7 @@ Screens: - ErrorMessage5: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -110,6 +114,7 @@ Screens: - StarVisible5: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey7.Height @@ -121,6 +126,7 @@ Screens: - "Last Name_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -140,6 +146,7 @@ Screens: Children: - DataCardKey9: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -151,6 +158,7 @@ Screens: - DataCardValue9: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -169,6 +177,7 @@ Screens: - ErrorMessage7: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -185,6 +194,7 @@ Screens: - StarVisible7: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey9.Height @@ -196,6 +206,7 @@ Screens: - "Company Name_DataCard1": Control: TypedDataCard + Locked: true Variant: blankPolymorphicEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -212,6 +223,7 @@ Screens: - "Job Title_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -231,6 +243,7 @@ Screens: Children: - DataCardKey8: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -242,6 +255,7 @@ Screens: - DataCardValue8: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -260,6 +274,7 @@ Screens: - ErrorMessage6: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -276,6 +291,7 @@ Screens: - StarVisible6: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey8.Height @@ -287,6 +303,7 @@ Screens: - "Mobile Phone_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -306,6 +323,7 @@ Screens: Children: - DataCardKey10: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -317,6 +335,7 @@ Screens: - DataCardValue10: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -335,6 +354,7 @@ Screens: - ErrorMessage8: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -351,6 +371,7 @@ Screens: - StarVisible8: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey10.Height @@ -362,6 +383,7 @@ Screens: - "User Name_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -381,6 +403,7 @@ Screens: Children: - DataCardKey12: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -392,6 +415,7 @@ Screens: - DataCardValue12: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -410,6 +434,7 @@ Screens: - ErrorMessage10: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -426,6 +451,7 @@ Screens: - StarVisible10: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey12.Height @@ -437,6 +463,7 @@ Screens: - "Address 1_DataCard1": Control: TypedDataCard + Locked: true Variant: textualViewCard Properties: BorderStyle: =BorderStyle.Solid @@ -454,6 +481,7 @@ Screens: Children: - DataCardKey4: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -465,6 +493,7 @@ Screens: - DataCardValue4: Control: Label + Locked: true Properties: AutoHeight: =true DisplayMode: =Parent.DisplayMode @@ -479,6 +508,7 @@ Screens: - Website_DataCard1: Control: TypedDataCard + Locked: true Variant: urlEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -497,6 +527,7 @@ Screens: Children: - DataCardKey11: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -508,6 +539,7 @@ Screens: - DataCardValue11: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -525,6 +557,7 @@ Screens: - ErrorMessage9: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -541,6 +574,7 @@ Screens: - StarVisible9: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey11.Height @@ -552,6 +586,7 @@ Screens: - Birthday_DataCard1: Control: TypedDataCard + Locked: true Variant: dateEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -570,6 +605,7 @@ Screens: Children: - DataCardKey5: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -581,6 +617,7 @@ Screens: - DataCardValue5: Control: DatePicker + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) DefaultDate: =Parent.Default @@ -597,6 +634,7 @@ Screens: - ErrorMessage3: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -613,6 +651,7 @@ Screens: - StarVisible3: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey5.Height @@ -624,6 +663,7 @@ Screens: - Description_DataCard1: Control: TypedDataCard + Locked: true Variant: textualMultiLineEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -642,6 +682,7 @@ Screens: Children: - DataCardKey6: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -653,6 +694,7 @@ Screens: - DataCardValue6: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -672,6 +714,7 @@ Screens: - ErrorMessage4: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -688,6 +731,7 @@ Screens: - StarVisible4: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey6.Height @@ -699,6 +743,7 @@ Screens: - "Full Name_DataCard1": Control: TypedDataCard + Locked: true Variant: textualViewCard Properties: BorderStyle: =BorderStyle.Solid @@ -716,6 +761,7 @@ Screens: Children: - DataCardKey1: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -727,6 +773,7 @@ Screens: - DataCardValue1: Control: Label + Locked: true Properties: AutoHeight: =true DisplayMode: =Parent.DisplayMode @@ -741,6 +788,7 @@ Screens: - Email_DataCard1: Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -760,6 +808,7 @@ Screens: Children: - DataCardKey2: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -771,6 +820,7 @@ Screens: - DataCardValue2: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -789,6 +839,7 @@ Screens: - ErrorMessage1: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -805,6 +856,7 @@ Screens: - StarVisible1: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey2.Height @@ -816,6 +868,7 @@ Screens: - "Business Phone_DataCard1": Control: TypedDataCard + Locked: true Variant: textualEditCard Properties: BorderStyle: =BorderStyle.Solid @@ -835,6 +888,7 @@ Screens: Children: - DataCardKey3: Control: Label + Locked: true Properties: AutoHeight: =true Height: =34 @@ -846,6 +900,7 @@ Screens: - DataCardValue3: Control: TextInput + Locked: true Properties: BorderColor: =If(IsBlank(Parent.Error), Parent.BorderColor, Color.Red) Default: =Parent.Default @@ -864,6 +919,7 @@ Screens: - ErrorMessage2: Control: Label + Locked: true Properties: AutoHeight: =true Height: =10 @@ -880,6 +936,7 @@ Screens: - StarVisible2: Control: Label + Locked: true Properties: Align: =Align.Center Height: =DataCardKey3.Height diff --git a/src/schemas/pa-yaml/v3.0/pa.schema.yaml b/src/schemas/pa-yaml/v3.0/pa.schema.yaml index f5de31de..60b74371 100644 --- a/src/schemas/pa-yaml/v3.0/pa.schema.yaml +++ b/src/schemas/pa-yaml/v3.0/pa.schema.yaml @@ -233,6 +233,8 @@ definitions: Layout: type: string minLength: 1 + Locked: + type: boolean Group: true Properties: true Children: { $ref: "#/definitions/Children-Control-instance-sequence" }