diff --git a/samples/bookshop/pom.xml b/samples/bookshop/pom.xml index ce37d9cf..4ea90122 100644 --- a/samples/bookshop/pom.xml +++ b/samples/bookshop/pom.xml @@ -48,7 +48,7 @@ com.sap.cds cds-feature-attachments - 1.3.3 + 1.4.0-SNAPSHOT diff --git a/samples/bookshop/srv/attachments.cds b/samples/bookshop/srv/attachments.cds index 5a54d43f..dcc35ffe 100644 --- a/samples/bookshop/srv/attachments.cds +++ b/samples/bookshop/srv/attachments.cds @@ -8,7 +8,7 @@ extend my.Books with { @UI.Hidden sizeLimitedAttachments : Composition of many Attachments; @UI.Hidden - mediaValidatedAttachments : Composition of many Attachments; + mediaValidatedAttachments : Composition of one Attachments; @UI.Hidden anotherMediaValidatedAttachments : Composition of many Attachments; } @@ -42,9 +42,20 @@ annotate adminService.Books with @(UI.Facets: [{ $Type : 'UI.ReferenceFacet', ID : 'AttachmentsFacet', Label : '{i18n>attachments}', - Target: 'mediaValidatedAttachments/@UI.LineItem' + Target: 'mediaValidatedAttachments/@UI.FieldGroup' }]); +annotate adminService.Books with @odata.draft.enabled; + + +annotate adminService.Books.mediaValidatedAttachments with @UI.FieldGroup: { + Data: [ + {Value: content}, + {Value: fileName}, + {Value: mimeType}, + {Value: status} + ] +}; service nonDraft { entity Books as projection on my.Books;