RED-10135: Dossier attributes have fields displayed_in_file_list and filterable
This commit is contained in:
parent
bdaac65afe
commit
4adebda2ab
@ -449,11 +449,15 @@ public class DossierTemplateControllerV2 implements DossierTemplateResource {
|
||||
return new DossierAttributeDefinitionList(dossierAttributeConfigPersistenceService.getDossierAttributes(dossierTemplateId)
|
||||
.stream()
|
||||
.map(config -> DossierAttributeDefinition.builder()
|
||||
|
||||
.id(config.getId())
|
||||
.name(config.getLabel())
|
||||
.type(config.getType())
|
||||
.reportingPlaceholder(config.getPlaceholder())
|
||||
.displaySettings(DossierAttributeDefinition.DossierDisplaySettings.builder()
|
||||
.editable(config.isEditable())
|
||||
.filterable(config.isFilterable())
|
||||
.displayedInDossierList(config.isDisplayedInDossierList())
|
||||
.build())
|
||||
.build())
|
||||
.toList());
|
||||
}
|
||||
|
||||
@ -17,5 +17,18 @@ public class DossierAttributeDefinition {
|
||||
private String name;
|
||||
private DossierAttributeType type;
|
||||
private String reportingPlaceholder;
|
||||
private DossierDisplaySettings displaySettings;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class DossierDisplaySettings {
|
||||
|
||||
private boolean editable;
|
||||
private boolean filterable;
|
||||
private boolean displayedInDossierList;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2864,6 +2864,8 @@ components:
|
||||
placeholder follows a specific format convention:
|
||||
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
||||
whitespaces. The placeholder is unique in a dossier template.
|
||||
displaySettings:
|
||||
$ref: '#/components/schemas/DossierAttributeDisplaySettings'
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
@ -2872,6 +2874,35 @@ components:
|
||||
name: "Document Summary"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.DocumentSummary}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInDossierList: false
|
||||
DossierAttributeDisplaySettings:
|
||||
type: object
|
||||
description: |
|
||||
Display setting for the user interface. These settings control how the UI handles and presents the dossier attributes.
|
||||
properties:
|
||||
editable:
|
||||
type: boolean
|
||||
description: |
|
||||
If `true`, the user interfaces allow manual editing of the value. Otherwise only importing and setting by rules would be possible.
|
||||
filterable:
|
||||
type: boolean
|
||||
description: |
|
||||
If `true`, the user interfaces add filter options to the dossier list.
|
||||
displayedInDossierList:
|
||||
type: boolean
|
||||
description: |
|
||||
if `true`, the user interfaces show the values in the dossier list.
|
||||
required:
|
||||
- editable
|
||||
- filterable
|
||||
- displayedInDossierList
|
||||
example:
|
||||
editable: true
|
||||
filterable: true
|
||||
displayedInDossierList: false
|
||||
FileAttributeDefinition:
|
||||
type: object
|
||||
description: |
|
||||
@ -2994,10 +3025,18 @@ components:
|
||||
name: "Dossier Summary"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInFileList: false
|
||||
- id: "23e45678-e90b-12d3-a456-765114174321"
|
||||
name: "Comment"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInFileList: false
|
||||
FileAttributeDefinitionList:
|
||||
type: object
|
||||
description: A list of file attribute definitions.
|
||||
|
||||
@ -1492,6 +1492,8 @@ components:
|
||||
placeholder follows a specific format convention:
|
||||
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
||||
whitespaces. The placeholder is unique in a dossier template.
|
||||
displaySettings:
|
||||
$ref: '#/components/schemas/DossierAttributeDisplaySettings'
|
||||
required:
|
||||
- name
|
||||
- type
|
||||
@ -1500,6 +1502,35 @@ components:
|
||||
name: "Document Summary"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.DocumentSummary}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInDossierList: false
|
||||
DossierAttributeDisplaySettings:
|
||||
type: object
|
||||
description: |
|
||||
Display setting for the user interface. These settings control how the UI handles and presents the dossier attributes.
|
||||
properties:
|
||||
editable:
|
||||
type: boolean
|
||||
description: |
|
||||
If `true`, the user interfaces allow manual editing of the value. Otherwise only importing and setting by rules would be possible.
|
||||
filterable:
|
||||
type: boolean
|
||||
description: |
|
||||
If `true`, the user interfaces add filter options to the dossier list.
|
||||
displayedInDossierList:
|
||||
type: boolean
|
||||
description: |
|
||||
if `true`, the user interfaces show the values in the dossier list.
|
||||
required:
|
||||
- editable
|
||||
- filterable
|
||||
- displayedInDossierList
|
||||
example:
|
||||
editable: true
|
||||
filterable: true
|
||||
displayedInDossierList: false
|
||||
FileAttributeDefinition:
|
||||
type: object
|
||||
description: |
|
||||
@ -1622,10 +1653,18 @@ components:
|
||||
name: "Dossier Summary"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInFileList: false
|
||||
- id: "23e45678-e90b-12d3-a456-765114174321"
|
||||
name: "Comment"
|
||||
type: "TEXT"
|
||||
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
||||
displaySettings:
|
||||
editable: true
|
||||
filterable: false
|
||||
displayedInFileList: false
|
||||
FileAttributeDefinitionList:
|
||||
type: object
|
||||
description: A list of file attribute definitions.
|
||||
|
||||
@ -30,6 +30,10 @@ public class DossierAttributeConfigEntity {
|
||||
@Column
|
||||
private boolean editable;
|
||||
@Column
|
||||
private boolean filterable;
|
||||
@Column
|
||||
private boolean displayedInDossierList;
|
||||
@Column
|
||||
private String placeholder;
|
||||
|
||||
@Column
|
||||
|
||||
@ -72,6 +72,8 @@ public class DossierAttributeConfigPersistenceService {
|
||||
config.setLabel(dossierAttributeConfig.getLabel());
|
||||
config.setType(dossierAttributeConfig.getType());
|
||||
config.setEditable(dossierAttributeConfig.isEditable());
|
||||
config.setDisplayedInDossierList(dossierAttributeConfig.isDisplayedInDossierList());
|
||||
config.setFilterable(dossierAttributeConfig.isFilterable());
|
||||
setPlaceholder(config);
|
||||
uniqueLabelAndPlaceholder(dossierAttributeConfig);
|
||||
return dossierAttributeConfigRepository.save(config);
|
||||
|
||||
@ -250,4 +250,6 @@ databaseChangeLog:
|
||||
- include:
|
||||
file: db/changelog/tenant/153-custom-technical-name-change.yaml
|
||||
- include:
|
||||
file: db/changelog/tenant/154-add-last-download-to-file.yaml
|
||||
file: db/changelog/tenant/154-add-last-download-to-file.yaml
|
||||
- include:
|
||||
file: db/changelog/tenant/155-add-displayed-and-filterable-to-dossier-attribute-config.yaml
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 155-add-displayed-and-filterable-to-dossier-attribute-config
|
||||
author: maverick
|
||||
changes:
|
||||
- addColumn:
|
||||
columns:
|
||||
- column:
|
||||
name: displayed_in_dossier_list
|
||||
type: BOOLEAN
|
||||
defaultValueBoolean: false
|
||||
- column:
|
||||
name: filterable
|
||||
type: BOOLEAN
|
||||
defaultValueBoolean: false
|
||||
tableName: dossier_attribute_config
|
||||
@ -63,6 +63,7 @@ public class ComponentOverrideTest extends AbstractPersistenceServerServiceTest
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testOverrides() throws IOException {
|
||||
|
||||
|
||||
@ -16,6 +16,8 @@ public class DossierAttributeConfig {
|
||||
private String id;
|
||||
private String label;
|
||||
private boolean editable;
|
||||
private boolean filterable;
|
||||
private boolean displayedInDossierList;
|
||||
private String placeholder;
|
||||
@Builder.Default
|
||||
private DossierAttributeType type = DossierAttributeType.TEXT;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user