Skip to content

Commit

Permalink
Add layout to V3 schema (#723)
Browse files Browse the repository at this point in the history
Co-authored-by: Swapnil Bhalgat <[email protected]>
  • Loading branch information
swapnilbhalgat and Swapnil Bhalgat authored Sep 20, 2024
1 parent 67a11b2 commit 47a6c25
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions schemas/pa-yaml/v3.0/pa.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ definitions:
Variant:
type: string
minLength: 1
Layout:
type: string
minLength: 1
Group: true
Properties: true
Children: { $ref: "#/definitions/Children-Control-instance-sequence" }
Expand Down
2 changes: 2 additions & 0 deletions src/Persistence/PaYaml/Models/SchemaV3/ControlInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public ControlInstance(string controlType)

public string? ComponentLibraryUniqueName { get; init; }

public string? Layout { get; init; }

/// <summary>
/// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Screens:
Children:
- Form1:
Control: Form
Layout: vertical
Properties:
DataSource: =Contacts
LayoutMinHeight: =250
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Screens:
- ctrlB:
Control: Label
Variant: variantB
Layout: layoutB
Group: Group1
Properties:
Prop2: =ctrlBProp2
Expand All @@ -17,6 +18,7 @@ Screens:
- ctrlA:
Control: [email protected]
Variant: variantA
Layout: layoutA
Group: Group1
Properties:
Prop2: =ctrlAProp2
Expand All @@ -27,13 +29,15 @@ Screens:
- ctrlC:
Control: FooWithChildren
Variant: variant2
Layout: layout2
Properties:
Prop2: =ctrlAProp2
Prop1: =ctrlAProp1
Children:
- ctrlC0:
Control: Bar
Variant: variantC0
Layout: layoutC0
Group: Group1
Properties:
Prop2: =ctrlC0Prop2
Expand All @@ -42,9 +46,11 @@ Screens:
- ctrlC00:
Control: Car
Variant: variantC00
Layout: layoutC00
- ctrlC1:
Control: Bar
Variant: variantC1
Layout: layoutC1
Group: Group1
Properties:
Prop2: =ctrlC1Prop2
Expand All @@ -53,3 +59,4 @@ Screens:
- ctrlC10:
Control: Dog
Variant: variantC10
Layout: layoutC10
3 changes: 3 additions & 0 deletions src/schemas/pa-yaml/v3.0/pa.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ definitions:
Variant:
type: string
minLength: 1
Layout:
type: string
minLength: 1
Group: true
Properties: true
Children: { $ref: "#/definitions/Children-Control-instance-sequence" }
Expand Down

0 comments on commit 47a6c25

Please sign in to comment.