SpringBot 1.2.1.0

The release notes from version 1.2.1.0 of SpringBot.


Features

No new features were included.

Improvements

  • The user behaviour attributes have been simplified with the following changes:

    • First Name (Removed) - Replaced with a single Name attribute
    • Last Name (Removed) - Replaced with Name
    • Gender (Removed)
    • Name (Added)
    • EmailConfirmed (Added) - Not utilised in this release but added to prepare for future functionality.
  • Entities with the User behaviour no longer display attributes that users cannot change.
  • The SpringSecurity access whitelist is now more specific, with access being differentiated based on HTTP verb used.
  • API tests have been added to validate authorisation.
  • New protected regions.
  • You can now view JUnit reports of client-side test results.
  • The CRUD action bar is now a button group, improving its appearance.
  • An expired token is now handled as an authorisation error.
  • Admin styles have been moved to the target application.
  • Redundant security annotations removed.
  • There were a few component styling changes for consistency.

Resolved Defects

  • Issue where you couldn’t update entities with the User Behaviour without having to change passwords or set Is Archived.
  • REST endpoints now respect the Visitor access defined in the Security Diagram.
  • Regression resolved, set enums as searchable without causing compilation errors.
  • Run a SpringBot application without the user User Behaviour.

Migration Path

Security Annotations

If you have been using the annotations @AllowAdmin @AllowGuest or @AllowNone, please replace them with the security annotation @PreAuthorize("hasPermission('exampleEntity', 'read')") style annotations for better control.

Styling

There is a new folder structure in scss. There is an admin and frontend folder. The only folder that should be touched on is frontend, as it contains protected regions. admin has now been moved into a templated area. Only dashboard.scss inside the admin/pages folder has protected regions. The rest are not protected.

User Behaviour

If you are currently making use of firstname, lastname or gender attributes, update your model with the following:

Option One

NOTE: Audit log updates may be challenging with this option.

  • Add string attribute called ‘First Name’ to your user entity and make it required.
  • Add string attribute called ‘Last Name’ to your user entity and make it required.
  • Add an enum attribute called ‘Gender’ to your user entity.
  • Associate your ‘Gender’ enum with an enum called ‘Gender’ and add the following literals: Male, Female, Other
Option Two

Gender Enum

Create a gender enum under entities/enums/GenderEnum.java with the following contents:

package com.springbot.basic.entities.enums;
import com.fasterxml.jackson.annotation.JsonProperty;

public enum GenderEnum {
  @JsonProperty("Male")
  MALE("Male"),
  @JsonProperty("Female")
  FEMALE("Female"),
  @JsonProperty("Other")
  OTHER("Other");

  private final String literalValue;

  GenderEnum(String literalValue) {
    this.literalValue = literalValue;
  }

  public boolean equalsName(String name) {
    return this.literalValue.equals(name);
  }

  @Override
  public String toString() {
    return this.literalValue;
  }
}

Add the following to your attributes in entities/UserEntity.java using the protected region Add any additional class fields here.

@NotNull
@Column(name = "last_name")
@ApiModelProperty(notes = "The last name of this entity.")
@ToString.Include
private String lastName;

@NotNull
@Column(name = "username")
@ApiModelProperty(notes = "The username of this entity.")
@ToString.Include
private String username;

@NotNull
@Column(name = "password")
@JsonProperty(access = Access.WRITE_ONLY)
@ToString.Include
private String password;

@Nullable
@Column(name = "gender")
@ApiModelProperty(notes = "The Gender of this entity.")
@ToString.Include
@Enumerated
private GenderEnum gender;

Add import com.springbot.basic.entities.enums.*; into the protected region called Add any additional imports here.

Update the protected region called Customise our revision author name here in any service that you wish to have first and last name as part of the audit history. Add the customisation to Customise our revision author name here.

If you don’t make use of these attributes, nothing will change.

Last updated: 17 June 2020


Start modelling your app today.