SpringBot 2.2.0.0

The release notes from the new version 2.2.0.0 of SpringBot.


Features

  • ⚙ Additional presentation modes for data tables.

    • Data tables can now be configured to be self contained within a single page or to have routing to each different child mode (view/edit/create)
    • The list mode will always be contained within it’s parent page, but each child mode can be represented by a different route.
    • The mode which will be used is determined by the singlePageComponent attribute in the CRUD component part of the data table. This can be changed in any instance of the CRUD component which has been added to a page in your application by the bot.
    • All CRUD components will use the same page by default. The routing option for frontend data tables is only available by changing singlePageComponent to false.

Improvements

  • Upgraded SpringBot to Angular 10

    • The new Angular 10 features are detailed in the linked blog. The process of upgrading to Angular 10 is discussed in the Migration path.
  • Upgraded Springbot to Node v12

    • Migration to Node v12 does not require any additional migration steps
  • Added the bot version number to the admin home page.

    • By popular demand, you can now validate the version of the bot you are using without going to the Platform. Image
  • ⚡ Improved bot performance for large models ⚡

    • Some under the hood bot optimisations have been achieved that will make the building of larger models significantly faster.
  • 🎨 Updated the client-side code style to align with the tslint rules provided by the bot.

    • Based on user feedback, the linting rules and code style have been updated to remove all bot written style linting errors from the client-side.
    • Any remaining linting errors in custom code can be found by using the command yarn lint in the client-side.
    • The linting rules can be found in clientside/tslint.json.
  • Changed API endpoints to take DTOs (Data Transfer Object) as an input instead of the entity type which is being created or modified.

    • This fixes a minor vulnerability that was discovered which allowed entity attributes such as created and created_by to be modified through the API.
  • Added additional protected regions allowing changes to Auditing and Export annotations in entity files.
  • Added protected regions in client-side to allow reuse of data table components with separate logic depending on the instance.
  • Added protected regions to modify the configuration (Selectors, templateUrl, etc.) of library components.

    • This additionally adds support for creating custom overriding HTML templates for library components.
  • Added model validation rules for Radio Group and Dropdown UI elements.

    • Radio Groups and Dropdowns cannot be created unless they contain at least one option.
  • 📚 Outdated bot-written documentation has been removed.

    • Documentation that was written by the bot to describe entities and pages has now been removed as it was outdated and incomplete.
  • Registration button is now hidden if there are no user types that allow registration.

    • Improves the UX of the site, as clicking the register button previously navigated to a page with an empty dropdown with no path forward.
  • Skip the page for selecting the user type to register if there is only one user type that can be registered.

    • Also improves the UX; the dropdown would only have one option so it can be skipped.
  • Added client-side tests for the following Library components:

    • Checkbox
    • Date Picker
    • Dropdown
    • Radio Button
    • Radio Button Group

Resolved Defects

  • Fixed issue which caused exported entities to display in the browser instead of downloading a file.

    • In some cases, a race condition occurred which prevented the necessary headers from being set for export. This prevent files from being downloaded. Mostly affected large exports.
  • 🔒 Replaced hard coded entity name in Import endpoint with correct entity name .
  • Resolved race conditions in front-end CRUD Edit component.

    • Any created or updated entities will now be visible without reloading after returning to the CRUD list.
  • Renamed duplicate protected region.
  • Resolved issue causing the ID of an injected model to be returned instead of the model on the entity diagram when there is a conflict.
  • 🎨 Updated styling of registration page.

    • Registration page can now scroll properly to reach inputs and buttons which were previously cut off the bottom of the screen.
    • Title and back buttons which were previously cut off at the top of the registration form are now fully visible on the registration form.
  • Fixed issues with the the inputs to the registration form.

    • Previously every attribute was required, and the form did not check any validators added to attributes on the user entity.
    • The constraints on the registration form now match the constraints on the user entity.
  • Updated the node version for the Docker from version 10 to 12. This resolves the out of memory build failure that sometimes occurs when using Docker.

Migration path

Upgrading to Angular 10

The migration from Angular version 9.1.2 to version 10.2.4 has been completed by the bots for all bot written code. In the event that migration is required for custom code, please see the official migration documentation.

NOTE: The file clientside/browserslist has been replaced with clientside/.browserslistrc. browserslist will not be automatically deleted by the application, so you will need to copy any changes you have made in this file into .browserslistrc, and delete browserslist before you can start your client-side again.

Routing

Angular 10 has made changes to the way routes are resolved, which stops routes from being defined in more than one location. SpringBot’s previous implementation had cases where the same route was defined more than once (In Admin CRUD Pages), so we have made changes to fix this. This has resulted in the following files being removed from the application:

  • clientside/src/app/admin/pages/**[EntityName]**/**[EntityName]**.admin.page.module.ts
  • clientside/src/app/admin/pages/**[EntityName]**/**[EntityName]**.admin.page.routes.ts

These files are redundant, as routing and imports for admin Data tables are now exclusively handled in the routes and module for the Data table. Any changes that you made in these files will need to be transferred into the following files:

  • clientside/src/app/admin/tiles/crud/**[EntityName]**/**[EntityName]**-admin-crud.module.ts
  • clientside/src/app/admin/pages/**[EntityName]**/**[EntityName**]-admin-crud.routes.ts

The CRUD module contains all of the same protected regions as were present in the page module, so any configuration can be ported across without any issue. The CRUD routes file replaces multiple protected regions in the page routes with one protected region which wraps the routing configuration. The default configuration for the CRUD routes is the same as the page routes, so any updates you have made can be ported across into the new file.

DTOs

The change to using DTOs as the request parameter for API endpoints will require a migration if you have serverside entities with additional properties that you have added. If you want to be able to pass in these attributes as inputs to the APIs, then you need to add the attribute to the relevant DTO class (DTO classes are found in serverside/src/main/java/**[ProjectName]**/dtos). You will also need to make sure that the attribute is set in the constructor for the entity class. Every attribute present in a DTO needs to be set using a snippet similar to the following in the constructor, or the attribute will not be persisted from the DTO to the Entity type:

if (fishEntityDto.getName() != null) {
    this.setName(fishEntityDto.getName());
}

Documentation removal

The documentation that has been removed is usually found within the following two directories:

  • serverside/docs
  • clientside/docs

Any documentation from these directories that you wish to maintain, please make a backup before upgrading and then restore after the first build following the upgrade.

Once restored, these files will not be removed by the bot.

Protected Regions

There were some duplicate protected regions present in the code base which have been renamed. Any custom code present in these protected region will need to be copied into the new protected region after the upgrade has been completed:

File ID New ID Notes
clientside/src/app/components/crud/**[EntityName]**/list/**[EntityName]**-crud-list.component.ts Add any additional config for the dropdown filter question here Add any additional config for the dropdown filter question for enum ref [Attribute Name] + ‘ to [Entity Name] here Protected region was created inside a loop, so it needed to be changed to ensure that duplicate protected regions couldn’t be added to the application

Ready to start building?

Sign up to Codebots today to see how much faster you can build apps with us.