-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WTF-1883]: Support reference sets for non-linked attribute property (#…
…95)‼️ ## NOTE: This PR is supposed to be merged after the 10.13 release with the new typings package. Add unit tests for non-linked attribute property with reference sets. ## Checklist - Contains unit tests ✅ - Contains breaking changes ❌ - Compatible with: MX 🔟 - Did you update version and changelog? ❌ - PR title properly formatted (`[XX-000]: description`)? ✅ ## This PR contains - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [x] Other (describe) ## What is the purpose of this PR? This PR adds unit tests for typings generation in PWT the recently implemented reference sets with attribute property story.
- Loading branch information
Showing
3 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...-widgets-tools/src/typings-generator/__tests__/inputs/non-linked-list-attribute-refset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
export const nonLinkedListAttributeWebInput = `<?xml version="1.0" encoding="utf-8"?> | ||
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" | ||
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd"> | ||
<properties> | ||
<propertyGroup caption="General"> | ||
<property key="referenceDefault" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
</property> | ||
<property key="reference" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceSet" type="attribute"> | ||
<caption>Reference Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceOrSet" type="attribute"> | ||
<caption>Reference or Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
</propertyGroup> | ||
</properties> | ||
</widget>`; | ||
|
||
export const nonLinkedListAttributeNativeInput = `<?xml version="1.0" encoding="utf-8"?> | ||
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" supportedPlatform="Native" | ||
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd"> | ||
<properties> | ||
<propertyGroup caption="General"> | ||
<property key="referenceDefault" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
</property> | ||
<property key="reference" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceSet" type="attribute"> | ||
<caption>Reference Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceOrSet" type="attribute"> | ||
<caption>Reference or Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
</propertyGroup> | ||
</properties> | ||
</widget>`; |
43 changes: 43 additions & 0 deletions
43
...widgets-tools/src/typings-generator/__tests__/outputs/non-linked-list-attribute-refset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export const nonLinkedListAttributeWebOutput = `/** | ||
* This file was generated from MyWidget.xml | ||
* WARNING: All changes made to this file will be overwritten | ||
* @author Mendix Widgets Framework Team | ||
*/ | ||
import { CSSProperties } from "react"; | ||
import { EditableValue, EditableListValue } from "mendix"; | ||
export interface MyWidgetContainerProps { | ||
name: string; | ||
class: string; | ||
style?: CSSProperties; | ||
tabIndex?: number; | ||
referenceDefault: EditableValue<string>; | ||
reference: EditableValue<string>; | ||
referenceSet: EditableListValue<string>; | ||
referenceOrSet: EditableValue<string> | EditableListValue<string>; | ||
} | ||
export interface MyWidgetPreviewProps { | ||
/** | ||
* @deprecated Deprecated since version 9.18.0. Please use class property instead. | ||
*/ | ||
className: string; | ||
class: string; | ||
style: string; | ||
styleObject?: CSSProperties; | ||
readOnly: boolean; | ||
referenceDefault: string; | ||
reference: string; | ||
referenceSet: string; | ||
referenceOrSet: string; | ||
} | ||
`; | ||
|
||
export const nonLinkedListAttributeNativeOutput = `export interface MyWidgetProps<Style> { | ||
name: string; | ||
style: Style[]; | ||
referenceDefault: EditableValue<string>; | ||
reference: EditableValue<string>; | ||
referenceSet: EditableListValue<string>; | ||
referenceOrSet: EditableValue<string> | EditableListValue<string>; | ||
}`; |