SpringBot Version 2.2.1.0

The release notes from the new version 2.2.1.0 of SpringBot.


Noteworthy changes

  • Added testing coverage for the buttons which appear on the Admin home page.

    • The tests ensure that the button is rendered, and that clicking it routes to the correct page.
    • These tests will only be present when the Joyride is enabled.
  • Added protected regions to items in multipleItemsActions in the Data table.

    • This allows for modifying the default properties of the buttons shown when entities are selected.
  • Moved most of the logic for CSV imports into a CsvUtils class which can be called by all import endpoints.

    • This substantially reduces the length of the Import endpoint.
    • CsvUtils can be found at serverside/src/main/java/[ProjectName]/services/utils/CsvUtils.java.
  • Added protected regions for customising the default users who are added to the development database.
  • Added protected regions to addSearchFunction() in the CRUD edit page.

    • This allows for customisation of the logic used to populate the options for relations in CRUD edit pages.
  • Enabled the following tools when running the application in the test profile.

    • These tools are available through the buttons in the admin home page:

      • Graphiql.
      • Voyager.
      • Altair. Admin Dashboard
  • Removed whitespace at the end of the line in the bot written warning. Whitespace Change for Bot-written Warning

Resolved defects

  • Fixed an issue which stopped the Data table from returning to the first page when filtering entities.
  • Previously the currently active page stayed active, and if there wasn’t enough entities to reach that page then the data table would be blank.
  • Setting an attribute to be hidden for an entity now hides the attribute on the Data table.

    • Hiding an attribute used to only hide the attribute on the Create/Edit page.
      Hide element attribute in action
  • Stopped the bot from writing tests which require an admin user if an admin user will not be added to the development database.
  • If a user has any required attributes or references, it will not be added to your development database. This had the potential to cause issues with tests which relied on the admin user.
  • Updated the handling of a missing ID when updating an entity for REST POST endpoints.
  • This used to return a 500 Error (Internal Server Error), and it now returns a 404 (Not Found).
  • User extension and Forms extension can now be added to the same entity

    • This used to cause an error as they both attempted to add a name attribute to the entity.

Migration path

Abstracting the logic from the CSV import entity led to some protected regions being removed from the individual import endpoints to CsvUtils. The protected regions which were affected have been documented below, so any custom code in your endpoints will need to be copied into CsvUtils.

CsvUtils contains an attribute called typeClass, which can be used to implement logic in protected regions which is specific to one or more versions of the Import endpoint. This can be done using the following snippet:

// % protected region % [Make your changes in here] on begin
if (this.typeClass.getSimpleName().equals("ExampleEntity")) {
    //Add custom changes specific to importing Example entity in here
}
// % protected region % [Make your changes in here] end

Protected regions

All of the following protected regions are contained within CSV Import endpoints, which can be found in serverside/src/main/java/[ProjectName]/controllers/[EntityName]Controller.java. They are all present with the same ID in CSV Utils

ID
Modify the error response for a missing or empty file in import endpoint here
Modify the parsing of headers here
Modify the error response for invalid headers in import endpoint here
Modify the validation of CSV entities here
Modify the error messages for validation errors here
Modify the error response for validation errors here
Modify the creation and update of CSV entities here