-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from AAFC-BICoE/34789_Allow_to_save_export_con…
…figs 34789 Allow to save export configs
- Loading branch information
Showing
7 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/ca/gc/aafc/dinauser/api/entity/ExportColumnSelection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ca.gc.aafc.dinauser.api.entity; | ||
|
||
import java.util.List; | ||
import javax.validation.constraints.Size; | ||
import javax.validation.constraints.NotEmpty; | ||
import javax.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ExportColumnSelection { | ||
|
||
@NotEmpty | ||
@Size(max = 150) | ||
private String name; | ||
|
||
@NotEmpty | ||
@Size(max = 50) | ||
private String component; | ||
|
||
@NotNull | ||
private List<String> columns; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../db/changelog/migrations/3-Add_saved_export_column_selection_to_user_preference_table.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 https://local.xsd/dbchangelog-4.4.xsd" | ||
context="schema-change"> | ||
|
||
<changeSet context="schema-change" id="2-Add_uuid_to_user_preference_table.xml" author="Brandon Andre"> | ||
|
||
<addColumn tableName="user_preference"> | ||
<column name="saved_export_column_selection" type="jsonb"/> | ||
</addColumn> | ||
</changeSet> | ||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
src/test/java/ca/gc/aafc/dinauser/api/testsupport/fixtures/UserPreferenceFixture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
package ca.gc.aafc.dinauser.api.testsupport.fixtures; | ||
|
||
import ca.gc.aafc.dinauser.api.dto.UserPreferenceDto; | ||
import ca.gc.aafc.dinauser.api.entity.ExportColumnSelection; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
public class UserPreferenceFixture { | ||
|
||
public static UserPreferenceDto.UserPreferenceDtoBuilder newUserPreferenceDto(UUID expectedUserId) { | ||
public static UserPreferenceDto.UserPreferenceDtoBuilder newUserPreferenceDto( | ||
UUID expectedUserId) { | ||
return UserPreferenceDto.builder() | ||
.uiPreference(Map.of("key", "value")) | ||
.userId(expectedUserId); | ||
.uiPreference(Map.of("key", "value")) | ||
.savedExportColumnSelection(List.of(ExportColumnSelection.builder() | ||
.name("my export columns").component("material-sample").columns(List.of("col1", "col2")) | ||
.build())) | ||
.userId(expectedUserId); | ||
} | ||
|
||
} |