-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: suggestions #856
base: main
Are you sure you want to change the base?
chore: suggestions #856
Conversation
|
0e9c05b
to
5b276f2
Compare
@@ -77,16 +72,16 @@ Each service must provide at least two things | |||
On top of that you can specify one of the following option | |||
|
|||
- mockdataPath : the path to the folder containing the mockdata files | |||
- generateMockData : whether or not you want to use automatically generated mockdata | |||
- generateMockData : whether or not you want to use automatically generated mockdata <-- TODO: what happens if i set this to false and only define 1 of 2 entites in the service? error in the frontend? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no data in the frontend, if you say generateMockData: false you declare that you will take care of all the mockdata yourself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, but i can define 1 out of 3 OData Services with mockdata and 2 out of 3 are coming with proxy from live data, correct?
samples/basic-usage/ui5.yaml
Outdated
metadataXmlPath: ./webapp/localService/metadata.xml | ||
# TODO: is mockdataPath necessary when folder not defined? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's necessary as soon as you want mockdata to be found :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it may makes sense to add the folder including the config in the yaml to create the structure when you may add mockdata later
let filePath = ''; | ||
|
||
// Extract the base file name without extension | ||
const baseFileName = path.basename(fileName, path.extname(fileName)).replace(/\.js$/, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the idea but for a sample it seems overkill.
I did however, consider including this in the mockserver by default, just have to come up with a proper naming / folder organization for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great! Little bit like CAP with convention over configuration
.
Ideally you don´t define the js file at all because if i dont use the action my js file all look the same and use the base code.
So in my data folder i only define RootEntity.json
and RootEntity-100.json
and not the js file.
Only if want use custom coding when loading the json file create the js file for the Entity.
Thanks for this nice starting point, I think we can improve the docu there, and i'll look into making the tenant specific mockdata thing part of the builtin functionality |
What should we do with the PR? Should i create a different PR for the tenants sample that we can merge when your feature is ready or do you want to create your own sample? |
If you can create a different PR with the sample feature i'll just use that as a base for the auto loading of data :) |
created here #859 |
Co-authored-by: Nicolas Lunet <[email protected]>
Co-authored-by: Nicolas Lunet <[email protected]>
Co-authored-by: Nicolas Lunet <[email protected]>
0c48e00
to
4fa443d
Compare
Readme specific update are covered in #888 |
Some suggestions, please create a discussion if you need more info
I also created a quick sample for using tenants, for a customer i developed the generic usage of a
base.js
(the naming is maybe confusing with the base api).I make it draft because this is not intended to be merged