Skip to content

Commit ad1babd

Browse files
authored
Merge branch 'master' into marcelbf/container
2 parents 7470db7 + a03a42b commit ad1babd

8 files changed

Lines changed: 107 additions & 29 deletions

File tree

‎.editorconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ csharp_style_prefer_extended_property_pattern = true:suggestion
174174
# ** Set Diagnostic Rule Category Defaults **
175175
# *******************************************
176176
# Any rule set to 'warning' will be turned into an 'error' during any official/PR build.
177-
# In local builds, this is preferrable as it allows development to be faster while code is being written.
177+
# In local builds, this is preferable as it allows development to be faster while code is being written.
178178
# This is why the default severity is usually warning here.
179179
# Set severity to 'error' when the fix indicates a breaking change or using insecure/unsafe APIs/patterns.
180180
[*.{cs,vb}]

‎schemas/pa-yaml/v3.0/pa.schema.yaml‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ definitions:
140140
ControlTypeId-oneOf-3P-types:
141141
$comment: The set of ControlTypeIds that represent third-party controls.
142142
oneOf:
143-
- $ref: "#/definitions/ControlTypeId-Component"
143+
- $ref: "#/definitions/ControlTypeId-CanvasComponent"
144144
- $ref: "#/definitions/ControlTypeId-CodeComponent"
145145

146146

147-
ControlTypeId-Component:
147+
ControlTypeId-CanvasComponent:
148148
description: |-
149-
Identifies a custom component instance. This control type requires additional properties to be specified.
149+
Identifies a canvas component instance. This control type requires additional properties to be specified.
150150
type: string
151-
const: Component
151+
const: CanvasComponent
152152

153153
ControlTypeId-CodeComponent:
154154
description: |-
@@ -183,7 +183,7 @@ definitions:
183183
allOf:
184184
- if:
185185
properties:
186-
Control: { $ref: "#/definitions/ControlTypeId-Component" }
186+
Control: { $ref: "#/definitions/ControlTypeId-CanvasComponent" }
187187
then:
188188
required: [ComponentName]
189189
additionalProperties: false
@@ -201,9 +201,10 @@ definitions:
201201
additionalProperties: false
202202
properties:
203203
Control: true
204-
ComponentName: { $ref: "#/definitions/CodeComponent-name" }
204+
ComponentName: { $ref: "#/definitions/CodeComponent-ComponentName" }
205205
Group: true
206206
Properties: true
207+
Children: { $ref: "#/definitions/Children-Control-instance-sequence" }
207208
else:
208209
additionalProperties: false
209210
properties:
@@ -231,13 +232,13 @@ definitions:
231232
allOf:
232233
- { $ref: "#/definitions/Control-instance-name" }
233234

234-
CodeComponent-name:
235+
CodeComponent-ComponentName:
235236
description: |-
236237
The unique name of the Code Component (aka PCF control) as it occurs in Dataverse.
237-
The format is: <publisher-prefix> '_' <JS-Namespace> '.' <JS-ClassName>
238+
The format is: ( <publisher-prefix> '_' )? ( <JS-Namespace> '.' )+ <JS-ClassName> ( '(' <GUID> ')' )?
238239
type: string
239240
pattern: |-
240-
^([a-z][a-z0-9]{1,7})_([a-zA-Z0-9]\.)+[a-zA-Z0-9]+$
241+
^([a-zA-Z][a-zA-Z0-9]{1,7})_)?(\w+\.)+(\w+)(\([0-9a-f-]{36}\))?$
241242
242243
ComponentDefinitions-name-instance-map:
243244
type: object

‎src/Directory.Build.props‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
When building in VS IDE, we don't want to treat warnings as errors, because they randomize developer progress.
2222
Warnings will be treated as errors at command line and in build pipelines
2323
-->
24-
<PropertyGroup Label="Code Analysis config for VS IDE"
25-
Condition="'$(BuildingInsideVisualStudio)' == 'true'">
24+
<PropertyGroup Label="Code Analysis config for VS IDE"
25+
Condition="'$(BuildingInsideVisualStudio)' == 'true'">
2626
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
2727
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
2828
</PropertyGroup>

‎src/Persistence.Tests/PaYaml/Serialization/PaYamlSerializerTests.cs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void DeserializeExamplePaYamlDataSources(string path)
7575
[TestMethod]
7676
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/Screen1.pa.yaml", 2, 8, 14, 2, 3)]
7777
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/FormsScreen2.pa.yaml", 0, 1, 62, 0, 0)]
78-
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/ComponentsScreen4.pa.yaml", 0, 6, 6, 0, 0)]
78+
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/CanvasComponentsScreen4.pa.yaml", 0, 6, 6, 0, 0)]
7979
public void DeserializeExamplePaYamlScreen(string path, int expectedScreenPropertiesCount, int expectedScreenChildrenCount, int expectedDescendantsCount, int expectedScreenGroupsCount, int expectedTotalGroupsCount)
8080
{
8181
var paFileRoot = PaYamlSerializer.Deserialize<PaModule>(File.ReadAllText(path));
@@ -179,7 +179,8 @@ public void DeserializeDuplicateControlNamesShouldFail()
179179
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/App.pa.yaml")]
180180
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/Screen1.pa.yaml")]
181181
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/FormsScreen2.pa.yaml")]
182-
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/ComponentsScreen4.pa.yaml")]
182+
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/CanvasComponentsScreen4.pa.yaml")]
183+
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Screens/CodeComponentsScreen5.pa.yaml")]
183184
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Components/MyHeaderComponent.pa.yaml")]
184185
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Components/MyComponentLibrary.pa.yaml")]
185186
[DataRow(@"_TestData/SchemaV3_0/Examples/Src/Components/InputProperties-Default.pa.yaml")]

src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/ComponentsScreen4.pa.yaml renamed to src/schemas-tests/pa-yaml/v3.0/Examples/Src/Screens/CanvasComponentsScreen4.pa.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ Screens:
22
ComponentsScreen4:
33
Children:
44
- MyHeaderComponent_2:
5-
Control: Component
5+
Control: CanvasComponent
66
ComponentName: MyHeaderComponent
77
Properties:
88
Height: =77
99
ScreenTitle: ="Screen A"
1010
Width: =1366
1111

1212
- MyHeaderComponent_3:
13-
Control: Component
13+
Control: CanvasComponent
1414
ComponentName: MyHeaderComponent
1515
Properties:
1616
ScreenTitle: ="Screen B"
1717
Y: =98
1818

1919
- MyHeaderComponent_4:
20-
Control: Component
20+
Control: CanvasComponent
2121
ComponentName: MyHeaderComponent
2222
Properties:
2323
ScreenTitle: ="Screen C"
2424
Y: =197
2525

2626
- CommonHeader_1:
27-
Control: Component
27+
Control: CanvasComponent
2828
ComponentName: CommonHeader
2929
ComponentLibraryUniqueName: joem_joemcomponentlibraryserialization_1e112
3030
Properties:
@@ -36,7 +36,7 @@ Screens:
3636
Y: =294
3737

3838
- MenuTemplate_1:
39-
Control: Component
39+
Control: CanvasComponent
4040
ComponentName: MenuTemplate
4141
ComponentLibraryUniqueName: joem_joemcomponentlibraryserialization_1e112
4242
Properties:
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Screens:
2+
CodeComponentsScreen5:
3+
Children:
4+
- MyHeaderComponent_2:
5+
Control: CodeComponent
6+
ComponentName: MyHeaderComponent
7+
Properties:
8+
Height: =77
9+
Width: =1366
10+
11+
- Spinner1_1:
12+
Control: CodeComponent
13+
ComponentName: cat_PowerCAT.Spinner
14+
Properties:
15+
Height: =64
16+
Width: =67
17+
X: =40
18+
Y: =40
19+
20+
- TagList1_1:
21+
Control: CodeComponent
22+
ComponentName: cat_PowerCAT.TagList
23+
Properties:
24+
Height: =126
25+
Items: =Accounts
26+
Width: =302
27+
X: =30
28+
Y: =125
29+
Children:
30+
- Account Name1_1:
31+
Control: DataField
32+
Variant: textualColumn
33+
IsLocked: true
34+
Properties:
35+
FieldDisplayName: ="Account Name"
36+
FieldName: ="name"
37+
FieldType: ="s"
38+
Order: =1
39+
- Main Phone1_1:
40+
Control: DataField
41+
Variant: textualColumn
42+
IsLocked: true
43+
Properties:
44+
FieldDisplayName: ="Main Phone"
45+
FieldName: ="telephone1"
46+
FieldType: ="s"
47+
Order: =2
48+
49+
- PeoplePicker1_1:
50+
Control: CodeComponent
51+
ComponentName: cat_PowerCAT.PeoplePicker
52+
Properties:
53+
Items: =Contacts
54+
Width: =373
55+
X: =494
56+
Y: =88
57+
Children:
58+
- Full Name1_1:
59+
Control: DataField
60+
Variant: textualColumn
61+
IsLocked: true
62+
Properties:
63+
FieldDisplayName: ="Full Name"
64+
FieldName: ="fullname"
65+
FieldType: ="s"
66+
Order: =1
67+
- Email1_1:
68+
Control: DataField
69+
Variant: textualColumn
70+
IsLocked: true
71+
Properties:
72+
FieldDisplayName: ="Email"
73+
FieldName: ="emailaddress1"
74+
FieldType: ="s"
75+
Order: =2

‎src/schemas/pa-yaml/v3.0/ControlLibraryVDev/ControlTypeId-1P-controls-enum.schema.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: >-
99
The schema object representing the enum of ControlTypeIds for the current version of the controls library.
1010
1111
enum:
12+
- DataField
1213
- AddMedia
1314
- Attachments
1415
- Audio

‎src/schemas/pa-yaml/v3.0/pa.schema.yaml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,18 @@ definitions:
152152
ControlTypeId-oneOf-3P-types:
153153
$comment: The set of ControlTypeIds that represent third-party controls.
154154
oneOf:
155-
- $ref: "#/definitions/ControlTypeId-Component"
155+
- $ref: "#/definitions/ControlTypeId-CanvasComponent"
156156
- $ref: "#/definitions/ControlTypeId-CodeComponent"
157157

158158
# TODO: Implement a way that some controls may define a limited subset of child control types
159159
# e.g. The 'Form' control's children must be of type 'TypedDataCard':
160160
# - $ref: "#/definitions/ControlTypeId-TypedDataCard"
161161

162-
ControlTypeId-Component:
162+
ControlTypeId-CanvasComponent:
163163
description: |-
164-
Identifies a custom component instance. This control type requires additional properties to be specified.
164+
Identifies a canvas component instance. This control type requires additional properties to be specified.
165165
type: string
166-
const: Component
166+
const: CanvasComponent
167167

168168
ControlTypeId-CodeComponent:
169169
description: |-
@@ -201,7 +201,7 @@ definitions:
201201
allOf:
202202
- if:
203203
properties:
204-
Control: { $ref: "#/definitions/ControlTypeId-Component" }
204+
Control: { $ref: "#/definitions/ControlTypeId-CanvasComponent" }
205205
then:
206206
required: [ComponentName]
207207
additionalProperties: false
@@ -220,10 +220,10 @@ definitions:
220220
additionalProperties: false
221221
properties:
222222
Control: true
223-
ComponentName: { $ref: "#/definitions/CodeComponent-name" }
223+
ComponentName: { $ref: "#/definitions/CodeComponent-ComponentName" }
224224
Group: true
225225
Properties: true
226-
# Note: CodeComponent instances do not support Variants or Children.
226+
Children: { $ref: "#/definitions/Children-Control-instance-sequence" }
227227
else:
228228
# Expected to be a built-in control library template
229229
additionalProperties: false
@@ -252,14 +252,14 @@ definitions:
252252
allOf:
253253
- { $ref: "#/definitions/Control-instance-name" }
254254

255-
CodeComponent-name:
255+
CodeComponent-ComponentName:
256256
description: |-
257257
The unique name of the Code Component (aka PCF control) as it occurs in Dataverse.
258-
The format is: <publisher-prefix> '_' <JS-Namespace> '.' <JS-ClassName>
258+
The format is: ( <publisher-prefix> '_' )? ( <JS-Namespace> '.' )+ <JS-ClassName> ( '(' <GUID> ')' )?
259259
type: string
260260
# TODO: The JS regex pattern doesn't easily support unicode chars which are valid JS identifiers.
261261
pattern: |-
262-
^([a-z][a-z0-9]{1,7})_([a-zA-Z0-9]\.)+[a-zA-Z0-9]+$
262+
^([a-zA-Z][a-zA-Z0-9]{1,7})_)?(\w+\.)+(\w+)(\([0-9a-f-]{36}\))?$
263263
264264
ComponentDefinitions-name-instance-map:
265265
type: object

0 commit comments

Comments
 (0)