Skip to content

Commit

Permalink
feat: add displayName
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteenke committed Jul 4, 2024
1 parent ef068e9 commit 63c4b49
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public abstract class TemplateImportMapper {
@Mapping(target = "properties", qualifiedByName = "properties")
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "displayName", ignore = true)
@Mapping(target = "modificationDate", ignore = true)
@Mapping(target = "modificationUser", ignore = true)
@Mapping(target = "controlTraceabilityManual", ignore = true)
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/tkit/onecx/theme/domain/models/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class Theme extends TraceableEntity {
@Column(name = "NAME")
private String name;

@Column(name = "DISPLAY_NAME")
private String displayName;

@TenantId
@Column(name = "TENANT_ID")
private String tenantId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Map<String, Map<String, ImageDTOV1>> createImages(List<Image> images) {

@Mapping(target = "id", ignore = true)
@Mapping(target = "name", ignore = true)
@Mapping(target = "displayName", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "modificationDate", ignore = true)
Expand All @@ -117,6 +118,7 @@ Map<String, Map<String, ImageDTOV1>> createImages(List<Image> images) {
public abstract void update(EximThemeDTOV1 dto, @MappingTarget Theme entity);

@Mapping(target = "id", ignore = true)
@Mapping(target = "displayName", ignore = true)
@Mapping(target = "creationDate", ignore = true)
@Mapping(target = "creationUser", ignore = true)
@Mapping(target = "modificationDate", ignore = true)
Expand Down
12 changes: 12 additions & 0 deletions src/main/openapi/onecx-theme-internal-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ components:
Theme:
required:
- name
- displayName
type: object
properties:
modificationCount:
Expand All @@ -262,6 +263,9 @@ components:
name:
minLength: 2
type: string
displayName:
minLength: 2
type: string
cssFile:
type: string
description:
Expand Down Expand Up @@ -317,11 +321,15 @@ components:
CreateTheme:
required:
- name
- displayName
type: object
properties:
name:
minLength: 2
type: string
displayName:
minLength: 2
type: string
cssFile:
type: string
description:
Expand All @@ -341,6 +349,7 @@ components:
UpdateTheme:
required:
- name
- displayName
- modificationCount
type: object
properties:
Expand All @@ -350,6 +359,9 @@ components:
name:
minLength: 2
type: string
displayName:
minLength: 2
type: string
cssFile:
type: string
description:
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<include relativeToChangelogFile="true" file="v1/2023-11-09-data-import-log.xml"/>
<include relativeToChangelogFile="true" file="v1/2024-05-27-operator-attribute.xml"/>
<include relativeToChangelogFile="true" file="v1/2024-06-12-drop-not-null.xml"/>
<include relativeToChangelogFile="true" file="v1/2024-07-04-display-name-added.xml"/>
</databaseChangeLog>
14 changes: 14 additions & 0 deletions src/main/resources/db/v1/2024-07-04-display-name-added.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">

<changeSet author="dev (generated)" id="1716816363325-1">
<addColumn tableName="theme">
<column name="display_name" type="VARCHAR(255)"/>
</addColumn>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void createNewThemeTest() {
// create theme
var themeDto = new CreateThemeDTO();
themeDto.setName("test01");
themeDto.setDisplayName("test01");
themeDto.setCssFile("cssFile");
themeDto.setDescription("description");
themeDto.setAssetsUrl("assets/url");
Expand Down Expand Up @@ -82,6 +83,7 @@ void createNewThemeTest() {
// create theme with existing name
themeDto = new CreateThemeDTO();
themeDto.setName("cg");
themeDto.setDisplayName("cg_display");

exception = given().when()
.contentType(APPLICATION_JSON)
Expand Down Expand Up @@ -305,6 +307,7 @@ void updateThemeTest() {
// update none existing theme
var themeDto = new UpdateThemeDTO();
themeDto.setName("test01");
themeDto.setDisplayName("test01");
themeDto.setModificationCount(0);
themeDto.setDescription("description-update");

Expand Down Expand Up @@ -346,6 +349,7 @@ void updateThemeWithExistingNameTest() {

var themeDto = new UpdateThemeDTO();
themeDto.setName("themeWithoutPortal");
themeDto.setDisplayName("themeWithoutPortal");
themeDto.setModificationCount(0);
themeDto.setDescription("description");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void createNewThemeTest() {
// create theme
var themeDto = new CreateThemeDTO();
themeDto.setName("test01");
themeDto.setDisplayName("test01");
themeDto.setCssFile("cssFile");
themeDto.setDescription("description");
themeDto.setAssetsUrl("assets/url");
Expand Down Expand Up @@ -71,6 +72,7 @@ void createNewThemeTest() {
// create theme with existing name
themeDto = new CreateThemeDTO();
themeDto.setName("cg");
themeDto.setDisplayName("cg-display");

exception = given().when()
.contentType(APPLICATION_JSON)
Expand Down Expand Up @@ -260,6 +262,7 @@ void updateThemeTest() {
// update none existing theme
var themeDto = new UpdateThemeDTO();
themeDto.setName("test01");
themeDto.setDisplayName("test01");
themeDto.setModificationCount(0);
themeDto.setDescription("description-update");

Expand Down Expand Up @@ -310,6 +313,7 @@ void updateThemeWithExistingNameTest() {

var themeDto = new UpdateThemeDTO();
themeDto.setName("themeWithoutPortal");
themeDto.setDisplayName("themeWithoutPortal");
themeDto.setModificationCount(0);
themeDto.setDescription("description");

Expand Down

0 comments on commit 63c4b49

Please sign in to comment.