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)
|
return new DossierAttributeDefinitionList(dossierAttributeConfigPersistenceService.getDossierAttributes(dossierTemplateId)
|
||||||
.stream()
|
.stream()
|
||||||
.map(config -> DossierAttributeDefinition.builder()
|
.map(config -> DossierAttributeDefinition.builder()
|
||||||
|
|
||||||
.id(config.getId())
|
.id(config.getId())
|
||||||
.name(config.getLabel())
|
.name(config.getLabel())
|
||||||
.type(config.getType())
|
.type(config.getType())
|
||||||
.reportingPlaceholder(config.getPlaceholder())
|
.reportingPlaceholder(config.getPlaceholder())
|
||||||
|
.displaySettings(DossierAttributeDefinition.DossierDisplaySettings.builder()
|
||||||
|
.editable(config.isEditable())
|
||||||
|
.filterable(config.isFilterable())
|
||||||
|
.displayedInDossierList(config.isDisplayedInDossierList())
|
||||||
|
.build())
|
||||||
.build())
|
.build())
|
||||||
.toList());
|
.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,5 +17,18 @@ public class DossierAttributeDefinition {
|
|||||||
private String name;
|
private String name;
|
||||||
private DossierAttributeType type;
|
private DossierAttributeType type;
|
||||||
private String reportingPlaceholder;
|
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:
|
placeholder follows a specific format convention:
|
||||||
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
||||||
whitespaces. The placeholder is unique in a dossier template.
|
whitespaces. The placeholder is unique in a dossier template.
|
||||||
|
displaySettings:
|
||||||
|
$ref: '#/components/schemas/DossierAttributeDisplaySettings'
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- type
|
- type
|
||||||
@ -2872,6 +2874,35 @@ components:
|
|||||||
name: "Document Summary"
|
name: "Document Summary"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.DocumentSummary}}"
|
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:
|
FileAttributeDefinition:
|
||||||
type: object
|
type: object
|
||||||
description: |
|
description: |
|
||||||
@ -2994,10 +3025,18 @@ components:
|
|||||||
name: "Dossier Summary"
|
name: "Dossier Summary"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
||||||
|
displaySettings:
|
||||||
|
editable: true
|
||||||
|
filterable: false
|
||||||
|
displayedInFileList: false
|
||||||
- id: "23e45678-e90b-12d3-a456-765114174321"
|
- id: "23e45678-e90b-12d3-a456-765114174321"
|
||||||
name: "Comment"
|
name: "Comment"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
||||||
|
displaySettings:
|
||||||
|
editable: true
|
||||||
|
filterable: false
|
||||||
|
displayedInFileList: false
|
||||||
FileAttributeDefinitionList:
|
FileAttributeDefinitionList:
|
||||||
type: object
|
type: object
|
||||||
description: A list of file attribute definitions.
|
description: A list of file attribute definitions.
|
||||||
|
|||||||
@ -1492,6 +1492,8 @@ components:
|
|||||||
placeholder follows a specific format convention:
|
placeholder follows a specific format convention:
|
||||||
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
`{{dossier.attribute.<name>}}` while the name is transformed into 'PascalCase' and does not contain
|
||||||
whitespaces. The placeholder is unique in a dossier template.
|
whitespaces. The placeholder is unique in a dossier template.
|
||||||
|
displaySettings:
|
||||||
|
$ref: '#/components/schemas/DossierAttributeDisplaySettings'
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- type
|
- type
|
||||||
@ -1500,6 +1502,35 @@ components:
|
|||||||
name: "Document Summary"
|
name: "Document Summary"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.DocumentSummary}}"
|
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:
|
FileAttributeDefinition:
|
||||||
type: object
|
type: object
|
||||||
description: |
|
description: |
|
||||||
@ -1622,10 +1653,18 @@ components:
|
|||||||
name: "Dossier Summary"
|
name: "Dossier Summary"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
reportingPlaceholder: "{{dossier.attribute.DossierSummary}}"
|
||||||
|
displaySettings:
|
||||||
|
editable: true
|
||||||
|
filterable: false
|
||||||
|
displayedInFileList: false
|
||||||
- id: "23e45678-e90b-12d3-a456-765114174321"
|
- id: "23e45678-e90b-12d3-a456-765114174321"
|
||||||
name: "Comment"
|
name: "Comment"
|
||||||
type: "TEXT"
|
type: "TEXT"
|
||||||
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
reportingPlaceholder: "{{dossier.attribute.Comment}}"
|
||||||
|
displaySettings:
|
||||||
|
editable: true
|
||||||
|
filterable: false
|
||||||
|
displayedInFileList: false
|
||||||
FileAttributeDefinitionList:
|
FileAttributeDefinitionList:
|
||||||
type: object
|
type: object
|
||||||
description: A list of file attribute definitions.
|
description: A list of file attribute definitions.
|
||||||
|
|||||||
@ -30,6 +30,10 @@ public class DossierAttributeConfigEntity {
|
|||||||
@Column
|
@Column
|
||||||
private boolean editable;
|
private boolean editable;
|
||||||
@Column
|
@Column
|
||||||
|
private boolean filterable;
|
||||||
|
@Column
|
||||||
|
private boolean displayedInDossierList;
|
||||||
|
@Column
|
||||||
private String placeholder;
|
private String placeholder;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
|
|||||||
@ -72,6 +72,8 @@ public class DossierAttributeConfigPersistenceService {
|
|||||||
config.setLabel(dossierAttributeConfig.getLabel());
|
config.setLabel(dossierAttributeConfig.getLabel());
|
||||||
config.setType(dossierAttributeConfig.getType());
|
config.setType(dossierAttributeConfig.getType());
|
||||||
config.setEditable(dossierAttributeConfig.isEditable());
|
config.setEditable(dossierAttributeConfig.isEditable());
|
||||||
|
config.setDisplayedInDossierList(dossierAttributeConfig.isDisplayedInDossierList());
|
||||||
|
config.setFilterable(dossierAttributeConfig.isFilterable());
|
||||||
setPlaceholder(config);
|
setPlaceholder(config);
|
||||||
uniqueLabelAndPlaceholder(dossierAttributeConfig);
|
uniqueLabelAndPlaceholder(dossierAttributeConfig);
|
||||||
return dossierAttributeConfigRepository.save(config);
|
return dossierAttributeConfigRepository.save(config);
|
||||||
|
|||||||
@ -251,3 +251,5 @@ databaseChangeLog:
|
|||||||
file: db/changelog/tenant/153-custom-technical-name-change.yaml
|
file: db/changelog/tenant/153-custom-technical-name-change.yaml
|
||||||
- include:
|
- 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
|
@Test
|
||||||
public void testOverrides() throws IOException {
|
public void testOverrides() throws IOException {
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,8 @@ public class DossierAttributeConfig {
|
|||||||
private String id;
|
private String id;
|
||||||
private String label;
|
private String label;
|
||||||
private boolean editable;
|
private boolean editable;
|
||||||
|
private boolean filterable;
|
||||||
|
private boolean displayedInDossierList;
|
||||||
private String placeholder;
|
private String placeholder;
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private DossierAttributeType type = DossierAttributeType.TEXT;
|
private DossierAttributeType type = DossierAttributeType.TEXT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user