This repository is now deprecated. All developments for Dont-code are now happening in the Monorepo repository
This plugin for the Dont-code platform enables loading entity data from any rest service.
It is a standard plugin (with no display component), based on the Seed project
- A Nx monorepo with the library rest containing the two plugins.
- An Application plugin-tester loading the plugin automatically and allowing you to test and debug it.
- Unit tests setup with Jest.
- End 2 end tests example plugin-tester-e2e using Cypress.
- Github Action scripts to build and deploy the plugins automatically Workflows.
If you want to use it in the Builder:
- Starts the Builder, and click on "Previewer" button to initiate a session with the Previewer.
- Describe the entity fields in the Builder design page
- Adds a new Source (at the bottom of the page), sets a name, sets its type as 'Rest' and set the url of the rest service to call in 'url' field.
- In the entity field, sets its source field to the name you just added.
- You should see the entity data being displayed in the Previewer
This project is a standard Angular - npm project, so the usual commands apply:
- Installing
npm install nx -g
#Install nx.dev globally
npm install
- Running the tester application
nx run plugin-tester:serve
and point your browser to http://localhost:4200
- Running unit tests
nx run seed:test
- Running Cypress End to end tests
nx run plugin-tester-e2e:e2e
- Build and deploy
Just commit to Development or Release branch, the Github actions scripts will take care of it
- Debugging in Builder or Previewer application We have setup some commands to enable debugging the plugin when run inside the Ide or Previewer. Using npm link is difficult and doesn't work all the time, so we use Yalc.
npm install yalc -g
Installs the Yalc tool globally
npm run publish-all
Publish the library in Yalc repository, after version increase (to bypass Angular caching)
Then in the builder project (ide-ui) :
yalc add @dontcode/plugin-rest
to install the plugin using Yalc
You can now set breakpoints in your plugin classes running in the builder, and if you modify your plugin code, just run
npm run publish-all
again to rebuild it and reload in the builder application.
This project was generated using Nx, visit the Nx Documentation to learn more.