generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mockdata generation now works as intended (#141)
* fix: mockdata generation now works as intended * fix: test coverage
- Loading branch information
Showing
9 changed files
with
463 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@sap-ux/fe-mockserver-core': patch | ||
'@sap-ux/ui5-middleware-fe-mockserver': patch | ||
--- | ||
|
||
Fix mock data generation and reorganize some part of the code |
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
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
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
313 changes: 313 additions & 0 deletions
313
packages/fe-mockserver-plugin-cds/test/__snapshots__/index.spec.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
118 changes: 118 additions & 0 deletions
118
packages/fe-mockserver-plugin-cds/test/cds/valid-withmorecommon.cds
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,118 @@ | ||
using { | ||
cuid, | ||
managed | ||
} from '@sap/cds/common'; | ||
|
||
service Service { | ||
@odata.draft.enabled | ||
entity RootEntity { | ||
key ID : Integer @title : 'ID'; | ||
StringProperty : String @title : 'String'; | ||
IntegerProperty : Integer @title : 'Integer'; | ||
NumberProperty : Decimal(4, 2) @title : 'Number'; | ||
BooleanProperty : Boolean @title : 'Boolean'; | ||
DateProperty : Date @title : 'Date'; | ||
TimeProperty : Time @title : 'Time'; | ||
PropertyWithUnit : Integer64 @title : 'With Unit' @Measures.Unit : Unit; | ||
PropertyWithCurrency : Integer64 @title : 'With Currency' @Measures.ISOCurrency : Currency; | ||
Unit : String @title : 'UoM'; | ||
Currency : String @title : 'Currency'; | ||
TextProperty : String @title : 'Text'; | ||
TextArrangementTextOnlyProperty : String @title : 'Text Only'; | ||
TextArrangementTextLastProperty : String @title : 'Text Last'; | ||
TextArrangementTextFirstProperty : String @title : 'Text First'; | ||
TextArrangementTextSeparateProperty : String @title : 'TextSeparate'; | ||
PropertyWithValueHelp : String @title : 'With Value Help'; | ||
} | ||
|
||
entity RootEntity2 { | ||
key ID : Integer @title : 'ID'; | ||
StringProperty : String @title : 'String'; | ||
} | ||
|
||
@cds.autoexpose | ||
entity ValueHelpEntity { | ||
key KeyProp : String(1) @title : 'Value Help Key'; | ||
@Core.Immutable | ||
Description : String(20) @title : 'Value Help Description'; | ||
} | ||
|
||
@cds.autoexpose | ||
entity ValueHelpCurrencyEntity { | ||
key Currency : String(3) @title : 'Currency Key'; | ||
@Core.Immutable | ||
Description : String(20) @title : 'Currency Name'; | ||
} | ||
|
||
annotate RootEntity2 with @(UI : {LineItem : [ | ||
{Value : ID}, | ||
{Value : StringProperty} | ||
]}); | ||
|
||
annotate RootEntity with @(UI : {LineItem : [ | ||
{Value : ID}, | ||
{Value : BooleanProperty}, | ||
{Value : TextArrangementTextFirstProperty}, | ||
{Value : PropertyWithValueHelp}, | ||
{Value : PropertyWithCurrency} | ||
]}) { | ||
TextArrangementTextOnlyProperty @Common : { | ||
Text : TextProperty, | ||
TextArrangement : #TextOnly | ||
}; | ||
TextArrangementTextLastProperty @Common : { | ||
Text : TextProperty, | ||
TextArrangement : #TextLast | ||
}; | ||
TextArrangementTextFirstProperty @Common : { | ||
Text : TextProperty, | ||
TextArrangement : #TextFirst | ||
}; | ||
TextArrangementTextSeparateProperty @Common : { | ||
Text : TextProperty, | ||
TextArrangement : #TextSeparate | ||
}; | ||
PropertyWithValueHelp @(Common : {ValueList : { | ||
Label : 'Value with Value Help', | ||
CollectionPath : 'ValueHelpEntity', | ||
Parameters : [ | ||
{ | ||
$Type : 'Common.ValueListParameterInOut', | ||
LocalDataProperty : PropertyWithValueHelp, | ||
ValueListProperty : 'KeyProp' | ||
}, | ||
{ | ||
$Type : 'Common.ValueListParameterDisplayOnly', | ||
ValueListProperty : 'Description' | ||
} | ||
] | ||
}}); | ||
Currency @(Common : { | ||
ValueListWithFixedValues, | ||
ValueList : { | ||
Label : 'Currency Value Help', | ||
CollectionPath : 'ValueHelpCurrencyEntity', | ||
Parameters : [ | ||
{ | ||
$Type : 'Common.ValueListParameterInOut', | ||
LocalDataProperty : Currency, | ||
ValueListProperty : 'Currency' | ||
}, | ||
{ | ||
$Type : 'Common.ValueListParameterDisplayOnly', | ||
ValueListProperty : 'Description' | ||
} | ||
] | ||
} | ||
}); | ||
}; | ||
|
||
annotate ValueHelpEntity with { | ||
KeyProp @(Common : { | ||
Text : Description, | ||
TextArrangement : #TextFirst | ||
}, | ||
|
||
); | ||
}; | ||
} |
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
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
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